From ad7925bbbaa9de6197ab6f49c7dc1e9fea8e86bc Mon Sep 17 00:00:00 2001 From: salam Date: Mon, 23 Mar 2026 06:58:36 +0100 Subject: [PATCH] wip mango --- .../Resources/Players/Tables/PlayersTable.php | 2 +- .../UbEvents/Pages/CreateUbEvent.php | 11 + .../Resources/UbEvents/Pages/EditUbEvent.php | 19 + .../Resources/UbEvents/Pages/ListUbEvents.php | 24 + .../UbEvents/Schemas/UbEventForm.php | 16 + .../UbEvents/Tables/UbEventsTable.php | 38 + .../Resources/UbEvents/UbEventResource.php | 48 + app/Filament/Imports/PlayerImporter.php | 4 +- app/Filament/Imports/UbEventImporter.php | 417 + app/Models/CompetitionGroup.php | 5 + app/Models/Element.php | 5 + app/Models/Player.php | 8 + app/Models/UbEvent.php | 121 +- composer.lock | 127 +- ...2026_03_18_121404_create_players_table.php | 2 +- public/css/app/font-stylesheet.css | 2 +- public/js/filament/forms/components/select.js | 4620 ++++++++- public/js/filament/support/support.js | 9059 ++++++++++++++++- .../tables/components/columns/select.js | 4650 ++++++++- 19 files changed, 19040 insertions(+), 138 deletions(-) create mode 100644 app/Filament/Clusters/StaticData/Resources/UbEvents/Pages/CreateUbEvent.php create mode 100644 app/Filament/Clusters/StaticData/Resources/UbEvents/Pages/EditUbEvent.php create mode 100644 app/Filament/Clusters/StaticData/Resources/UbEvents/Pages/ListUbEvents.php create mode 100644 app/Filament/Clusters/StaticData/Resources/UbEvents/Schemas/UbEventForm.php create mode 100644 app/Filament/Clusters/StaticData/Resources/UbEvents/Tables/UbEventsTable.php create mode 100644 app/Filament/Clusters/StaticData/Resources/UbEvents/UbEventResource.php create mode 100644 app/Filament/Imports/UbEventImporter.php diff --git a/app/Filament/Clusters/StaticData/Resources/Players/Tables/PlayersTable.php b/app/Filament/Clusters/StaticData/Resources/Players/Tables/PlayersTable.php index 0bd2763c..bfa912d1 100644 --- a/app/Filament/Clusters/StaticData/Resources/Players/Tables/PlayersTable.php +++ b/app/Filament/Clusters/StaticData/Resources/Players/Tables/PlayersTable.php @@ -17,7 +17,7 @@ class PlayersTable Stack::make([ TextColumn::make('name') ->searchable(), - TextColumn::make('player_id') + TextColumn::make('id') ->badge() ->searchable(), ]), diff --git a/app/Filament/Clusters/StaticData/Resources/UbEvents/Pages/CreateUbEvent.php b/app/Filament/Clusters/StaticData/Resources/UbEvents/Pages/CreateUbEvent.php new file mode 100644 index 00000000..d8d9cc28 --- /dev/null +++ b/app/Filament/Clusters/StaticData/Resources/UbEvents/Pages/CreateUbEvent.php @@ -0,0 +1,11 @@ +icon('phosphor-upload') + ->label('Events') + ->modalDescription('Separator comma ";"') + ->importer(UbEventImporter::class), + ]; + } +} diff --git a/app/Filament/Clusters/StaticData/Resources/UbEvents/Schemas/UbEventForm.php b/app/Filament/Clusters/StaticData/Resources/UbEvents/Schemas/UbEventForm.php new file mode 100644 index 00000000..cbe7b78b --- /dev/null +++ b/app/Filament/Clusters/StaticData/Resources/UbEvents/Schemas/UbEventForm.php @@ -0,0 +1,16 @@ +components([ + // + ]); + } +} diff --git a/app/Filament/Clusters/StaticData/Resources/UbEvents/Tables/UbEventsTable.php b/app/Filament/Clusters/StaticData/Resources/UbEvents/Tables/UbEventsTable.php new file mode 100644 index 00000000..561db239 --- /dev/null +++ b/app/Filament/Clusters/StaticData/Resources/UbEvents/Tables/UbEventsTable.php @@ -0,0 +1,38 @@ +columns([ + // TextColumn::make('league_id')->searchable(), + TextColumn::make('league.name')->searchable(), + // TextColumn::make('home_id')->searchable(), + // TextColumn::make('away_id')->searchable(), + TextColumn::make('home.name')->searchable(), + TextColumn::make('away.name')->searchable(), + TextColumn::make('player.name')->searchable(), + TextColumn::make('starttime')->dateTime('d. M. Y')->label('Date'), + ]) + ->filters([ + // + ]) + ->recordActions([ + EditAction::make(), + ]) + ->toolbarActions([ + BulkActionGroup::make([ + DeleteBulkAction::make(), + ]), + ]); + } +} diff --git a/app/Filament/Clusters/StaticData/Resources/UbEvents/UbEventResource.php b/app/Filament/Clusters/StaticData/Resources/UbEvents/UbEventResource.php new file mode 100644 index 00000000..424c440a --- /dev/null +++ b/app/Filament/Clusters/StaticData/Resources/UbEvents/UbEventResource.php @@ -0,0 +1,48 @@ + ListUbEvents::route('/'), + ]; + } + + public static function getNavigationBadge(): ?string + { + return parent::getEloquentQuery()->count(); + } +} diff --git a/app/Filament/Imports/PlayerImporter.php b/app/Filament/Imports/PlayerImporter.php index 88a1f4bf..190ad106 100644 --- a/app/Filament/Imports/PlayerImporter.php +++ b/app/Filament/Imports/PlayerImporter.php @@ -15,7 +15,7 @@ class PlayerImporter extends Importer public static function getColumns(): array { return [ - ImportColumn::make('player_id') + ImportColumn::make('id') ->castStateUsing(function (string $state): ?int { if (blank($state)) { return null; @@ -43,7 +43,7 @@ class PlayerImporter extends Importer public function resolveRecord(): Player { return Player::firstOrNew([ - 'player_id' => (int) $this->data['player_id'], + 'id' => (int) $this->data['id'], ]); } diff --git a/app/Filament/Imports/UbEventImporter.php b/app/Filament/Imports/UbEventImporter.php new file mode 100644 index 00000000..24c7a3fa --- /dev/null +++ b/app/Filament/Imports/UbEventImporter.php @@ -0,0 +1,417 @@ +castStateUsing(function (string $state): ?int { + if (blank($state)) { + return null; + } + + return (int) $state; + }) + ->requiredMapping() + ->numeric(), + ImportColumn::make('home_id') + ->castStateUsing(function (string $state): ?int { + if (blank($state)) { + return null; + } + + return (int) $state; + }) + ->requiredMapping() + ->numeric(), + ImportColumn::make('away_id') + ->castStateUsing(function (string $state): ?int { + if (blank($state)) { + return null; + } + + return (int) $state; + }) + ->requiredMapping() + ->numeric(), + ImportColumn::make('player_id') + ->castStateUsing(function (string $state): ?int { + if (blank($state)) { + return null; + } + + return (int) $state; + }) + ->requiredMapping() + ->numeric(), + ImportColumn::make('starttime') + ->castStateUsing(function ($state) { + $state = Carbon::parse($state)->format('Y-m-d h:i:s'); + + return $state; + }) + ->requiredMapping(), + ImportColumn::make('home_away') + ->castStateUsing(function (string $state): ?string { + if (blank($state)) { + return null; + } + + return (string) $state; + }) + ->requiredMapping() + ->numeric(), + ImportColumn::make('home_ft') + ->castStateUsing(function (string $state): ?int { + if (blank($state)) { + return null; + } + + return (int) $state; + }) + ->requiredMapping() + ->numeric(), + ImportColumn::make('away_ft') + ->castStateUsing(function (string $state): ?int { + if (blank($state)) { + return null; + } + + return (int) $state; + }) + ->requiredMapping() + ->numeric(), + ImportColumn::make('home_ht') + ->castStateUsing(function (string $state): ?int { + if (blank($state)) { + return null; + } + + return (int) $state; + }) + ->requiredMapping() + ->numeric(), + ImportColumn::make('away_ht') + ->castStateUsing(function (string $state): ?int { + if (blank($state)) { + return null; + } + + return (int) $state; + }) + ->requiredMapping() + ->numeric(), + ImportColumn::make('goals') + ->castStateUsing(function (string $state): ?int { + if (blank($state)) { + return null; + } + + return (int) $state; + }) + ->requiredMapping() + ->numeric(), + ImportColumn::make('assists') + ->castStateUsing(function (string $state): ?int { + if (blank($state)) { + return null; + } + + return (int) $state; + }) + ->requiredMapping() + ->numeric(), + ImportColumn::make('tackles') + ->castStateUsing(function (string $state): ?int { + if (blank($state)) { + return null; + } + + return (int) $state; + }) + ->requiredMapping() + ->numeric(), + ImportColumn::make('total_passes') + ->castStateUsing(function (string $state): ?int { + if (blank($state)) { + return null; + } + + return (int) $state; + }) + ->requiredMapping() + ->numeric(), + ImportColumn::make('passes_done') + ->castStateUsing(function (string $state): ?int { + if (blank($state)) { + return null; + } + + return (int) $state; + }) + ->requiredMapping() + ->numeric(), + ImportColumn::make('total_duels') + ->castStateUsing(function (string $state): ?int { + if (blank($state)) { + return null; + } + + return (int) $state; + }) + ->requiredMapping() + ->numeric(), + ImportColumn::make('duels_won') + ->castStateUsing(function (string $state): ?int { + if (blank($state)) { + return null; + } + + return (int) $state; + }) + ->requiredMapping() + ->numeric(), + ImportColumn::make('total_ground_duels') + ->castStateUsing(function (string $state): ?int { + if (blank($state)) { + return null; + } + + return (int) $state; + }) + ->requiredMapping() + ->numeric(), + ImportColumn::make('ground_duels_won') + ->castStateUsing(function (string $state): ?int { + if (blank($state)) { + return null; + } + + return (int) $state; + }) + ->requiredMapping() + ->numeric(), + ImportColumn::make('total_aerial_duels') + ->castStateUsing(function (string $state): ?int { + if (blank($state)) { + return null; + } + + return (int) $state; + }) + ->requiredMapping() + ->numeric(), + ImportColumn::make('aerial_duels_won') + ->castStateUsing(function (string $state): ?int { + if (blank($state)) { + return null; + } + + return (int) $state; + }) + ->requiredMapping() + ->numeric(), + ImportColumn::make('minutes_played') + ->castStateUsing(function (string $state): ?int { + if (blank($state)) { + return null; + } + + return (int) $state; + }) + ->requiredMapping() + ->numeric(), + ImportColumn::make('shots_on_target') + ->castStateUsing(function (string $state): ?int { + if (blank($state)) { + return null; + } + + return (int) $state; + }) + ->requiredMapping() + ->numeric(), + ImportColumn::make('shots_off_target') + ->castStateUsing(function (string $state): ?int { + if (blank($state)) { + return null; + } + + return (int) $state; + }) + ->requiredMapping() + ->numeric(), + ImportColumn::make('shots_blocked') + ->castStateUsing(function (string $state): ?int { + if (blank($state)) { + return null; + } + + return (int) $state; + }) + ->requiredMapping() + ->numeric(), + ImportColumn::make('total_dribble') + ->castStateUsing(function (string $state): ?int { + if (blank($state)) { + return null; + } + + return (int) $state; + }) + ->requiredMapping() + ->numeric(), + ImportColumn::make('dribble_done') + ->castStateUsing(function (string $state): ?int { + if (blank($state)) { + return null; + } + + return (int) $state; + }) + ->requiredMapping() + ->numeric(), + ImportColumn::make('position') + ->castStateUsing(function (string $state): ?string { + if (blank($state)) { + return null; + } + + return (string) $state; + }) + ->requiredMapping() + ->numeric(), + ImportColumn::make('rating') + ->castStateUsing(function (string $state): ?float { + if (blank($state)) { + return null; + } + + return (float) $state; + }) + ->requiredMapping() + ->numeric(), + ImportColumn::make('bcm') + ->castStateUsing(function (string $state): ?int { + if (blank($state)) { + return null; + } + + return (int) $state; + }) + ->requiredMapping() + ->numeric(), + ImportColumn::make('hw') + ->castStateUsing(function (string $state): ?int { + if (blank($state)) { + return null; + } + + return (int) $state; + }) + ->requiredMapping() + ->numeric(), + ImportColumn::make('pw') + ->castStateUsing(function (string $state): ?int { + if (blank($state)) { + return null; + } + + return (int) $state; + }) + ->requiredMapping() + ->numeric(), + ImportColumn::make('pm') + ->castStateUsing(function (string $state): ?int { + if (blank($state)) { + return null; + } + + return (int) $state; + }) + ->requiredMapping() + ->numeric(), + ImportColumn::make('possession_lost') + ->castStateUsing(function (string $state): ?int { + if (blank($state)) { + return null; + } + + return (int) $state; + }) + ->requiredMapping() + ->numeric(), + ImportColumn::make('fouls') + ->castStateUsing(function (string $state): ?int { + if (blank($state)) { + return null; + } + + return (int) $state; + }) + ->requiredMapping() + ->numeric(), + ImportColumn::make('was_fouled') + ->castStateUsing(function (string $state): ?int { + if (blank($state)) { + return null; + } + + return (int) $state; + }) + ->requiredMapping() + ->numeric(), + ImportColumn::make('offsides') + ->castStateUsing(function (string $state): ?int { + if (blank($state)) { + return null; + } + + return (int) $state; + }) + ->requiredMapping() + ->numeric(), + ImportColumn::make('date_acquisition') + ->castStateUsing(function ($state) { + $state = Carbon::parse($state)->format('Y-m-d h:i:s'); + + return $state; + }) + ->requiredMapping(), + ]; + } + + public function resolveRecord(): UbEvent + { + return UbEvent::firstOrNew([ + 'league_id' => (int) $this->data['league_id'], + 'home_id,' => (int) $this->data['home_id'], + 'player_id' => (int) $this->data['player_id'], + 'away_id,' => (int) $this->data['away_id'], + 'starttime' => Carbon::parse(strtotime($this->data['starttime'])), + ]); + } + + public static function getCompletedNotificationBody(Import $import): string + { + $body = 'Your ub event import has completed and '.Number::format($import->successful_rows).' '.str('row')->plural($import->successful_rows).' imported.'; + + if ($failedRowsCount = $import->getFailedRowsCount()) { + $body .= ' '.Number::format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to import.'; + } + + return $body; + } +} diff --git a/app/Models/CompetitionGroup.php b/app/Models/CompetitionGroup.php index 623c6b37..553764d2 100644 --- a/app/Models/CompetitionGroup.php +++ b/app/Models/CompetitionGroup.php @@ -3,9 +3,14 @@ namespace App\Models; use Illuminate\Database\Eloquent\Model; +use MongoDB\Laravel\Eloquent\HybridRelations; class CompetitionGroup extends Model { + use HybridRelations; + + protected $connection = 'mariadb'; + protected $fillable = [ 'id', 'name', diff --git a/app/Models/Element.php b/app/Models/Element.php index 6d3eb0ac..daa9ade1 100644 --- a/app/Models/Element.php +++ b/app/Models/Element.php @@ -3,9 +3,14 @@ namespace App\Models; use Illuminate\Database\Eloquent\Model; +use MongoDB\Laravel\Eloquent\HybridRelations; class Element extends Model { + use HybridRelations; + + protected $connection = 'mariadb'; + protected $fillable = [ 'id', 'name', diff --git a/app/Models/Player.php b/app/Models/Player.php index c61e882e..ce96b816 100644 --- a/app/Models/Player.php +++ b/app/Models/Player.php @@ -1,13 +1,21 @@ 'datetime', + 'starttime' => 'datetime', + 'date_acquisition' => 'datetime', ]; } -} -/*** - country_ss - league_ss - home - away - home_ft - away_ft - home_ht - away_ht - date_time_ss - team - player_ss - goals - assists - tackles - total_passes - passes_done - total_duels - duels_won - total_ground_duels - ground_duels_won - total_aerial_duels - aerial_duels_won - minutes_played - shots_on_target - shots_off_target - shots_blocked - total_dribble - dribble_done - position - rating - bcm - hw - pw - pm - possession_ - lost - fouls - was_fouled - offsides - id_player_tm - h_a - date_player_id - date_home_away - id_league - data_di_acquisizione - txleague_id - txhome_id - txaway_id - */ + public function league(): BelongsTo + { + return $this->belongsTo(CompetitionGroup::class, 'league_id', 'id'); + } + + public function home(): BelongsTo + { + return $this->belongsTo(Element::class, 'home_id', 'id'); + } + + public function away(): BelongsTo + { + return $this->belongsTo(Element::class, 'away_id', 'id'); + } + + public function player(): BelongsTo + { + return $this->belongsTo(Player::class, 'player_id', 'id'); + } +} diff --git a/composer.lock b/composer.lock index 5bfa3724..bc9b3994 100644 --- a/composer.lock +++ b/composer.lock @@ -154,36 +154,36 @@ }, { "name": "bezhansalleh/filament-plugin-essentials", - "version": "1.1.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/bezhanSalleh/filament-plugin-essentials.git", - "reference": "3bfdb276a8993ccd5acd9d6b43fd4763cf221d3a" + "reference": "de3a8a07edcf1bc9fe829480ae09aa00265e7f03" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bezhanSalleh/filament-plugin-essentials/zipball/3bfdb276a8993ccd5acd9d6b43fd4763cf221d3a", - "reference": "3bfdb276a8993ccd5acd9d6b43fd4763cf221d3a", + "url": "https://api.github.com/repos/bezhanSalleh/filament-plugin-essentials/zipball/de3a8a07edcf1bc9fe829480ae09aa00265e7f03", + "reference": "de3a8a07edcf1bc9fe829480ae09aa00265e7f03", "shasum": "" }, "require": { "filament/filament": "^4.0|^5.0", - "illuminate/contracts": "^11.28|^12.0", - "php": "^8.2", - "spatie/laravel-package-tools": "^1.9" + "illuminate/contracts": "^11.28|^12.0|^13.0", + "php": "^8.2|^8.3", + "spatie/laravel-package-tools": "^1.0" }, "require-dev": { - "larastan/larastan": "^2.9||^3.0", + "larastan/larastan": "^3.0", "laravel/pint": "^1.14", - "nunomaduro/collision": "^8.1.1||^7.10.0", - "orchestra/testbench": "^10.0.0||^9.0.0", - "pestphp/pest": "^3.0", - "pestphp/pest-plugin-arch": "^3.0", - "pestphp/pest-plugin-laravel": "^3.0", - "pestphp/pest-plugin-type-coverage": "^3.5", - "phpstan/extension-installer": "^1.3||^2.0", - "phpstan/phpstan-deprecation-rules": "^1.1||^2.0", - "phpstan/phpstan-phpunit": "^1.3||^2.0", + "nunomaduro/collision": "^7.10.0|^8.1.1", + "orchestra/testbench": "^9.0.0|^10.0.0|^11.0.0", + "pestphp/pest": "^3.0|^4.0", + "pestphp/pest-plugin-arch": "^3.0|^4.0", + "pestphp/pest-plugin-laravel": "^3.0|^4.0", + "pestphp/pest-plugin-type-coverage": "^3.5|^4.0", + "phpstan/extension-installer": "^1.3|^2.0", + "phpstan/phpstan-deprecation-rules": "^1.1|^2.0", + "phpstan/phpstan-phpunit": "^1.3|^2.0", "rector/rector": "^2.1", "spatie/laravel-ray": "^1.40" }, @@ -220,7 +220,7 @@ ], "support": { "issues": "https://github.com/bezhanSalleh/filament-plugin-essentials/issues", - "source": "https://github.com/bezhanSalleh/filament-plugin-essentials/tree/1.1.0" + "source": "https://github.com/bezhanSalleh/filament-plugin-essentials/tree/1.2.1" }, "funding": [ { @@ -228,36 +228,36 @@ "type": "github" } ], - "time": "2026-01-19T19:23:25+00:00" + "time": "2026-03-22T08:15:32+00:00" }, { "name": "bezhansalleh/filament-shield", - "version": "4.1.0", + "version": "4.2.0", "source": { "type": "git", "url": "https://github.com/bezhanSalleh/filament-shield.git", - "reference": "bb5ac95b3c10f801e4c54bb289be8c055968726a" + "reference": "a48ea9ca115c644ce40380b853142afcd65e38d1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bezhanSalleh/filament-shield/zipball/bb5ac95b3c10f801e4c54bb289be8c055968726a", - "reference": "bb5ac95b3c10f801e4c54bb289be8c055968726a", + "url": "https://api.github.com/repos/bezhanSalleh/filament-shield/zipball/a48ea9ca115c644ce40380b853142afcd65e38d1", + "reference": "a48ea9ca115c644ce40380b853142afcd65e38d1", "shasum": "" }, "require": { "bezhansalleh/filament-plugin-essentials": "^1.0", "filament/filament": "^4.0|^5.0", - "illuminate/contracts": "^11.28|^12.0", - "illuminate/support": "^11.28|^12.0", - "php": "^8.2", - "spatie/laravel-package-tools": "^1.92", - "spatie/laravel-permission": "^6.0" + "illuminate/contracts": "^11.28|^12.0|^13.0", + "illuminate/support": "^11.28|^12.0|^13.0", + "php": "^8.2|^8.3", + "spatie/laravel-package-tools": "^1.0", + "spatie/laravel-permission": "^6.0|^7.0" }, "require-dev": { - "larastan/larastan": "^3.8", + "larastan/larastan": "^3.0", "laravel/pint": "^1.26", "nunomaduro/collision": "^8.8", - "orchestra/testbench": "^10.8", + "orchestra/testbench": "^9.0|^10.0|^11.0", "pestphp/pest": "^3.8|^4.0", "pestphp/pest-plugin-laravel": "^3.2|^4.0", "pestphp/pest-plugin-livewire": "^3.0|^4.0", @@ -266,7 +266,7 @@ "phpstan/phpstan": "^2.1", "phpstan/phpstan-deprecation-rules": "^2.0", "phpstan/phpstan-phpunit": "^2.0", - "phpunit/phpunit": "^11.5", + "phpunit/phpunit": "^11.0|^12.0", "rector/jack": "^0.4.0", "rector/rector": "^2.2", "spatie/laravel-ray": "^1.43" @@ -315,7 +315,7 @@ ], "support": { "issues": "https://github.com/bezhanSalleh/filament-shield/issues", - "source": "https://github.com/bezhanSalleh/filament-shield/tree/4.1.0" + "source": "https://github.com/bezhanSalleh/filament-shield/tree/4.2.0" }, "funding": [ { @@ -323,7 +323,7 @@ "type": "github" } ], - "time": "2026-01-19T19:28:46+00:00" + "time": "2026-03-22T08:31:44+00:00" }, { "name": "blade-ui-kit/blade-heroicons", @@ -699,16 +699,16 @@ }, { "name": "chillerlan/php-settings-container", - "version": "3.2.1", + "version": "3.3.0", "source": { "type": "git", "url": "https://github.com/chillerlan/php-settings-container.git", - "reference": "95ed3e9676a1d47cab2e3174d19b43f5dbf52681" + "reference": "a0a487cbf5344f721eb504bf0f59bada40c381b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/chillerlan/php-settings-container/zipball/95ed3e9676a1d47cab2e3174d19b43f5dbf52681", - "reference": "95ed3e9676a1d47cab2e3174d19b43f5dbf52681", + "url": "https://api.github.com/repos/chillerlan/php-settings-container/zipball/a0a487cbf5344f721eb504bf0f59bada40c381b7", + "reference": "a0a487cbf5344f721eb504bf0f59bada40c381b7", "shasum": "" }, "require": { @@ -716,11 +716,13 @@ "php": "^8.1" }, "require-dev": { + "phan/phan": "^5.5.2", "phpmd/phpmd": "^2.15", - "phpstan/phpstan": "^1.11", - "phpstan/phpstan-deprecation-rules": "^1.2", + "phpstan/phpstan": "^2.1.31", + "phpstan/phpstan-deprecation-rules": "^2.0.3", "phpunit/phpunit": "^10.5", - "squizlabs/php_codesniffer": "^3.10" + "slevomat/coding-standard": "^8.22", + "squizlabs/php_codesniffer": "^4.0" }, "type": "library", "autoload": { @@ -745,7 +747,8 @@ "Settings", "configuration", "container", - "helper" + "helper", + "property hook" ], "support": { "issues": "https://github.com/chillerlan/php-settings-container/issues", @@ -761,32 +764,32 @@ "type": "ko_fi" } ], - "time": "2024-07-16T11:13:48+00:00" + "time": "2026-03-20T21:10:52+00:00" }, { "name": "codeat3/blade-phosphor-icons", - "version": "2.3.0", + "version": "2.4.0", "source": { "type": "git", "url": "https://github.com/codeat3/blade-phosphor-icons.git", - "reference": "2812a27ec642359344429d344c7f7bbdfad489ce" + "reference": "39a40c44908729d20f03f9903f4abcc165b1b02b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/codeat3/blade-phosphor-icons/zipball/2812a27ec642359344429d344c7f7bbdfad489ce", - "reference": "2812a27ec642359344429d344c7f7bbdfad489ce", + "url": "https://api.github.com/repos/codeat3/blade-phosphor-icons/zipball/39a40c44908729d20f03f9903f4abcc165b1b02b", + "reference": "39a40c44908729d20f03f9903f4abcc165b1b02b", "shasum": "" }, "require": { "blade-ui-kit/blade-icons": "^1.1", - "illuminate/support": "^8.0|^9.0|^10.0|^11.0|^12.0", + "illuminate/support": "^8.0|^9.0|^10.0|^11.0|^12.0|^13.0", "php": "^7.4|^8.0" }, "require-dev": { - "codeat3/blade-icon-generation-helpers": "^0.10", + "codeat3/blade-icon-generation-helpers": "^0.12", "codeat3/phpcs-styles": "^1.0", - "orchestra/testbench": "^6.0|^7.0|^8.0|^9.0|^10.0", - "phpunit/phpunit": "^9.0|^10.5|^11.0" + "orchestra/testbench": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0", + "phpunit/phpunit": "^9.0|^10.5|^11.0|^12.0" }, "type": "library", "extra": { @@ -824,7 +827,7 @@ ], "support": { "issues": "https://github.com/codeat3/blade-phosphor-icons/issues", - "source": "https://github.com/codeat3/blade-phosphor-icons/tree/2.3.0" + "source": "https://github.com/codeat3/blade-phosphor-icons/tree/2.4.0" }, "funding": [ { @@ -832,7 +835,7 @@ "type": "github" } ], - "time": "2025-02-25T06:29:09+00:00" + "time": "2026-03-21T13:21:02+00:00" }, { "name": "codewithkyrian/filament-date-range", @@ -6705,21 +6708,21 @@ }, { "name": "swisnl/filament-backgrounds", - "version": "2.0.2", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/swisnl/filament-backgrounds.git", - "reference": "ae5bb5f909b3e11905b98eaee88ef46a56bdb952" + "reference": "c108f8024de047754773f37fd49ce4192e49fc59" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/swisnl/filament-backgrounds/zipball/ae5bb5f909b3e11905b98eaee88ef46a56bdb952", - "reference": "ae5bb5f909b3e11905b98eaee88ef46a56bdb952", + "url": "https://api.github.com/repos/swisnl/filament-backgrounds/zipball/c108f8024de047754773f37fd49ce4192e49fc59", + "reference": "c108f8024de047754773f37fd49ce4192e49fc59", "shasum": "" }, "require": { "filament/filament": "^4.0|^5.0", - "illuminate/contracts": "^11.0|^12.0", + "illuminate/contracts": "^11.0|^12.0|^13.0", "php": "^8.2", "spatie/laravel-package-tools": "^1.15.0" }, @@ -6727,10 +6730,10 @@ "larastan/larastan": "^2.9|^3.0", "laravel/pint": "^1.13", "nunomaduro/collision": "^7.10|^8.1", - "orchestra/testbench": "^8.15|^9.0|^10.0", - "pestphp/pest": "^2.25|^3.7", - "pestphp/pest-plugin-arch": "^2.4|^3.0", - "pestphp/pest-plugin-laravel": "^2.2|^3.1", + "orchestra/testbench": "^9.9|^10.0|^11.0", + "pestphp/pest": "^3.7|^4.4", + "pestphp/pest-plugin-arch": "^3.0|^4.0", + "pestphp/pest-plugin-laravel": "^3.1|^4.1", "phpstan/extension-installer": "^1.4", "phpstan/phpstan-deprecation-rules": "^1.2|^2.0", "phpstan/phpstan-phpunit": "^1.4|^2.0" @@ -6777,7 +6780,7 @@ "type": "github" } ], - "time": "2026-01-20T16:02:48+00:00" + "time": "2026-03-20T09:07:43+00:00" }, { "name": "symfony/clock", diff --git a/database/migrations/2026_03_18_121404_create_players_table.php b/database/migrations/2026_03_18_121404_create_players_table.php index f0f78c80..5e0144cd 100644 --- a/database/migrations/2026_03_18_121404_create_players_table.php +++ b/database/migrations/2026_03_18_121404_create_players_table.php @@ -13,8 +13,8 @@ return new class extends Migration { Schema::create('players', function (Blueprint $table) { $table->id(); - $table->integer('player_id')->index()->uniqid(); $table->string('name'); + $table->dateTime('birthday')->nullable(); $table->timestamps(); }); } diff --git a/public/css/app/font-stylesheet.css b/public/css/app/font-stylesheet.css index 4867c7cb..67856ab5 100644 --- a/public/css/app/font-stylesheet.css +++ b/public/css/app/font-stylesheet.css @@ -2,7 +2,7 @@ font-family: 'Sport'; font-style: normal; font-weight: 500; - src: url('../../fonts/sport.ttf') format('truetype') + src: url('../fonts/sport.ttf') format('truetype') } .sport { diff --git a/public/js/filament/forms/components/select.js b/public/js/filament/forms/components/select.js index df50c93c..d3d5cafe 100644 --- a/public/js/filament/forms/components/select.js +++ b/public/js/filament/forms/components/select.js @@ -1,4 +1,4622 @@ -var Ft=Math.min,vt=Math.max,Ht=Math.round;var st=n=>({x:n,y:n}),ji={left:"right",right:"left",bottom:"top",top:"bottom"},qi={start:"end",end:"start"};function De(n,t,e){return vt(n,Ft(t,e))}function Vt(n,t){return typeof n=="function"?n(t):n}function yt(n){return n.split("-")[0]}function Wt(n){return n.split("-")[1]}function Ae(n){return n==="x"?"y":"x"}function Ce(n){return n==="y"?"height":"width"}var Ji=new Set(["top","bottom"]);function ht(n){return Ji.has(yt(n))?"y":"x"}function Le(n){return Ae(ht(n))}function Je(n,t,e){e===void 0&&(e=!1);let i=Wt(n),o=Le(n),s=Ce(o),r=o==="x"?i===(e?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(r=Bt(r)),[r,Bt(r)]}function Qe(n){let t=Bt(n);return[ie(n),t,ie(t)]}function ie(n){return n.replace(/start|end/g,t=>qi[t])}var je=["left","right"],qe=["right","left"],Qi=["top","bottom"],Zi=["bottom","top"];function tn(n,t,e){switch(n){case"top":case"bottom":return e?t?qe:je:t?je:qe;case"left":case"right":return t?Qi:Zi;default:return[]}}function Ze(n,t,e,i){let o=Wt(n),s=tn(yt(n),e==="start",i);return o&&(s=s.map(r=>r+"-"+o),t&&(s=s.concat(s.map(ie)))),s}function Bt(n){return n.replace(/left|right|bottom|top/g,t=>ji[t])}function en(n){return{top:0,right:0,bottom:0,left:0,...n}}function ti(n){return typeof n!="number"?en(n):{top:n,right:n,bottom:n,left:n}}function Ot(n){let{x:t,y:e,width:i,height:o}=n;return{width:i,height:o,top:e,left:t,right:t+i,bottom:e+o,x:t,y:e}}function ei(n,t,e){let{reference:i,floating:o}=n,s=ht(t),r=Le(t),a=Ce(r),l=yt(t),c=s==="y",f=i.x+i.width/2-o.width/2,d=i.y+i.height/2-o.height/2,p=i[a]/2-o[a]/2,u;switch(l){case"top":u={x:f,y:i.y-o.height};break;case"bottom":u={x:f,y:i.y+i.height};break;case"right":u={x:i.x+i.width,y:d};break;case"left":u={x:i.x-o.width,y:d};break;default:u={x:i.x,y:i.y}}switch(Wt(t)){case"start":u[r]-=p*(e&&c?-1:1);break;case"end":u[r]+=p*(e&&c?-1:1);break}return u}var ii=async(n,t,e)=>{let{placement:i="bottom",strategy:o="absolute",middleware:s=[],platform:r}=e,a=s.filter(Boolean),l=await(r.isRTL==null?void 0:r.isRTL(t)),c=await r.getElementRects({reference:n,floating:t,strategy:o}),{x:f,y:d}=ei(c,i,l),p=i,u={},g=0;for(let m=0;mk<=0)){var W,tt;let k=(((W=s.flip)==null?void 0:W.index)||0)+1,Y=q[k];if(Y&&(!(d==="alignment"?w!==ht(Y):!1)||V.every(L=>ht(L.placement)===w?L.overflows[0]>0:!0)))return{data:{index:k,overflows:V},reset:{placement:Y}};let B=(tt=V.filter(X=>X.overflows[0]<=0).sort((X,L)=>X.overflows[1]-L.overflows[1])[0])==null?void 0:tt.placement;if(!B)switch(u){case"bestFit":{var z;let X=(z=V.filter(L=>{if(F){let et=ht(L.placement);return et===w||et==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(et=>et>0).reduce((et,ee)=>et+ee,0)]).sort((L,et)=>L[1]-et[1])[0])==null?void 0:z[0];X&&(B=X);break}case"initialPlacement":B=a;break}if(o!==B)return{reset:{placement:B}}}return{}}}};var nn=new Set(["left","top"]);async function on(n,t){let{placement:e,platform:i,elements:o}=n,s=await(i.isRTL==null?void 0:i.isRTL(o.floating)),r=yt(e),a=Wt(e),l=ht(e)==="y",c=nn.has(r)?-1:1,f=s&&l?-1:1,d=Vt(t,n),{mainAxis:p,crossAxis:u,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof g=="number"&&(u=a==="end"?g*-1:g),l?{x:u*f,y:p*c}:{x:p*c,y:u*f}}var oi=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(t){var e,i;let{x:o,y:s,placement:r,middlewareData:a}=t,l=await on(t,n);return r===((e=a.offset)==null?void 0:e.placement)&&(i=a.arrow)!=null&&i.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:r}}}}},si=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(t){let{x:e,y:i,placement:o}=t,{mainAxis:s=!0,crossAxis:r=!1,limiter:a={fn:S=>{let{x:E,y:w}=S;return{x:E,y:w}}},...l}=Vt(n,t),c={x:e,y:i},f=await Ie(t,l),d=ht(yt(o)),p=Ae(d),u=c[p],g=c[d];if(s){let S=p==="y"?"top":"left",E=p==="y"?"bottom":"right",w=u+f[S],D=u-f[E];u=De(w,u,D)}if(r){let S=d==="y"?"top":"left",E=d==="y"?"bottom":"right",w=g+f[S],D=g-f[E];g=De(w,g,D)}let m=a.fn({...t,[p]:u,[d]:g});return{...m,data:{x:m.x-e,y:m.y-i,enabled:{[p]:s,[d]:r}}}}}};function oe(){return typeof window<"u"}function Et(n){return ai(n)?(n.nodeName||"").toLowerCase():"#document"}function U(n){var t;return(n==null||(t=n.ownerDocument)==null?void 0:t.defaultView)||window}function ct(n){var t;return(t=(ai(n)?n.ownerDocument:n.document)||window.document)==null?void 0:t.documentElement}function ai(n){return oe()?n instanceof Node||n instanceof U(n).Node:!1}function it(n){return oe()?n instanceof Element||n instanceof U(n).Element:!1}function rt(n){return oe()?n instanceof HTMLElement||n instanceof U(n).HTMLElement:!1}function ri(n){return!oe()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof U(n).ShadowRoot}var sn=new Set(["inline","contents"]);function It(n){let{overflow:t,overflowX:e,overflowY:i,display:o}=nt(n);return/auto|scroll|overlay|hidden|clip/.test(t+i+e)&&!sn.has(o)}var rn=new Set(["table","td","th"]);function li(n){return rn.has(Et(n))}var an=[":popover-open",":modal"];function zt(n){return an.some(t=>{try{return n.matches(t)}catch{return!1}})}var ln=["transform","translate","scale","rotate","perspective"],cn=["transform","translate","scale","rotate","perspective","filter"],dn=["paint","layout","strict","content"];function se(n){let t=re(),e=it(n)?nt(n):n;return ln.some(i=>e[i]?e[i]!=="none":!1)||(e.containerType?e.containerType!=="normal":!1)||!t&&(e.backdropFilter?e.backdropFilter!=="none":!1)||!t&&(e.filter?e.filter!=="none":!1)||cn.some(i=>(e.willChange||"").includes(i))||dn.some(i=>(e.contain||"").includes(i))}function ci(n){let t=ut(n);for(;rt(t)&&!Dt(t);){if(se(t))return t;if(zt(t))return null;t=ut(t)}return null}function re(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}var fn=new Set(["html","body","#document"]);function Dt(n){return fn.has(Et(n))}function nt(n){return U(n).getComputedStyle(n)}function Xt(n){return it(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function ut(n){if(Et(n)==="html")return n;let t=n.assignedSlot||n.parentNode||ri(n)&&n.host||ct(n);return ri(t)?t.host:t}function di(n){let t=ut(n);return Dt(t)?n.ownerDocument?n.ownerDocument.body:n.body:rt(t)&&It(t)?t:di(t)}function ne(n,t,e){var i;t===void 0&&(t=[]),e===void 0&&(e=!0);let o=di(n),s=o===((i=n.ownerDocument)==null?void 0:i.body),r=U(o);if(s){let a=ae(r);return t.concat(r,r.visualViewport||[],It(o)?o:[],a&&e?ne(a):[])}return t.concat(o,ne(o,[],e))}function ae(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function pi(n){let t=nt(n),e=parseFloat(t.width)||0,i=parseFloat(t.height)||0,o=rt(n),s=o?n.offsetWidth:e,r=o?n.offsetHeight:i,a=Ht(e)!==s||Ht(i)!==r;return a&&(e=s,i=r),{width:e,height:i,$:a}}function gi(n){return it(n)?n:n.contextElement}function Tt(n){let t=gi(n);if(!rt(t))return st(1);let e=t.getBoundingClientRect(),{width:i,height:o,$:s}=pi(t),r=(s?Ht(e.width):e.width)/i,a=(s?Ht(e.height):e.height)/o;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}var hn=st(0);function mi(n){let t=U(n);return!re()||!t.visualViewport?hn:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function un(n,t,e){return t===void 0&&(t=!1),!e||t&&e!==U(n)?!1:t}function $t(n,t,e,i){t===void 0&&(t=!1),e===void 0&&(e=!1);let o=n.getBoundingClientRect(),s=gi(n),r=st(1);t&&(i?it(i)&&(r=Tt(i)):r=Tt(n));let a=un(s,e,i)?mi(s):st(0),l=(o.left+a.x)/r.x,c=(o.top+a.y)/r.y,f=o.width/r.x,d=o.height/r.y;if(s){let p=U(s),u=i&&it(i)?U(i):i,g=p,m=ae(g);for(;m&&i&&u!==g;){let S=Tt(m),E=m.getBoundingClientRect(),w=nt(m),D=E.left+(m.clientLeft+parseFloat(w.paddingLeft))*S.x,A=E.top+(m.clientTop+parseFloat(w.paddingTop))*S.y;l*=S.x,c*=S.y,f*=S.x,d*=S.y,l+=D,c+=A,g=U(m),m=ae(g)}}return Ot({width:f,height:d,x:l,y:c})}function le(n,t){let e=Xt(n).scrollLeft;return t?t.left+e:$t(ct(n)).left+e}function bi(n,t){let e=n.getBoundingClientRect(),i=e.left+t.scrollLeft-le(n,e),o=e.top+t.scrollTop;return{x:i,y:o}}function pn(n){let{elements:t,rect:e,offsetParent:i,strategy:o}=n,s=o==="fixed",r=ct(i),a=t?zt(t.floating):!1;if(i===r||a&&s)return e;let l={scrollLeft:0,scrollTop:0},c=st(1),f=st(0),d=rt(i);if((d||!d&&!s)&&((Et(i)!=="body"||It(r))&&(l=Xt(i)),rt(i))){let u=$t(i);c=Tt(i),f.x=u.x+i.clientLeft,f.y=u.y+i.clientTop}let p=r&&!d&&!s?bi(r,l):st(0);return{width:e.width*c.x,height:e.height*c.y,x:e.x*c.x-l.scrollLeft*c.x+f.x+p.x,y:e.y*c.y-l.scrollTop*c.y+f.y+p.y}}function gn(n){return Array.from(n.getClientRects())}function mn(n){let t=ct(n),e=Xt(n),i=n.ownerDocument.body,o=vt(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),s=vt(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight),r=-e.scrollLeft+le(n),a=-e.scrollTop;return nt(i).direction==="rtl"&&(r+=vt(t.clientWidth,i.clientWidth)-o),{width:o,height:s,x:r,y:a}}var fi=25;function bn(n,t){let e=U(n),i=ct(n),o=e.visualViewport,s=i.clientWidth,r=i.clientHeight,a=0,l=0;if(o){s=o.width,r=o.height;let f=re();(!f||f&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}let c=le(i);if(c<=0){let f=i.ownerDocument,d=f.body,p=getComputedStyle(d),u=f.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,g=Math.abs(i.clientWidth-d.clientWidth-u);g<=fi&&(s-=g)}else c<=fi&&(s+=c);return{width:s,height:r,x:a,y:l}}var vn=new Set(["absolute","fixed"]);function yn(n,t){let e=$t(n,!0,t==="fixed"),i=e.top+n.clientTop,o=e.left+n.clientLeft,s=rt(n)?Tt(n):st(1),r=n.clientWidth*s.x,a=n.clientHeight*s.y,l=o*s.x,c=i*s.y;return{width:r,height:a,x:l,y:c}}function hi(n,t,e){let i;if(t==="viewport")i=bn(n,e);else if(t==="document")i=mn(ct(n));else if(it(t))i=yn(t,e);else{let o=mi(n);i={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Ot(i)}function vi(n,t){let e=ut(n);return e===t||!it(e)||Dt(e)?!1:nt(e).position==="fixed"||vi(e,t)}function wn(n,t){let e=t.get(n);if(e)return e;let i=ne(n,[],!1).filter(a=>it(a)&&Et(a)!=="body"),o=null,s=nt(n).position==="fixed",r=s?ut(n):n;for(;it(r)&&!Dt(r);){let a=nt(r),l=se(r);!l&&a.position==="fixed"&&(o=null),(s?!l&&!o:!l&&a.position==="static"&&!!o&&vn.has(o.position)||It(r)&&!l&&vi(n,r))?i=i.filter(f=>f!==r):o=a,r=ut(r)}return t.set(n,i),i}function Sn(n){let{element:t,boundary:e,rootBoundary:i,strategy:o}=n,r=[...e==="clippingAncestors"?zt(t)?[]:wn(t,this._c):[].concat(e),i],a=r[0],l=r.reduce((c,f)=>{let d=hi(t,f,o);return c.top=vt(d.top,c.top),c.right=Ft(d.right,c.right),c.bottom=Ft(d.bottom,c.bottom),c.left=vt(d.left,c.left),c},hi(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function xn(n){let{width:t,height:e}=pi(n);return{width:t,height:e}}function On(n,t,e){let i=rt(t),o=ct(t),s=e==="fixed",r=$t(n,!0,s,t),a={scrollLeft:0,scrollTop:0},l=st(0);function c(){l.x=le(o)}if(i||!i&&!s)if((Et(t)!=="body"||It(o))&&(a=Xt(t)),i){let u=$t(t,!0,s,t);l.x=u.x+t.clientLeft,l.y=u.y+t.clientTop}else o&&c();s&&!i&&o&&c();let f=o&&!i&&!s?bi(o,a):st(0),d=r.left+a.scrollLeft-l.x-f.x,p=r.top+a.scrollTop-l.y-f.y;return{x:d,y:p,width:r.width,height:r.height}}function Te(n){return nt(n).position==="static"}function ui(n,t){if(!rt(n)||nt(n).position==="fixed")return null;if(t)return t(n);let e=n.offsetParent;return ct(n)===e&&(e=e.ownerDocument.body),e}function yi(n,t){let e=U(n);if(zt(n))return e;if(!rt(n)){let o=ut(n);for(;o&&!Dt(o);){if(it(o)&&!Te(o))return o;o=ut(o)}return e}let i=ui(n,t);for(;i&&li(i)&&Te(i);)i=ui(i,t);return i&&Dt(i)&&Te(i)&&!se(i)?e:i||ci(n)||e}var En=async function(n){let t=this.getOffsetParent||yi,e=this.getDimensions,i=await e(n.floating);return{reference:On(n.reference,await t(n.floating),n.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function Dn(n){return nt(n).direction==="rtl"}var An={convertOffsetParentRelativeRectToViewportRelativeRect:pn,getDocumentElement:ct,getClippingRect:Sn,getOffsetParent:yi,getElementRects:En,getClientRects:gn,getDimensions:xn,getScale:Tt,isElement:it,isRTL:Dn};var wi=oi;var Si=si,xi=ni;var Oi=(n,t,e)=>{let i=new Map,o={platform:An,...e},s={...o.platform,_c:i};return ii(n,t,{...o,platform:s})};function Ei(n,t){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);t&&(i=i.filter(function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable})),e.push.apply(e,i)}return e}function ft(n){for(var t=1;t=0)&&(e[o]=n[o]);return e}function In(n,t){if(n==null)return{};var e=Ln(n,t),i,o;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(o=0;o=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(e[i]=n[i])}return e}var Tn="1.15.6";function pt(n){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(n)}var mt=pt(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Zt=pt(/Edge/i),Di=pt(/firefox/i),Gt=pt(/safari/i)&&!pt(/chrome/i)&&!pt(/android/i),$e=pt(/iP(ad|od|hone)/i),Pi=pt(/chrome/i)&&pt(/android/i),Mi={capture:!1,passive:!1};function O(n,t,e){n.addEventListener(t,e,!mt&&Mi)}function x(n,t,e){n.removeEventListener(t,e,!mt&&Mi)}function ve(n,t){if(t){if(t[0]===">"&&(t=t.substring(1)),n)try{if(n.matches)return n.matches(t);if(n.msMatchesSelector)return n.msMatchesSelector(t);if(n.webkitMatchesSelector)return n.webkitMatchesSelector(t)}catch{return!1}return!1}}function Ni(n){return n.host&&n!==document&&n.host.nodeType?n.host:n.parentNode}function lt(n,t,e,i){if(n){e=e||document;do{if(t!=null&&(t[0]===">"?n.parentNode===e&&ve(n,t):ve(n,t))||i&&n===e)return n;if(n===e)break}while(n=Ni(n))}return null}var Ai=/\s+/g;function Q(n,t,e){if(n&&t)if(n.classList)n.classList[e?"add":"remove"](t);else{var i=(" "+n.className+" ").replace(Ai," ").replace(" "+t+" "," ");n.className=(i+(e?" "+t:"")).replace(Ai," ")}}function b(n,t,e){var i=n&&n.style;if(i){if(e===void 0)return document.defaultView&&document.defaultView.getComputedStyle?e=document.defaultView.getComputedStyle(n,""):n.currentStyle&&(e=n.currentStyle),t===void 0?e:e[t];!(t in i)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),i[t]=e+(typeof e=="string"?"":"px")}}function Nt(n,t){var e="";if(typeof n=="string")e=n;else do{var i=b(n,"transform");i&&i!=="none"&&(e=i+" "+e)}while(!t&&(n=n.parentNode));var o=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return o&&new o(e)}function ki(n,t,e){if(n){var i=n.getElementsByTagName(t),o=0,s=i.length;if(e)for(;o=s:r=o<=s,!r)return i;if(i===dt())break;i=xt(i,!1)}return!1}function kt(n,t,e,i){for(var o=0,s=0,r=n.children;s2&&arguments[2]!==void 0?arguments[2]:{},o=i.evt,s=In(i,Fn);te.pluginEvent.bind(v)(t,e,ft({dragEl:h,parentEl:R,ghostEl:y,rootEl:I,nextEl:Lt,lastDownEl:pe,cloneEl:T,cloneHidden:St,dragStarted:Kt,putSortable:H,activeSortable:v.active,originalEvent:o,oldIndex:Mt,oldDraggableIndex:qt,newIndex:Z,newDraggableIndex:wt,hideGhostForTarget:$i,unhideGhostForTarget:Ki,cloneNowHidden:function(){St=!0},cloneNowShown:function(){St=!1},dispatchSortableEvent:function(a){K({sortable:e,name:a,originalEvent:o})}},s))};function K(n){Bn(ft({putSortable:H,cloneEl:T,targetEl:h,rootEl:I,oldIndex:Mt,oldDraggableIndex:qt,newIndex:Z,newDraggableIndex:wt},n))}var h,R,y,I,Lt,pe,T,St,Mt,Z,qt,wt,ce,H,Pt=!1,ye=!1,we=[],At,at,Pe,Me,Ii,Ti,Kt,Rt,Jt,Qt=!1,de=!1,ge,$,Ne=[],Ve=!1,Se=[],Oe=typeof document<"u",fe=$e,_i=Zt||mt?"cssFloat":"float",Hn=Oe&&!Pi&&!$e&&"draggable"in document.createElement("div"),Wi=(function(){if(Oe){if(mt)return!1;var n=document.createElement("x");return n.style.cssText="pointer-events:auto",n.style.pointerEvents==="auto"}})(),zi=function(t,e){var i=b(t),o=parseInt(i.width)-parseInt(i.paddingLeft)-parseInt(i.paddingRight)-parseInt(i.borderLeftWidth)-parseInt(i.borderRightWidth),s=kt(t,0,e),r=kt(t,1,e),a=s&&b(s),l=r&&b(r),c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+N(s).width,f=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+N(r).width;if(i.display==="flex")return i.flexDirection==="column"||i.flexDirection==="column-reverse"?"vertical":"horizontal";if(i.display==="grid")return i.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(s&&a.float&&a.float!=="none"){var d=a.float==="left"?"left":"right";return r&&(l.clear==="both"||l.clear===d)?"vertical":"horizontal"}return s&&(a.display==="block"||a.display==="flex"||a.display==="table"||a.display==="grid"||c>=o&&i[_i]==="none"||r&&i[_i]==="none"&&c+f>o)?"vertical":"horizontal"},Vn=function(t,e,i){var o=i?t.left:t.top,s=i?t.right:t.bottom,r=i?t.width:t.height,a=i?e.left:e.top,l=i?e.right:e.bottom,c=i?e.width:e.height;return o===a||s===l||o+r/2===a+c/2},Wn=function(t,e){var i;return we.some(function(o){var s=o[j].options.emptyInsertThreshold;if(!(!s||Ke(o))){var r=N(o),a=t>=r.left-s&&t<=r.right+s,l=e>=r.top-s&&e<=r.bottom+s;if(a&&l)return i=o}}),i},Xi=function(t){function e(s,r){return function(a,l,c,f){var d=a.options.group.name&&l.options.group.name&&a.options.group.name===l.options.group.name;if(s==null&&(r||d))return!0;if(s==null||s===!1)return!1;if(r&&s==="clone")return s;if(typeof s=="function")return e(s(a,l,c,f),r)(a,l,c,f);var p=(r?a:l).options.group.name;return s===!0||typeof s=="string"&&s===p||s.join&&s.indexOf(p)>-1}}var i={},o=t.group;(!o||ue(o)!="object")&&(o={name:o}),i.name=o.name,i.checkPull=e(o.pull,!0),i.checkPut=e(o.put),i.revertClone=o.revertClone,t.group=i},$i=function(){!Wi&&y&&b(y,"display","none")},Ki=function(){!Wi&&y&&b(y,"display","")};Oe&&!Pi&&document.addEventListener("click",function(n){if(ye)return n.preventDefault(),n.stopPropagation&&n.stopPropagation(),n.stopImmediatePropagation&&n.stopImmediatePropagation(),ye=!1,!1},!0);var Ct=function(t){if(h){t=t.touches?t.touches[0]:t;var e=Wn(t.clientX,t.clientY);if(e){var i={};for(var o in t)t.hasOwnProperty(o)&&(i[o]=t[o]);i.target=i.rootEl=e,i.preventDefault=void 0,i.stopPropagation=void 0,e[j]._onDragOver(i)}}},zn=function(t){h&&h.parentNode[j]._isOutsideThisEl(t.target)};function v(n,t){if(!(n&&n.nodeType&&n.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(n));this.el=n,this.options=t=gt({},t),n[j]=this;var e={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(n.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return zi(n,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(r,a){r.setData("Text",a.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:v.supportPointer!==!1&&"PointerEvent"in window&&(!Gt||$e),emptyInsertThreshold:5};te.initializePlugins(this,n,e);for(var i in e)!(i in t)&&(t[i]=e[i]);Xi(t);for(var o in this)o.charAt(0)==="_"&&typeof this[o]=="function"&&(this[o]=this[o].bind(this));this.nativeDraggable=t.forceFallback?!1:Hn,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?O(n,"pointerdown",this._onTapStart):(O(n,"mousedown",this._onTapStart),O(n,"touchstart",this._onTapStart)),this.nativeDraggable&&(O(n,"dragover",this),O(n,"dragenter",this)),we.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),gt(this,Mn())}v.prototype={constructor:v,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(Rt=null)},_getDirection:function(t,e){return typeof this.options.direction=="function"?this.options.direction.call(this,t,e,h):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,i=this.el,o=this.options,s=o.preventOnFilter,r=t.type,a=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,l=(a||t).target,c=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||l,f=o.filter;if(qn(i),!h&&!(/mousedown|pointerdown/.test(r)&&t.button!==0||o.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&Gt&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=lt(l,o.draggable,i,!1),!(l&&l.animated)&&pe!==l)){if(Mt=ot(l),qt=ot(l,o.draggable),typeof f=="function"){if(f.call(this,t,l,this)){K({sortable:e,rootEl:c,name:"filter",targetEl:l,toEl:i,fromEl:i}),G("filter",e,{evt:t}),s&&t.preventDefault();return}}else if(f&&(f=f.split(",").some(function(d){if(d=lt(c,d.trim(),i,!1),d)return K({sortable:e,rootEl:d,name:"filter",targetEl:l,fromEl:i,toEl:i}),G("filter",e,{evt:t}),!0}),f)){s&&t.preventDefault();return}o.handle&&!lt(c,o.handle,i,!1)||this._prepareDragStart(t,a,l)}}},_prepareDragStart:function(t,e,i){var o=this,s=o.el,r=o.options,a=s.ownerDocument,l;if(i&&!h&&i.parentNode===s){var c=N(i);if(I=s,h=i,R=h.parentNode,Lt=h.nextSibling,pe=i,ce=r.group,v.dragged=h,At={target:h,clientX:(e||t).clientX,clientY:(e||t).clientY},Ii=At.clientX-c.left,Ti=At.clientY-c.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,h.style["will-change"]="all",l=function(){if(G("delayEnded",o,{evt:t}),v.eventCanceled){o._onDrop();return}o._disableDelayedDragEvents(),!Di&&o.nativeDraggable&&(h.draggable=!0),o._triggerDragStart(t,e),K({sortable:o,name:"choose",originalEvent:t}),Q(h,r.chosenClass,!0)},r.ignore.split(",").forEach(function(f){ki(h,f.trim(),ke)}),O(a,"dragover",Ct),O(a,"mousemove",Ct),O(a,"touchmove",Ct),r.supportPointer?(O(a,"pointerup",o._onDrop),!this.nativeDraggable&&O(a,"pointercancel",o._onDrop)):(O(a,"mouseup",o._onDrop),O(a,"touchend",o._onDrop),O(a,"touchcancel",o._onDrop)),Di&&this.nativeDraggable&&(this.options.touchStartThreshold=4,h.draggable=!0),G("delayStart",this,{evt:t}),r.delay&&(!r.delayOnTouchOnly||e)&&(!this.nativeDraggable||!(Zt||mt))){if(v.eventCanceled){this._onDrop();return}r.supportPointer?(O(a,"pointerup",o._disableDelayedDrag),O(a,"pointercancel",o._disableDelayedDrag)):(O(a,"mouseup",o._disableDelayedDrag),O(a,"touchend",o._disableDelayedDrag),O(a,"touchcancel",o._disableDelayedDrag)),O(a,"mousemove",o._delayedDragTouchMoveHandler),O(a,"touchmove",o._delayedDragTouchMoveHandler),r.supportPointer&&O(a,"pointermove",o._delayedDragTouchMoveHandler),o._dragStartTimer=setTimeout(l,r.delay)}else l()}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){h&&ke(h),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;x(t,"mouseup",this._disableDelayedDrag),x(t,"touchend",this._disableDelayedDrag),x(t,"touchcancel",this._disableDelayedDrag),x(t,"pointerup",this._disableDelayedDrag),x(t,"pointercancel",this._disableDelayedDrag),x(t,"mousemove",this._delayedDragTouchMoveHandler),x(t,"touchmove",this._delayedDragTouchMoveHandler),x(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||t.pointerType=="touch"&&t,!this.nativeDraggable||e?this.options.supportPointer?O(document,"pointermove",this._onTouchMove):e?O(document,"touchmove",this._onTouchMove):O(document,"mousemove",this._onTouchMove):(O(h,"dragend",this),O(I,"dragstart",this._onDragStart));try{document.selection?me(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,e){if(Pt=!1,I&&h){G("dragStarted",this,{evt:e}),this.nativeDraggable&&O(document,"dragover",zn);var i=this.options;!t&&Q(h,i.dragClass,!1),Q(h,i.ghostClass,!0),v.active=this,t&&this._appendGhost(),K({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(at){this._lastX=at.clientX,this._lastY=at.clientY,$i();for(var t=document.elementFromPoint(at.clientX,at.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(at.clientX,at.clientY),t!==e);)e=t;if(h.parentNode[j]._isOutsideThisEl(t),e)do{if(e[j]){var i=void 0;if(i=e[j]._onDragOver({clientX:at.clientX,clientY:at.clientY,target:t,rootEl:e}),i&&!this.options.dragoverBubble)break}t=e}while(e=Ni(e));Ki()}},_onTouchMove:function(t){if(At){var e=this.options,i=e.fallbackTolerance,o=e.fallbackOffset,s=t.touches?t.touches[0]:t,r=y&&Nt(y,!0),a=y&&r&&r.a,l=y&&r&&r.d,c=fe&&$&&Li($),f=(s.clientX-At.clientX+o.x)/(a||1)+(c?c[0]-Ne[0]:0)/(a||1),d=(s.clientY-At.clientY+o.y)/(l||1)+(c?c[1]-Ne[1]:0)/(l||1);if(!v.active&&!Pt){if(i&&Math.max(Math.abs(s.clientX-this._lastX),Math.abs(s.clientY-this._lastY))=0&&(K({rootEl:R,name:"add",toEl:R,fromEl:I,originalEvent:t}),K({sortable:this,name:"remove",toEl:R,originalEvent:t}),K({rootEl:R,name:"sort",toEl:R,fromEl:I,originalEvent:t}),K({sortable:this,name:"sort",toEl:R,originalEvent:t})),H&&H.save()):Z!==Mt&&Z>=0&&(K({sortable:this,name:"update",toEl:R,originalEvent:t}),K({sortable:this,name:"sort",toEl:R,originalEvent:t})),v.active&&((Z==null||Z===-1)&&(Z=Mt,wt=qt),K({sortable:this,name:"end",toEl:R,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){G("nulling",this),I=h=R=y=Lt=T=pe=St=At=at=Kt=Z=wt=Mt=qt=Rt=Jt=H=ce=v.dragged=v.ghost=v.clone=v.active=null,Se.forEach(function(t){t.checked=!0}),Se.length=Pe=Me=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":h&&(this._onDragOver(t),Xn(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],e,i=this.el.children,o=0,s=i.length,r=this.options;oo.right+s||n.clientY>i.bottom&&n.clientX>i.left:n.clientY>o.bottom+s||n.clientX>i.right&&n.clientY>i.top}function Un(n,t,e,i,o,s,r,a){var l=i?n.clientY:n.clientX,c=i?e.height:e.width,f=i?e.top:e.left,d=i?e.bottom:e.right,p=!1;if(!r){if(a&&gef+c*s/2:ld-ge)return-Jt}else if(l>f+c*(1-o)/2&&ld-c*s/2)?l>f+c/2?1:-1:0}function Gn(n){return ot(h){},options:W,optionsLimit:tt=null,placeholder:z,position:k=null,searchableOptionFields:Y=["label"],searchDebounce:B=1e3,searchingMessage:X="Searching...",searchPrompt:L="Search...",state:et,statePath:ee=null}){this.canOptionLabelsWrap=t,this.canSelectPlaceholder=e,this.element=i,this.getOptionLabelUsing=o,this.getOptionLabelsUsing=s,this.getOptionsUsing=r,this.getSearchResultsUsing=a,this.hasDynamicOptions=l,this.hasDynamicSearchResults=c,this.hasInitialNoOptionsMessage=f,this.initialOptionLabel=d,this.initialOptionLabels=p,this.initialState=u,this.isAutofocused=g,this.isDisabled=m,this.isHtmlAllowed=S,this.isMultiple=E,this.isReorderable=w,this.isSearchable=D,this.livewireId=A,this.loadingMessage=C,this.maxItems=F,this.maxItemsMessage=q,this.noOptionsMessage=J,this.noSearchResultsMessage=_,this.onStateChange=V,this.options=W,this.optionsLimit=tt,this.originalOptions=JSON.parse(JSON.stringify(W)),this.placeholder=z,this.position=k,this.searchableOptionFields=Array.isArray(Y)?Y:["label"],this.searchDebounce=B,this.searchingMessage=X,this.searchPrompt=L,this.state=et,this.statePath=ee,this.activeSearchId=0,this.labelRepository={},this.isOpen=!1,this.selectedIndex=-1,this.searchQuery="",this.searchTimeout=null,this.isSearching=!1,this.selectedDisplayVersion=0,this.render(),this.setUpEventListeners(),this.isAutofocused&&this.selectButton.focus()}populateLabelRepositoryFromOptions(t){if(!(!t||!Array.isArray(t)))for(let e of t)e.options&&Array.isArray(e.options)?this.populateLabelRepositoryFromOptions(e.options):e.value!==void 0&&e.label!==void 0&&(this.labelRepository[e.value]=e.label)}render(){this.populateLabelRepositoryFromOptions(this.options),this.container=document.createElement("div"),this.container.className="fi-select-input-ctn",this.canOptionLabelsWrap||this.container.classList.add("fi-select-input-ctn-option-labels-not-wrapped"),this.container.setAttribute("aria-haspopup","listbox"),this.selectButton=document.createElement("button"),this.selectButton.className="fi-select-input-btn",this.selectButton.type="button",this.selectButton.setAttribute("aria-expanded","false"),this.selectedDisplay=document.createElement("div"),this.selectedDisplay.className="fi-select-input-value-ctn",this.updateSelectedDisplay(),this.selectButton.appendChild(this.selectedDisplay),this.dropdown=document.createElement("div"),this.dropdown.className="fi-dropdown-panel fi-scrollable",this.dropdown.setAttribute("role","listbox"),this.dropdown.setAttribute("tabindex","-1"),this.dropdown.style.display="none",this.dropdownId=`fi-select-input-dropdown-${Math.random().toString(36).substring(2,11)}`,this.dropdown.id=this.dropdownId,this.isMultiple&&this.dropdown.setAttribute("aria-multiselectable","true"),this.isSearchable&&(this.searchContainer=document.createElement("div"),this.searchContainer.className="fi-select-input-search-ctn",this.searchInput=document.createElement("input"),this.searchInput.className="fi-input",this.searchInput.type="text",this.searchInput.placeholder=this.searchPrompt,this.searchInput.setAttribute("aria-label","Search"),this.searchContainer.appendChild(this.searchInput),this.dropdown.appendChild(this.searchContainer),this.searchInput.addEventListener("input",t=>{this.isDisabled||this.handleSearch(t)}),this.searchInput.addEventListener("keydown",t=>{if(!this.isDisabled){if(t.key==="Tab"){t.preventDefault();let e=this.getVisibleOptions();if(e.length===0)return;t.shiftKey?this.selectedIndex=e.length-1:this.selectedIndex=0,e.forEach(i=>{i.classList.remove("fi-selected")}),e[this.selectedIndex].classList.add("fi-selected"),e[this.selectedIndex].focus()}else if(t.key==="ArrowDown"){if(t.preventDefault(),t.stopPropagation(),this.getVisibleOptions().length===0)return;this.selectedIndex=-1,this.searchInput.blur(),this.focusNextOption()}else if(t.key==="ArrowUp"){t.preventDefault(),t.stopPropagation();let e=this.getVisibleOptions();if(e.length===0)return;this.selectedIndex=e.length-1,this.searchInput.blur(),e[this.selectedIndex].classList.add("fi-selected"),e[this.selectedIndex].focus(),e[this.selectedIndex].id&&this.dropdown.setAttribute("aria-activedescendant",e[this.selectedIndex].id),this.scrollOptionIntoView(e[this.selectedIndex])}else if(t.key==="Enter"){if(t.preventDefault(),t.stopPropagation(),this.isSearching)return;let e=this.getVisibleOptions();if(e.length===0)return;let i=e.find(s=>{let r=s.getAttribute("aria-disabled")==="true",a=s.classList.contains("fi-disabled"),l=s.offsetParent===null;return!(r||a||l)});if(!i)return;let o=i.getAttribute("data-value");if(o===null)return;this.selectOption(o)}}})),this.optionsList=document.createElement("ul"),this.renderOptions(),this.container.appendChild(this.selectButton),this.container.appendChild(this.dropdown),this.element.appendChild(this.container),this.applyDisabledState()}renderOptions(){this.optionsList.innerHTML="";let t=0,e=this.options,i=0,o=!1;this.options.forEach(a=>{a.options&&Array.isArray(a.options)?(i+=a.options.length,o=!0):i++}),o?this.optionsList.className="fi-select-input-options-ctn":i>0&&(this.optionsList.className="fi-dropdown-list");let s=o?null:this.optionsList,r=0;for(let a of e){if(this.optionsLimit>0&&r>=this.optionsLimit)break;if(a.options&&Array.isArray(a.options)){let l=a.options;if(this.isMultiple&&Array.isArray(this.state)&&this.state.length>0&&(l=a.options.filter(c=>!this.state.includes(c.value))),l.length>0){if(this.optionsLimit>0){let c=this.optionsLimit-r;c{let a=this.createOptionElement(r.value,r);s.appendChild(a)}),i.appendChild(o),i.appendChild(s),this.optionsList.appendChild(i)}createOptionElement(t,e){let i=t,o=e,s=!1;typeof e=="object"&&e!==null&&"label"in e&&"value"in e&&(i=e.value,o=e.label,s=e.isDisabled||!1);let r=document.createElement("li");r.className="fi-dropdown-list-item fi-select-input-option",s&&r.classList.add("fi-disabled");let a=`fi-select-input-option-${Math.random().toString(36).substring(2,11)}`;if(r.id=a,r.setAttribute("role","option"),r.setAttribute("data-value",i),r.setAttribute("tabindex","0"),s&&r.setAttribute("aria-disabled","true"),this.isHtmlAllowed&&typeof o=="string"){let f=document.createElement("div");f.innerHTML=o;let d=f.textContent||f.innerText||o;r.setAttribute("aria-label",d)}let l=this.isMultiple?Array.isArray(this.state)&&this.state.includes(i):this.state===i;r.setAttribute("aria-selected",l?"true":"false"),l&&r.classList.add("fi-selected");let c=document.createElement("span");return this.isHtmlAllowed?c.innerHTML=o:c.textContent=o,r.appendChild(c),s||r.addEventListener("click",f=>{f.preventDefault(),f.stopPropagation(),this.selectOption(i),this.isMultiple&&(this.isSearchable&&this.searchInput?setTimeout(()=>{this.searchInput.focus()},0):setTimeout(()=>{r.focus()},0))}),r}async updateSelectedDisplay(){this.selectedDisplayVersion=this.selectedDisplayVersion+1;let t=this.selectedDisplayVersion,e=document.createDocumentFragment();if(this.isMultiple){if(!Array.isArray(this.state)||this.state.length===0){let o=document.createElement("span");o.textContent=this.placeholder,o.classList.add("fi-select-input-placeholder"),e.appendChild(o)}else{let o=await this.getLabelsForMultipleSelection();if(t!==this.selectedDisplayVersion)return;this.addBadgesForSelectedOptions(o,e)}t===this.selectedDisplayVersion&&(this.selectedDisplay.replaceChildren(e),this.isOpen&&this.deferPositionDropdown());return}if(this.state===null||this.state===""){let o=document.createElement("span");if(o.textContent=this.placeholder,o.classList.add("fi-select-input-placeholder"),e.appendChild(o),t===this.selectedDisplayVersion){this.selectedDisplay.replaceChildren(e);let s=this.container.querySelector(".fi-select-input-value-remove-btn");s&&s.remove(),this.container.classList.remove("fi-select-input-ctn-clearable")}return}let i=await this.getLabelForSingleSelection();t===this.selectedDisplayVersion&&(this.addSingleSelectionDisplay(i,e),t===this.selectedDisplayVersion&&this.selectedDisplay.replaceChildren(e))}async getLabelsForMultipleSelection(){let t=this.getSelectedOptionLabels(),e=[];if(Array.isArray(this.state)){for(let o of this.state)if(!P(this.labelRepository[o])){if(P(t[o])){this.labelRepository[o]=t[o];continue}e.push(o.toString())}}if(e.length>0&&P(this.initialOptionLabels)&&JSON.stringify(this.state)===JSON.stringify(this.initialState)){if(Array.isArray(this.initialOptionLabels))for(let o of this.initialOptionLabels)P(o)&&o.value!==void 0&&o.label!==void 0&&e.includes(o.value)&&(this.labelRepository[o.value]=o.label)}else if(e.length>0&&this.getOptionLabelsUsing)try{let o=await this.getOptionLabelsUsing();for(let s of o)P(s)&&s.value!==void 0&&s.label!==void 0&&(this.labelRepository[s.value]=s.label)}catch(o){console.error("Error fetching option labels:",o)}let i=[];if(Array.isArray(this.state))for(let o of this.state)P(this.labelRepository[o])?i.push(this.labelRepository[o]):P(t[o])?i.push(t[o]):i.push(o);return i}createBadgeElement(t,e){let i=document.createElement("span");i.className="fi-badge fi-size-md fi-color fi-color-primary fi-text-color-600 dark:fi-text-color-200",P(t)&&i.setAttribute("data-value",t);let o=document.createElement("span");o.className="fi-badge-label-ctn";let s=document.createElement("span");s.className="fi-badge-label",this.canOptionLabelsWrap&&s.classList.add("fi-wrapped"),this.isHtmlAllowed?s.innerHTML=e:s.textContent=e,o.appendChild(s),i.appendChild(o);let r=this.createRemoveButton(t,e);return i.appendChild(r),i}createRemoveButton(t,e){let i=document.createElement("button");return i.type="button",i.className="fi-badge-delete-btn",i.innerHTML='',i.setAttribute("aria-label","Remove "+(this.isHtmlAllowed?e.replace(/<[^>]*>/g,""):e)),i.addEventListener("click",o=>{o.stopPropagation(),P(t)&&this.selectOption(t)}),i.addEventListener("keydown",o=>{(o.key===" "||o.key==="Enter")&&(o.preventDefault(),o.stopPropagation(),P(t)&&this.selectOption(t))}),i}addBadgesForSelectedOptions(t,e=this.selectedDisplay){let i=document.createElement("div");i.className="fi-select-input-value-badges-ctn",t.forEach((o,s)=>{let r=Array.isArray(this.state)?this.state[s]:null,a=this.createBadgeElement(r,o);i.appendChild(a)}),e.appendChild(i),this.isReorderable&&(i.addEventListener("click",o=>{o.stopPropagation()}),i.addEventListener("mousedown",o=>{o.stopPropagation()}),new Ui(i,{animation:150,onEnd:()=>{let o=[];i.querySelectorAll("[data-value]").forEach(s=>{o.push(s.getAttribute("data-value"))}),this.state=o,this.onStateChange(this.state)}}))}async getLabelForSingleSelection(){let t=this.labelRepository[this.state];if(bt(t)&&(t=this.getSelectedOptionLabel(this.state)),bt(t)&&P(this.initialOptionLabel)&&this.state===this.initialState)t=this.initialOptionLabel,P(this.state)&&(this.labelRepository[this.state]=t);else if(bt(t)&&this.getOptionLabelUsing)try{t=await this.getOptionLabelUsing(),P(t)&&P(this.state)&&(this.labelRepository[this.state]=t)}catch(e){console.error("Error fetching option label:",e),t=this.state}else bt(t)&&(t=this.state);return t}addSingleSelectionDisplay(t,e=this.selectedDisplay){let i=document.createElement("span");if(i.className="fi-select-input-value-label",this.isHtmlAllowed?i.innerHTML=t:i.textContent=t,e.appendChild(i),!this.canSelectPlaceholder||this.container.querySelector(".fi-select-input-value-remove-btn"))return;let o=document.createElement("button");o.type="button",o.className="fi-select-input-value-remove-btn",o.innerHTML='',o.setAttribute("aria-label","Clear selection"),o.addEventListener("click",s=>{s.stopPropagation(),this.selectOption("")}),o.addEventListener("keydown",s=>{(s.key===" "||s.key==="Enter")&&(s.preventDefault(),s.stopPropagation(),this.selectOption(""))}),this.container.appendChild(o),this.container.classList.add("fi-select-input-ctn-clearable")}getSelectedOptionLabel(t){if(P(this.labelRepository[t]))return this.labelRepository[t];let e="";for(let i of this.options)if(i.options&&Array.isArray(i.options)){for(let o of i.options)if(o.value===t){e=o.label,this.labelRepository[t]=e;break}}else if(i.value===t){e=i.label,this.labelRepository[t]=e;break}return e}setUpEventListeners(){this.buttonClickListener=()=>{this.toggleDropdown()},this.documentClickListener=t=>{!this.container.contains(t.target)&&this.isOpen&&this.closeDropdown()},this.buttonKeydownListener=t=>{this.isDisabled||this.handleSelectButtonKeydown(t)},this.dropdownKeydownListener=t=>{this.isDisabled||this.isSearchable&&document.activeElement===this.searchInput&&!["Tab","Escape"].includes(t.key)||this.handleDropdownKeydown(t)},this.selectButton.addEventListener("click",this.buttonClickListener),document.addEventListener("click",this.documentClickListener),this.selectButton.addEventListener("keydown",this.buttonKeydownListener),this.dropdown.addEventListener("keydown",this.dropdownKeydownListener),!this.isMultiple&&this.livewireId&&this.statePath&&this.getOptionLabelUsing&&(this.refreshOptionLabelListener=async t=>{if(t.detail.livewireId===this.livewireId&&t.detail.statePath===this.statePath&&P(this.state))try{delete this.labelRepository[this.state];let e=await this.getOptionLabelUsing();P(e)&&(this.labelRepository[this.state]=e);let i=this.selectedDisplay.querySelector(".fi-select-input-value-label");P(i)&&(this.isHtmlAllowed?i.innerHTML=e:i.textContent=e),this.updateOptionLabelInList(this.state,e)}catch(e){console.error("Error refreshing option label:",e)}},window.addEventListener("filament-forms::select.refreshSelectedOptionLabel",this.refreshOptionLabelListener))}updateOptionLabelInList(t,e){this.labelRepository[t]=e;let i=this.getVisibleOptions();for(let o of i)if(o.getAttribute("data-value")===String(t)){if(o.innerHTML="",this.isHtmlAllowed){let s=document.createElement("span");s.innerHTML=e,o.appendChild(s)}else o.appendChild(document.createTextNode(e));break}for(let o of this.options)if(o.options&&Array.isArray(o.options)){for(let s of o.options)if(s.value===t){s.label=e;break}}else if(o.value===t){o.label=e;break}for(let o of this.originalOptions)if(o.options&&Array.isArray(o.options)){for(let s of o.options)if(s.value===t){s.label=e;break}}else if(o.value===t){o.label=e;break}}handleSelectButtonKeydown(t){switch(t.key){case"ArrowDown":t.preventDefault(),t.stopPropagation(),this.isOpen?this.focusNextOption():this.openDropdown();break;case"ArrowUp":t.preventDefault(),t.stopPropagation(),this.isOpen?this.focusPreviousOption():this.openDropdown();break;case" ":if(t.preventDefault(),this.isOpen){if(this.selectedIndex>=0){let e=this.getVisibleOptions()[this.selectedIndex];e&&e.click()}}else this.openDropdown();break;case"Enter":break;case"Escape":this.isOpen&&(t.preventDefault(),this.closeDropdown());break;case"Tab":this.isOpen&&this.closeDropdown();break;default:if(this.isSearchable&&!t.ctrlKey&&!t.metaKey&&!t.altKey&&typeof t.key=="string"&&t.key.length===1){t.preventDefault();let e=t.key;this.isOpen||this.openDropdown(),this.searchInput&&(this.searchInput.focus(),this.searchInput.value=(this.searchInput.value||"")+e,this.searchInput.dispatchEvent(new Event("input",{bubbles:!0})))}break}}handleDropdownKeydown(t){switch(t.key){case"ArrowDown":t.preventDefault(),t.stopPropagation(),this.focusNextOption();break;case"ArrowUp":t.preventDefault(),t.stopPropagation(),this.focusPreviousOption();break;case" ":if(t.preventDefault(),this.selectedIndex>=0){let e=this.getVisibleOptions()[this.selectedIndex];e&&e.click()}break;case"Enter":if(t.preventDefault(),this.selectedIndex>=0){let e=this.getVisibleOptions()[this.selectedIndex];e&&e.click()}else{let e=this.element.closest("form");e&&e.submit()}break;case"Escape":t.preventDefault(),this.closeDropdown(),this.selectButton.focus();break;case"Tab":this.closeDropdown();break;default:if(this.isSearchable&&!t.ctrlKey&&!t.metaKey&&!t.altKey&&typeof t.key=="string"&&t.key.length===1){t.preventDefault();let e=t.key;this.searchInput&&(this.searchInput.focus(),this.searchInput.value=(this.searchInput.value||"")+e,this.searchInput.dispatchEvent(new Event("input",{bubbles:!0})))}break}}toggleDropdown(){if(!this.isDisabled){if(this.isOpen){this.closeDropdown();return}this.isMultiple&&!this.isSearchable&&!this.hasAvailableOptions()||this.openDropdown()}}hasAvailableOptions(){for(let t of this.options)if(t.options&&Array.isArray(t.options)){for(let e of t.options)if(!Array.isArray(this.state)||!this.state.includes(e.value))return!0}else if(!Array.isArray(this.state)||!this.state.includes(t.value))return!0;return!1}async openDropdown(){this.dropdown.style.display="block",this.dropdown.style.opacity="0";let t=this.selectButton.closest(".fi-fixed-positioning-context")!==null&&this.selectButton.closest(".fi-absolute-positioning-context")===null;if(this.dropdown.style.position=t?"fixed":"absolute",this.dropdown.style.width=`${this.selectButton.offsetWidth}px`,this.selectButton.setAttribute("aria-expanded","true"),this.isOpen=!0,this.positionDropdown(),this.resizeListener||(this.resizeListener=()=>{this.dropdown.style.width=`${this.selectButton.offsetWidth}px`,this.positionDropdown()},window.addEventListener("resize",this.resizeListener)),this.scrollListener||(this.scrollListener=()=>this.positionDropdown(),window.addEventListener("scroll",this.scrollListener,!0)),this.dropdown.style.opacity="1",this.isSearchable&&this.searchInput&&(this.searchInput.value="",this.searchQuery="",this.hasDynamicOptions||(this.options=JSON.parse(JSON.stringify(this.originalOptions)),this.renderOptions())),this.hasDynamicOptions&&this.getOptionsUsing){this.showLoadingState(!1);try{let e=await this.getOptionsUsing(),i=Array.isArray(e)?e:e&&Array.isArray(e.options)?e.options:[];if(this.options=i,this.originalOptions=JSON.parse(JSON.stringify(i)),this.populateLabelRepositoryFromOptions(i),this.isSearchable&&this.searchInput&&(this.searchInput.value&&this.searchInput.value.trim()!==""||this.searchQuery&&this.searchQuery.trim()!=="")){let o=(this.searchInput.value||this.searchQuery||"").trim().toLowerCase();this.hideLoadingState(),this.filterOptions(o)}else this.renderOptions()}catch(e){console.error("Error fetching options:",e),this.hideLoadingState()}}else(!this.hasInitialNoOptionsMessage||this.searchQuery)&&this.hideLoadingState();if(this.isSearchable&&this.searchInput)this.searchInput.focus();else{this.selectedIndex=-1;let e=this.getVisibleOptions();if(this.isMultiple){if(Array.isArray(this.state)&&this.state.length>0){for(let i=0;i0&&(this.selectedIndex=0),this.selectedIndex>=0&&(e[this.selectedIndex].classList.add("fi-selected"),e[this.selectedIndex].focus())}}positionDropdown(){let t=this.position==="top"?"top-start":"bottom-start",e=[wi(4),Si({padding:5})];this.position!=="top"&&this.position!=="bottom"&&e.push(xi());let i=this.selectButton.closest(".fi-fixed-positioning-context")!==null&&this.selectButton.closest(".fi-absolute-positioning-context")===null;Oi(this.selectButton,this.dropdown,{placement:t,middleware:e,strategy:i?"fixed":"absolute"}).then(({x:o,y:s})=>{Object.assign(this.dropdown.style,{left:`${o}px`,top:`${s}px`})})}deferPositionDropdown(){this.isOpen&&(this.positioningRequestAnimationFrame&&(cancelAnimationFrame(this.positioningRequestAnimationFrame),this.positioningRequestAnimationFrame=null),this.positioningRequestAnimationFrame=requestAnimationFrame(()=>{this.positionDropdown(),this.positioningRequestAnimationFrame=null}))}closeDropdown(){this.dropdown.style.display="none",this.selectButton.setAttribute("aria-expanded","false"),this.isOpen=!1,this.searchTimeout&&(clearTimeout(this.searchTimeout),this.searchTimeout=null),this.activeSearchId++,this.isSearching=!1,this.hideLoadingState(),this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null),this.scrollListener&&(window.removeEventListener("scroll",this.scrollListener,!0),this.scrollListener=null),this.getVisibleOptions().forEach(e=>{e.classList.remove("fi-selected")}),this.dropdown.removeAttribute("aria-activedescendant")}focusNextOption(){let t=this.getVisibleOptions();if(t.length!==0){if(this.selectedIndex>=0&&this.selectedIndex=0&&this.selectedIndexe.bottom?this.dropdown.scrollTop+=i.bottom-e.bottom:i.top li[role="option"]')):t=Array.from(this.optionsList.querySelectorAll(':scope > ul.fi-dropdown-list > li[role="option"]'));let e=Array.from(this.optionsList.querySelectorAll('li.fi-select-input-option-group > ul > li[role="option"]'));return[...t,...e]}getSelectedOptionLabels(){if(!Array.isArray(this.state)||this.state.length===0)return{};let t={};for(let e of this.state){let i=!1;for(let o of this.options)if(o.options&&Array.isArray(o.options)){for(let s of o.options)if(s.value===e){t[e]=s.label,i=!0;break}if(i)break}else if(o.value===e){t[e]=o.label,i=!0;break}}return t}handleSearch(t){let e=t.target.value.trim();if(this.searchQuery=e,this.searchTimeout&&clearTimeout(this.searchTimeout),e===""){this.options=JSON.parse(JSON.stringify(this.originalOptions)),this.renderOptions();return}if(!this.getSearchResultsUsing||typeof this.getSearchResultsUsing!="function"||!this.hasDynamicSearchResults){this.filterOptions(e);return}this.searchTimeout=setTimeout(async()=>{this.searchTimeout=null;let i=++this.activeSearchId;this.isSearching=!0;try{this.showLoadingState(!0);let o=await this.getSearchResultsUsing(e);if(i!==this.activeSearchId||!this.isOpen)return;let s=Array.isArray(o)?o:o&&Array.isArray(o.options)?o.options:[];this.options=s,this.populateLabelRepositoryFromOptions(s),this.hideLoadingState(),this.renderOptions(),this.isOpen&&this.deferPositionDropdown(),this.options.length===0&&this.showNoResultsMessage()}catch(o){i===this.activeSearchId&&(console.error("Error fetching search results:",o),this.hideLoadingState(),this.options=JSON.parse(JSON.stringify(this.originalOptions)),this.renderOptions())}finally{i===this.activeSearchId&&(this.isSearching=!1)}},this.searchDebounce)}showLoadingState(t=!1){this.optionsList.parentNode===this.dropdown&&this.dropdown.removeChild(this.optionsList),this.hideLoadingState();let e=document.createElement("div");e.className="fi-select-input-message",e.textContent=t?this.searchingMessage:this.loadingMessage,this.dropdown.appendChild(e),this.isOpen&&this.deferPositionDropdown()}hideLoadingState(){let t=this.dropdown.querySelector(".fi-select-input-message");t&&t.remove()}showNoOptionsMessage(){this.optionsList.parentNode===this.dropdown&&this.dropdown.removeChild(this.optionsList),this.hideLoadingState();let t=document.createElement("div");t.className="fi-select-input-message",t.textContent=this.noOptionsMessage,this.dropdown.appendChild(t),this.isOpen&&this.deferPositionDropdown()}showNoResultsMessage(){this.optionsList.parentNode===this.dropdown&&this.dropdown.removeChild(this.optionsList),this.hideLoadingState();let t=document.createElement("div");t.className="fi-select-input-message",t.textContent=this.noSearchResultsMessage,this.dropdown.appendChild(t),this.isOpen&&this.deferPositionDropdown()}filterOptions(t){let e=this.searchableOptionFields.includes("label"),i=this.searchableOptionFields.includes("value");t=t.toLowerCase();let o=[];for(let s of this.originalOptions)if(s.options&&Array.isArray(s.options)){let r=s.options.filter(a=>e&&a.label.toLowerCase().includes(t)||i&&String(a.value).toLowerCase().includes(t));r.length>0&&o.push({label:s.label,options:r})}else(e&&s.label.toLowerCase().includes(t)||i&&String(s.value).toLowerCase().includes(t))&&o.push(s);this.options=o,this.renderOptions(),this.options.length===0&&this.showNoResultsMessage(),this.isOpen&&this.positionDropdown()}selectOption(t){if(this.isDisabled)return;if(!this.isMultiple){this.state=t,this.updateSelectedDisplay(),this.renderOptions(),this.closeDropdown(),this.selectButton.focus(),this.onStateChange(this.state);return}let e=Array.isArray(this.state)?[...this.state]:[];if(e.includes(t)){let o=this.selectedDisplay.querySelector(`[data-value="${t}"]`);if(P(o)){let s=o.parentElement;P(s)&&s.children.length===1?(e=e.filter(r=>r!==t),this.state=e,this.updateSelectedDisplay()):(o.remove(),e=e.filter(r=>r!==t),this.state=e)}else e=e.filter(s=>s!==t),this.state=e,this.updateSelectedDisplay();this.renderOptions(),this.isOpen&&this.deferPositionDropdown(),this.maintainFocusInMultipleMode(),this.onStateChange(this.state);return}if(this.maxItems&&e.length>=this.maxItems){this.maxItemsMessage&&alert(this.maxItemsMessage);return}e.push(t),this.state=e;let i=this.selectedDisplay.querySelector(".fi-select-input-value-badges-ctn");bt(i)?this.updateSelectedDisplay():this.addSingleBadge(t,i),this.renderOptions(),this.isOpen&&this.deferPositionDropdown(),this.maintainFocusInMultipleMode(),this.onStateChange(this.state)}async addSingleBadge(t,e){let i=this.labelRepository[t];if(bt(i)&&(i=this.getSelectedOptionLabel(t),P(i)&&(this.labelRepository[t]=i)),bt(i)&&this.getOptionLabelsUsing)try{let s=await this.getOptionLabelsUsing();for(let r of s)if(P(r)&&r.value===t&&r.label!==void 0){i=r.label,this.labelRepository[t]=i;break}}catch(s){console.error("Error fetching option label:",s)}bt(i)&&(i=t);let o=this.createBadgeElement(t,i);e.appendChild(o)}maintainFocusInMultipleMode(){if(this.isSearchable&&this.searchInput){this.searchInput.focus();return}let t=this.getVisibleOptions();if(t.length!==0){if(this.selectedIndex=-1,Array.isArray(this.state)&&this.state.length>0){for(let e=0;e{e.setAttribute("disabled","disabled"),e.classList.add("fi-disabled")}),!this.isMultiple&&this.canSelectPlaceholder){let t=this.container.querySelector(".fi-select-input-value-remove-btn");t&&(t.setAttribute("disabled","disabled"),t.classList.add("fi-disabled"))}this.isSearchable&&this.searchInput&&(this.searchInput.setAttribute("disabled","disabled"),this.searchInput.classList.add("fi-disabled"))}else{if(this.selectButton.removeAttribute("disabled"),this.selectButton.removeAttribute("aria-disabled"),this.selectButton.classList.remove("fi-disabled"),this.isMultiple&&this.container.querySelectorAll(".fi-select-input-badge-remove").forEach(e=>{e.removeAttribute("disabled"),e.classList.remove("fi-disabled")}),!this.isMultiple&&this.canSelectPlaceholder){let t=this.container.querySelector(".fi-select-input-value-remove-btn");t&&(t.removeAttribute("disabled"),t.classList.add("fi-disabled"))}this.isSearchable&&this.searchInput&&(this.searchInput.removeAttribute("disabled"),this.searchInput.classList.remove("fi-disabled"))}}destroy(){this.selectButton&&this.buttonClickListener&&this.selectButton.removeEventListener("click",this.buttonClickListener),this.documentClickListener&&document.removeEventListener("click",this.documentClickListener),this.selectButton&&this.buttonKeydownListener&&this.selectButton.removeEventListener("keydown",this.buttonKeydownListener),this.dropdown&&this.dropdownKeydownListener&&this.dropdown.removeEventListener("keydown",this.dropdownKeydownListener),this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null),this.scrollListener&&(window.removeEventListener("scroll",this.scrollListener,!0),this.scrollListener=null),this.refreshOptionLabelListener&&window.removeEventListener("filament-forms::select.refreshSelectedOptionLabel",this.refreshOptionLabelListener),this.isOpen&&this.closeDropdown(),this.searchTimeout&&(clearTimeout(this.searchTimeout),this.searchTimeout=null),this.container&&this.container.remove()}};function Qn({canOptionLabelsWrap:n,canSelectPlaceholder:t,getOptionLabelUsing:e,getOptionLabelsUsing:i,getOptionsUsing:o,getSearchResultsUsing:s,hasDynamicOptions:r,hasDynamicSearchResults:a,hasInitialNoOptionsMessage:l,initialOptionLabel:c,initialOptionLabels:f,initialState:d,isAutofocused:p,isDisabled:u,isHtmlAllowed:g,isMultiple:m,isReorderable:S,isSearchable:E,livewireId:w,loadingMessage:D,maxItems:A,maxItemsMessage:C,noOptionsMessage:F,noSearchResultsMessage:q,options:J,optionsLimit:_,placeholder:V,position:W,searchDebounce:tt,searchingMessage:z,searchPrompt:k,searchableOptionFields:Y,state:B,statePath:X}){return{select:null,state:B,init(){this.select=new Ee({canOptionLabelsWrap:n,canSelectPlaceholder:t,element:this.$refs.select,getOptionLabelUsing:e,getOptionLabelsUsing:i,getOptionsUsing:o,getSearchResultsUsing:s,hasDynamicOptions:r,hasDynamicSearchResults:a,hasInitialNoOptionsMessage:l,initialOptionLabel:c,initialOptionLabels:f,initialState:d,isAutofocused:p,isDisabled:u,isHtmlAllowed:g,isMultiple:m,isReorderable:S,isSearchable:E,livewireId:w,loadingMessage:D,maxItems:A,maxItemsMessage:C,noOptionsMessage:F,noSearchResultsMessage:q,onStateChange:L=>{this.state=L},options:J,optionsLimit:_,placeholder:V,position:W,searchableOptionFields:Y,searchDebounce:tt,searchingMessage:z,searchPrompt:k,state:this.state,statePath:X}),this.$watch("state",L=>{this.$nextTick(()=>{this.select&&this.select.state!==L&&(this.select.state=L,this.select.updateSelectedDisplay(),this.select.renderOptions())})})},destroy(){this.select&&(this.select.destroy(),this.select=null)}}}export{Qn as default}; +var Ft = Math.min, + vt = Math.max, + Ht = Math.round; +var st = (n) => ({ x: n, y: n }), + ji = { left: "right", right: "left", bottom: "top", top: "bottom" }, + qi = { start: "end", end: "start" }; +function De(n, t, e) { + return vt(n, Ft(t, e)); +} +function Vt(n, t) { + return typeof n == "function" ? n(t) : n; +} +function yt(n) { + return n.split("-")[0]; +} +function Wt(n) { + return n.split("-")[1]; +} +function Ae(n) { + return n === "x" ? "y" : "x"; +} +function Ce(n) { + return n === "y" ? "height" : "width"; +} +var Ji = new Set(["top", "bottom"]); +function ht(n) { + return Ji.has(yt(n)) ? "y" : "x"; +} +function Le(n) { + return Ae(ht(n)); +} +function Je(n, t, e) { + e === void 0 && (e = !1); + let i = Wt(n), + o = Le(n), + s = Ce(o), + r = + o === "x" + ? i === (e ? "end" : "start") + ? "right" + : "left" + : i === "start" + ? "bottom" + : "top"; + return (t.reference[s] > t.floating[s] && (r = Bt(r)), [r, Bt(r)]); +} +function Qe(n) { + let t = Bt(n); + return [ie(n), t, ie(t)]; +} +function ie(n) { + return n.replace(/start|end/g, (t) => qi[t]); +} +var je = ["left", "right"], + qe = ["right", "left"], + Qi = ["top", "bottom"], + Zi = ["bottom", "top"]; +function tn(n, t, e) { + switch (n) { + case "top": + case "bottom": + return e ? (t ? qe : je) : t ? je : qe; + case "left": + case "right": + return t ? Qi : Zi; + default: + return []; + } +} +function Ze(n, t, e, i) { + let o = Wt(n), + s = tn(yt(n), e === "start", i); + return ( + o && ((s = s.map((r) => r + "-" + o)), t && (s = s.concat(s.map(ie)))), + s + ); +} +function Bt(n) { + return n.replace(/left|right|bottom|top/g, (t) => ji[t]); +} +function en(n) { + return { top: 0, right: 0, bottom: 0, left: 0, ...n }; +} +function ti(n) { + return typeof n != "number" + ? en(n) + : { top: n, right: n, bottom: n, left: n }; +} +function Ot(n) { + let { x: t, y: e, width: i, height: o } = n; + return { + width: i, + height: o, + top: e, + left: t, + right: t + i, + bottom: e + o, + x: t, + y: e, + }; +} +function ei(n, t, e) { + let { reference: i, floating: o } = n, + s = ht(t), + r = Le(t), + a = Ce(r), + l = yt(t), + c = s === "y", + f = i.x + i.width / 2 - o.width / 2, + d = i.y + i.height / 2 - o.height / 2, + p = i[a] / 2 - o[a] / 2, + u; + switch (l) { + case "top": + u = { x: f, y: i.y - o.height }; + break; + case "bottom": + u = { x: f, y: i.y + i.height }; + break; + case "right": + u = { x: i.x + i.width, y: d }; + break; + case "left": + u = { x: i.x - o.width, y: d }; + break; + default: + u = { x: i.x, y: i.y }; + } + switch (Wt(t)) { + case "start": + u[r] -= p * (e && c ? -1 : 1); + break; + case "end": + u[r] += p * (e && c ? -1 : 1); + break; + } + return u; +} +var ii = async (n, t, e) => { + let { + placement: i = "bottom", + strategy: o = "absolute", + middleware: s = [], + platform: r, + } = e, + a = s.filter(Boolean), + l = await (r.isRTL == null ? void 0 : r.isRTL(t)), + c = await r.getElementRects({ reference: n, floating: t, strategy: o }), + { x: f, y: d } = ei(c, i, l), + p = i, + u = {}, + g = 0; + for (let m = 0; m < a.length; m++) { + let { name: S, fn: E } = a[m], + { + x: w, + y: D, + data: A, + reset: C, + } = await E({ + x: f, + y: d, + initialPlacement: i, + placement: p, + strategy: o, + middlewareData: u, + rects: c, + platform: r, + elements: { reference: n, floating: t }, + }); + ((f = w ?? f), + (d = D ?? d), + (u = { ...u, [S]: { ...u[S], ...A } }), + C && + g <= 50 && + (g++, + typeof C == "object" && + (C.placement && (p = C.placement), + C.rects && + (c = + C.rects === !0 + ? await r.getElementRects({ + reference: n, + floating: t, + strategy: o, + }) + : C.rects), + ({ x: f, y: d } = ei(c, p, l))), + (m = -1))); + } + return { x: f, y: d, placement: p, strategy: o, middlewareData: u }; +}; +async function Ie(n, t) { + var e; + t === void 0 && (t = {}); + let { x: i, y: o, platform: s, rects: r, elements: a, strategy: l } = n, + { + boundary: c = "clippingAncestors", + rootBoundary: f = "viewport", + elementContext: d = "floating", + altBoundary: p = !1, + padding: u = 0, + } = Vt(t, n), + g = ti(u), + S = a[p ? (d === "floating" ? "reference" : "floating") : d], + E = Ot( + await s.getClippingRect({ + element: + (e = await (s.isElement == null + ? void 0 + : s.isElement(S))) == null || e + ? S + : S.contextElement || + (await (s.getDocumentElement == null + ? void 0 + : s.getDocumentElement(a.floating))), + boundary: c, + rootBoundary: f, + strategy: l, + }), + ), + w = + d === "floating" + ? { + x: i, + y: o, + width: r.floating.width, + height: r.floating.height, + } + : r.reference, + D = await (s.getOffsetParent == null + ? void 0 + : s.getOffsetParent(a.floating)), + A = (await (s.isElement == null ? void 0 : s.isElement(D))) + ? (await (s.getScale == null ? void 0 : s.getScale(D))) || { + x: 1, + y: 1, + } + : { x: 1, y: 1 }, + C = Ot( + s.convertOffsetParentRelativeRectToViewportRelativeRect + ? await s.convertOffsetParentRelativeRectToViewportRelativeRect( + { elements: a, rect: w, offsetParent: D, strategy: l }, + ) + : w, + ); + return { + top: (E.top - C.top + g.top) / A.y, + bottom: (C.bottom - E.bottom + g.bottom) / A.y, + left: (E.left - C.left + g.left) / A.x, + right: (C.right - E.right + g.right) / A.x, + }; +} +var ni = function (n) { + return ( + n === void 0 && (n = {}), + { + name: "flip", + options: n, + async fn(t) { + var e, i; + let { + placement: o, + middlewareData: s, + rects: r, + initialPlacement: a, + platform: l, + elements: c, + } = t, + { + mainAxis: f = !0, + crossAxis: d = !0, + fallbackPlacements: p, + fallbackStrategy: u = "bestFit", + fallbackAxisSideDirection: g = "none", + flipAlignment: m = !0, + ...S + } = Vt(n, t); + if ((e = s.arrow) != null && e.alignmentOffset) return {}; + let E = yt(o), + w = ht(a), + D = yt(a) === a, + A = await (l.isRTL == null ? void 0 : l.isRTL(c.floating)), + C = p || (D || !m ? [Bt(a)] : Qe(a)), + F = g !== "none"; + !p && F && C.push(...Ze(a, m, g, A)); + let q = [a, ...C], + J = await Ie(t, S), + _ = [], + V = ((i = s.flip) == null ? void 0 : i.overflows) || []; + if ((f && _.push(J[E]), d)) { + let k = Je(o, r, A); + _.push(J[k[0]], J[k[1]]); + } + if ( + ((V = [...V, { placement: o, overflows: _ }]), + !_.every((k) => k <= 0)) + ) { + var W, tt; + let k = + (((W = s.flip) == null ? void 0 : W.index) || 0) + + 1, + Y = q[k]; + if ( + Y && + (!(d === "alignment" ? w !== ht(Y) : !1) || + V.every((L) => + ht(L.placement) === w ? L.overflows[0] > 0 : !0, + )) + ) + return { + data: { index: k, overflows: V }, + reset: { placement: Y }, + }; + let B = + (tt = V.filter((X) => X.overflows[0] <= 0).sort( + (X, L) => X.overflows[1] - L.overflows[1], + )[0]) == null + ? void 0 + : tt.placement; + if (!B) + switch (u) { + case "bestFit": { + var z; + let X = + (z = V.filter((L) => { + if (F) { + let et = ht(L.placement); + return et === w || et === "y"; + } + return !0; + }) + .map((L) => [ + L.placement, + L.overflows + .filter((et) => et > 0) + .reduce((et, ee) => et + ee, 0), + ]) + .sort((L, et) => L[1] - et[1])[0]) == + null + ? void 0 + : z[0]; + X && (B = X); + break; + } + case "initialPlacement": + B = a; + break; + } + if (o !== B) return { reset: { placement: B } }; + } + return {}; + }, + } + ); +}; +var nn = new Set(["left", "top"]); +async function on(n, t) { + let { placement: e, platform: i, elements: o } = n, + s = await (i.isRTL == null ? void 0 : i.isRTL(o.floating)), + r = yt(e), + a = Wt(e), + l = ht(e) === "y", + c = nn.has(r) ? -1 : 1, + f = s && l ? -1 : 1, + d = Vt(t, n), + { + mainAxis: p, + crossAxis: u, + alignmentAxis: g, + } = typeof d == "number" + ? { mainAxis: d, crossAxis: 0, alignmentAxis: null } + : { + mainAxis: d.mainAxis || 0, + crossAxis: d.crossAxis || 0, + alignmentAxis: d.alignmentAxis, + }; + return ( + a && typeof g == "number" && (u = a === "end" ? g * -1 : g), + l ? { x: u * f, y: p * c } : { x: p * c, y: u * f } + ); +} +var oi = function (n) { + return ( + n === void 0 && (n = 0), + { + name: "offset", + options: n, + async fn(t) { + var e, i; + let { x: o, y: s, placement: r, middlewareData: a } = t, + l = await on(t, n); + return r === + ((e = a.offset) == null ? void 0 : e.placement) && + (i = a.arrow) != null && + i.alignmentOffset + ? {} + : { + x: o + l.x, + y: s + l.y, + data: { ...l, placement: r }, + }; + }, + } + ); + }, + si = function (n) { + return ( + n === void 0 && (n = {}), + { + name: "shift", + options: n, + async fn(t) { + let { x: e, y: i, placement: o } = t, + { + mainAxis: s = !0, + crossAxis: r = !1, + limiter: a = { + fn: (S) => { + let { x: E, y: w } = S; + return { x: E, y: w }; + }, + }, + ...l + } = Vt(n, t), + c = { x: e, y: i }, + f = await Ie(t, l), + d = ht(yt(o)), + p = Ae(d), + u = c[p], + g = c[d]; + if (s) { + let S = p === "y" ? "top" : "left", + E = p === "y" ? "bottom" : "right", + w = u + f[S], + D = u - f[E]; + u = De(w, u, D); + } + if (r) { + let S = d === "y" ? "top" : "left", + E = d === "y" ? "bottom" : "right", + w = g + f[S], + D = g - f[E]; + g = De(w, g, D); + } + let m = a.fn({ ...t, [p]: u, [d]: g }); + return { + ...m, + data: { + x: m.x - e, + y: m.y - i, + enabled: { [p]: s, [d]: r }, + }, + }; + }, + } + ); + }; +function oe() { + return typeof window < "u"; +} +function Et(n) { + return ai(n) ? (n.nodeName || "").toLowerCase() : "#document"; +} +function U(n) { + var t; + return ( + (n == null || (t = n.ownerDocument) == null ? void 0 : t.defaultView) || + window + ); +} +function ct(n) { + var t; + return (t = (ai(n) ? n.ownerDocument : n.document) || window.document) == + null + ? void 0 + : t.documentElement; +} +function ai(n) { + return oe() ? n instanceof Node || n instanceof U(n).Node : !1; +} +function it(n) { + return oe() ? n instanceof Element || n instanceof U(n).Element : !1; +} +function rt(n) { + return oe() + ? n instanceof HTMLElement || n instanceof U(n).HTMLElement + : !1; +} +function ri(n) { + return !oe() || typeof ShadowRoot > "u" + ? !1 + : n instanceof ShadowRoot || n instanceof U(n).ShadowRoot; +} +var sn = new Set(["inline", "contents"]); +function It(n) { + let { overflow: t, overflowX: e, overflowY: i, display: o } = nt(n); + return /auto|scroll|overlay|hidden|clip/.test(t + i + e) && !sn.has(o); +} +var rn = new Set(["table", "td", "th"]); +function li(n) { + return rn.has(Et(n)); +} +var an = [":popover-open", ":modal"]; +function zt(n) { + return an.some((t) => { + try { + return n.matches(t); + } catch { + return !1; + } + }); +} +var ln = ["transform", "translate", "scale", "rotate", "perspective"], + cn = ["transform", "translate", "scale", "rotate", "perspective", "filter"], + dn = ["paint", "layout", "strict", "content"]; +function se(n) { + let t = re(), + e = it(n) ? nt(n) : n; + return ( + ln.some((i) => (e[i] ? e[i] !== "none" : !1)) || + (e.containerType ? e.containerType !== "normal" : !1) || + (!t && (e.backdropFilter ? e.backdropFilter !== "none" : !1)) || + (!t && (e.filter ? e.filter !== "none" : !1)) || + cn.some((i) => (e.willChange || "").includes(i)) || + dn.some((i) => (e.contain || "").includes(i)) + ); +} +function ci(n) { + let t = ut(n); + for (; rt(t) && !Dt(t); ) { + if (se(t)) return t; + if (zt(t)) return null; + t = ut(t); + } + return null; +} +function re() { + return typeof CSS > "u" || !CSS.supports + ? !1 + : CSS.supports("-webkit-backdrop-filter", "none"); +} +var fn = new Set(["html", "body", "#document"]); +function Dt(n) { + return fn.has(Et(n)); +} +function nt(n) { + return U(n).getComputedStyle(n); +} +function Xt(n) { + return it(n) + ? { scrollLeft: n.scrollLeft, scrollTop: n.scrollTop } + : { scrollLeft: n.scrollX, scrollTop: n.scrollY }; +} +function ut(n) { + if (Et(n) === "html") return n; + let t = n.assignedSlot || n.parentNode || (ri(n) && n.host) || ct(n); + return ri(t) ? t.host : t; +} +function di(n) { + let t = ut(n); + return Dt(t) + ? n.ownerDocument + ? n.ownerDocument.body + : n.body + : rt(t) && It(t) + ? t + : di(t); +} +function ne(n, t, e) { + var i; + (t === void 0 && (t = []), e === void 0 && (e = !0)); + let o = di(n), + s = o === ((i = n.ownerDocument) == null ? void 0 : i.body), + r = U(o); + if (s) { + let a = ae(r); + return t.concat( + r, + r.visualViewport || [], + It(o) ? o : [], + a && e ? ne(a) : [], + ); + } + return t.concat(o, ne(o, [], e)); +} +function ae(n) { + return n.parent && Object.getPrototypeOf(n.parent) ? n.frameElement : null; +} +function pi(n) { + let t = nt(n), + e = parseFloat(t.width) || 0, + i = parseFloat(t.height) || 0, + o = rt(n), + s = o ? n.offsetWidth : e, + r = o ? n.offsetHeight : i, + a = Ht(e) !== s || Ht(i) !== r; + return (a && ((e = s), (i = r)), { width: e, height: i, $: a }); +} +function gi(n) { + return it(n) ? n : n.contextElement; +} +function Tt(n) { + let t = gi(n); + if (!rt(t)) return st(1); + let e = t.getBoundingClientRect(), + { width: i, height: o, $: s } = pi(t), + r = (s ? Ht(e.width) : e.width) / i, + a = (s ? Ht(e.height) : e.height) / o; + return ( + (!r || !Number.isFinite(r)) && (r = 1), + (!a || !Number.isFinite(a)) && (a = 1), + { x: r, y: a } + ); +} +var hn = st(0); +function mi(n) { + let t = U(n); + return !re() || !t.visualViewport + ? hn + : { x: t.visualViewport.offsetLeft, y: t.visualViewport.offsetTop }; +} +function un(n, t, e) { + return (t === void 0 && (t = !1), !e || (t && e !== U(n)) ? !1 : t); +} +function $t(n, t, e, i) { + (t === void 0 && (t = !1), e === void 0 && (e = !1)); + let o = n.getBoundingClientRect(), + s = gi(n), + r = st(1); + t && (i ? it(i) && (r = Tt(i)) : (r = Tt(n))); + let a = un(s, e, i) ? mi(s) : st(0), + l = (o.left + a.x) / r.x, + c = (o.top + a.y) / r.y, + f = o.width / r.x, + d = o.height / r.y; + if (s) { + let p = U(s), + u = i && it(i) ? U(i) : i, + g = p, + m = ae(g); + for (; m && i && u !== g; ) { + let S = Tt(m), + E = m.getBoundingClientRect(), + w = nt(m), + D = E.left + (m.clientLeft + parseFloat(w.paddingLeft)) * S.x, + A = E.top + (m.clientTop + parseFloat(w.paddingTop)) * S.y; + ((l *= S.x), + (c *= S.y), + (f *= S.x), + (d *= S.y), + (l += D), + (c += A), + (g = U(m)), + (m = ae(g))); + } + } + return Ot({ width: f, height: d, x: l, y: c }); +} +function le(n, t) { + let e = Xt(n).scrollLeft; + return t ? t.left + e : $t(ct(n)).left + e; +} +function bi(n, t) { + let e = n.getBoundingClientRect(), + i = e.left + t.scrollLeft - le(n, e), + o = e.top + t.scrollTop; + return { x: i, y: o }; +} +function pn(n) { + let { elements: t, rect: e, offsetParent: i, strategy: o } = n, + s = o === "fixed", + r = ct(i), + a = t ? zt(t.floating) : !1; + if (i === r || (a && s)) return e; + let l = { scrollLeft: 0, scrollTop: 0 }, + c = st(1), + f = st(0), + d = rt(i); + if ( + (d || (!d && !s)) && + ((Et(i) !== "body" || It(r)) && (l = Xt(i)), rt(i)) + ) { + let u = $t(i); + ((c = Tt(i)), (f.x = u.x + i.clientLeft), (f.y = u.y + i.clientTop)); + } + let p = r && !d && !s ? bi(r, l) : st(0); + return { + width: e.width * c.x, + height: e.height * c.y, + x: e.x * c.x - l.scrollLeft * c.x + f.x + p.x, + y: e.y * c.y - l.scrollTop * c.y + f.y + p.y, + }; +} +function gn(n) { + return Array.from(n.getClientRects()); +} +function mn(n) { + let t = ct(n), + e = Xt(n), + i = n.ownerDocument.body, + o = vt(t.scrollWidth, t.clientWidth, i.scrollWidth, i.clientWidth), + s = vt(t.scrollHeight, t.clientHeight, i.scrollHeight, i.clientHeight), + r = -e.scrollLeft + le(n), + a = -e.scrollTop; + return ( + nt(i).direction === "rtl" && + (r += vt(t.clientWidth, i.clientWidth) - o), + { width: o, height: s, x: r, y: a } + ); +} +var fi = 25; +function bn(n, t) { + let e = U(n), + i = ct(n), + o = e.visualViewport, + s = i.clientWidth, + r = i.clientHeight, + a = 0, + l = 0; + if (o) { + ((s = o.width), (r = o.height)); + let f = re(); + (!f || (f && t === "fixed")) && ((a = o.offsetLeft), (l = o.offsetTop)); + } + let c = le(i); + if (c <= 0) { + let f = i.ownerDocument, + d = f.body, + p = getComputedStyle(d), + u = + (f.compatMode === "CSS1Compat" && + parseFloat(p.marginLeft) + parseFloat(p.marginRight)) || + 0, + g = Math.abs(i.clientWidth - d.clientWidth - u); + g <= fi && (s -= g); + } else c <= fi && (s += c); + return { width: s, height: r, x: a, y: l }; +} +var vn = new Set(["absolute", "fixed"]); +function yn(n, t) { + let e = $t(n, !0, t === "fixed"), + i = e.top + n.clientTop, + o = e.left + n.clientLeft, + s = rt(n) ? Tt(n) : st(1), + r = n.clientWidth * s.x, + a = n.clientHeight * s.y, + l = o * s.x, + c = i * s.y; + return { width: r, height: a, x: l, y: c }; +} +function hi(n, t, e) { + let i; + if (t === "viewport") i = bn(n, e); + else if (t === "document") i = mn(ct(n)); + else if (it(t)) i = yn(t, e); + else { + let o = mi(n); + i = { x: t.x - o.x, y: t.y - o.y, width: t.width, height: t.height }; + } + return Ot(i); +} +function vi(n, t) { + let e = ut(n); + return e === t || !it(e) || Dt(e) + ? !1 + : nt(e).position === "fixed" || vi(e, t); +} +function wn(n, t) { + let e = t.get(n); + if (e) return e; + let i = ne(n, [], !1).filter((a) => it(a) && Et(a) !== "body"), + o = null, + s = nt(n).position === "fixed", + r = s ? ut(n) : n; + for (; it(r) && !Dt(r); ) { + let a = nt(r), + l = se(r); + (!l && a.position === "fixed" && (o = null), + ( + s + ? !l && !o + : (!l && + a.position === "static" && + !!o && + vn.has(o.position)) || + (It(r) && !l && vi(n, r)) + ) + ? (i = i.filter((f) => f !== r)) + : (o = a), + (r = ut(r))); + } + return (t.set(n, i), i); +} +function Sn(n) { + let { element: t, boundary: e, rootBoundary: i, strategy: o } = n, + r = [ + ...(e === "clippingAncestors" + ? zt(t) + ? [] + : wn(t, this._c) + : [].concat(e)), + i, + ], + a = r[0], + l = r.reduce( + (c, f) => { + let d = hi(t, f, o); + return ( + (c.top = vt(d.top, c.top)), + (c.right = Ft(d.right, c.right)), + (c.bottom = Ft(d.bottom, c.bottom)), + (c.left = vt(d.left, c.left)), + c + ); + }, + hi(t, a, o), + ); + return { + width: l.right - l.left, + height: l.bottom - l.top, + x: l.left, + y: l.top, + }; +} +function xn(n) { + let { width: t, height: e } = pi(n); + return { width: t, height: e }; +} +function On(n, t, e) { + let i = rt(t), + o = ct(t), + s = e === "fixed", + r = $t(n, !0, s, t), + a = { scrollLeft: 0, scrollTop: 0 }, + l = st(0); + function c() { + l.x = le(o); + } + if (i || (!i && !s)) + if (((Et(t) !== "body" || It(o)) && (a = Xt(t)), i)) { + let u = $t(t, !0, s, t); + ((l.x = u.x + t.clientLeft), (l.y = u.y + t.clientTop)); + } else o && c(); + s && !i && o && c(); + let f = o && !i && !s ? bi(o, a) : st(0), + d = r.left + a.scrollLeft - l.x - f.x, + p = r.top + a.scrollTop - l.y - f.y; + return { x: d, y: p, width: r.width, height: r.height }; +} +function Te(n) { + return nt(n).position === "static"; +} +function ui(n, t) { + if (!rt(n) || nt(n).position === "fixed") return null; + if (t) return t(n); + let e = n.offsetParent; + return (ct(n) === e && (e = e.ownerDocument.body), e); +} +function yi(n, t) { + let e = U(n); + if (zt(n)) return e; + if (!rt(n)) { + let o = ut(n); + for (; o && !Dt(o); ) { + if (it(o) && !Te(o)) return o; + o = ut(o); + } + return e; + } + let i = ui(n, t); + for (; i && li(i) && Te(i); ) i = ui(i, t); + return i && Dt(i) && Te(i) && !se(i) ? e : i || ci(n) || e; +} +var En = async function (n) { + let t = this.getOffsetParent || yi, + e = this.getDimensions, + i = await e(n.floating); + return { + reference: On(n.reference, await t(n.floating), n.strategy), + floating: { x: 0, y: 0, width: i.width, height: i.height }, + }; +}; +function Dn(n) { + return nt(n).direction === "rtl"; +} +var An = { + convertOffsetParentRelativeRectToViewportRelativeRect: pn, + getDocumentElement: ct, + getClippingRect: Sn, + getOffsetParent: yi, + getElementRects: En, + getClientRects: gn, + getDimensions: xn, + getScale: Tt, + isElement: it, + isRTL: Dn, +}; +var wi = oi; +var Si = si, + xi = ni; +var Oi = (n, t, e) => { + let i = new Map(), + o = { platform: An, ...e }, + s = { ...o.platform, _c: i }; + return ii(n, t, { ...o, platform: s }); +}; +function Ei(n, t) { + var e = Object.keys(n); + if (Object.getOwnPropertySymbols) { + var i = Object.getOwnPropertySymbols(n); + (t && + (i = i.filter(function (o) { + return Object.getOwnPropertyDescriptor(n, o).enumerable; + })), + e.push.apply(e, i)); + } + return e; +} +function ft(n) { + for (var t = 1; t < arguments.length; t++) { + var e = arguments[t] != null ? arguments[t] : {}; + t % 2 + ? Ei(Object(e), !0).forEach(function (i) { + Cn(n, i, e[i]); + }) + : Object.getOwnPropertyDescriptors + ? Object.defineProperties(n, Object.getOwnPropertyDescriptors(e)) + : Ei(Object(e)).forEach(function (i) { + Object.defineProperty( + n, + i, + Object.getOwnPropertyDescriptor(e, i), + ); + }); + } + return n; +} +function ue(n) { + "@babel/helpers - typeof"; + return ( + typeof Symbol == "function" && typeof Symbol.iterator == "symbol" + ? (ue = function (t) { + return typeof t; + }) + : (ue = function (t) { + return t && + typeof Symbol == "function" && + t.constructor === Symbol && + t !== Symbol.prototype + ? "symbol" + : typeof t; + }), + ue(n) + ); +} +function Cn(n, t, e) { + return ( + t in n + ? Object.defineProperty(n, t, { + value: e, + enumerable: !0, + configurable: !0, + writable: !0, + }) + : (n[t] = e), + n + ); +} +function gt() { + return ( + (gt = + Object.assign || + function (n) { + for (var t = 1; t < arguments.length; t++) { + var e = arguments[t]; + for (var i in e) + Object.prototype.hasOwnProperty.call(e, i) && + (n[i] = e[i]); + } + return n; + }), + gt.apply(this, arguments) + ); +} +function Ln(n, t) { + if (n == null) return {}; + var e = {}, + i = Object.keys(n), + o, + s; + for (s = 0; s < i.length; s++) + ((o = i[s]), !(t.indexOf(o) >= 0) && (e[o] = n[o])); + return e; +} +function In(n, t) { + if (n == null) return {}; + var e = Ln(n, t), + i, + o; + if (Object.getOwnPropertySymbols) { + var s = Object.getOwnPropertySymbols(n); + for (o = 0; o < s.length; o++) + ((i = s[o]), + !(t.indexOf(i) >= 0) && + Object.prototype.propertyIsEnumerable.call(n, i) && + (e[i] = n[i])); + } + return e; +} +var Tn = "1.15.6"; +function pt(n) { + if (typeof window < "u" && window.navigator) + return !!navigator.userAgent.match(n); +} +var mt = pt(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i), + Zt = pt(/Edge/i), + Di = pt(/firefox/i), + Gt = pt(/safari/i) && !pt(/chrome/i) && !pt(/android/i), + $e = pt(/iP(ad|od|hone)/i), + Pi = pt(/chrome/i) && pt(/android/i), + Mi = { capture: !1, passive: !1 }; +function O(n, t, e) { + n.addEventListener(t, e, !mt && Mi); +} +function x(n, t, e) { + n.removeEventListener(t, e, !mt && Mi); +} +function ve(n, t) { + if (t) { + if ((t[0] === ">" && (t = t.substring(1)), n)) + try { + if (n.matches) return n.matches(t); + if (n.msMatchesSelector) return n.msMatchesSelector(t); + if (n.webkitMatchesSelector) return n.webkitMatchesSelector(t); + } catch { + return !1; + } + return !1; + } +} +function Ni(n) { + return n.host && n !== document && n.host.nodeType ? n.host : n.parentNode; +} +function lt(n, t, e, i) { + if (n) { + e = e || document; + do { + if ( + (t != null && + (t[0] === ">" + ? n.parentNode === e && ve(n, t) + : ve(n, t))) || + (i && n === e) + ) + return n; + if (n === e) break; + } while ((n = Ni(n))); + } + return null; +} +var Ai = /\s+/g; +function Q(n, t, e) { + if (n && t) + if (n.classList) n.classList[e ? "add" : "remove"](t); + else { + var i = (" " + n.className + " ") + .replace(Ai, " ") + .replace(" " + t + " ", " "); + n.className = (i + (e ? " " + t : "")).replace(Ai, " "); + } +} +function b(n, t, e) { + var i = n && n.style; + if (i) { + if (e === void 0) + return ( + document.defaultView && document.defaultView.getComputedStyle + ? (e = document.defaultView.getComputedStyle(n, "")) + : n.currentStyle && (e = n.currentStyle), + t === void 0 ? e : e[t] + ); + (!(t in i) && t.indexOf("webkit") === -1 && (t = "-webkit-" + t), + (i[t] = e + (typeof e == "string" ? "" : "px"))); + } +} +function Nt(n, t) { + var e = ""; + if (typeof n == "string") e = n; + else + do { + var i = b(n, "transform"); + i && i !== "none" && (e = i + " " + e); + } while (!t && (n = n.parentNode)); + var o = + window.DOMMatrix || + window.WebKitCSSMatrix || + window.CSSMatrix || + window.MSCSSMatrix; + return o && new o(e); +} +function ki(n, t, e) { + if (n) { + var i = n.getElementsByTagName(t), + o = 0, + s = i.length; + if (e) for (; o < s; o++) e(i[o], o); + return i; + } + return []; +} +function dt() { + var n = document.scrollingElement; + return n || document.documentElement; +} +function N(n, t, e, i, o) { + if (!(!n.getBoundingClientRect && n !== window)) { + var s, r, a, l, c, f, d; + if ( + (n !== window && n.parentNode && n !== dt() + ? ((s = n.getBoundingClientRect()), + (r = s.top), + (a = s.left), + (l = s.bottom), + (c = s.right), + (f = s.height), + (d = s.width)) + : ((r = 0), + (a = 0), + (l = window.innerHeight), + (c = window.innerWidth), + (f = window.innerHeight), + (d = window.innerWidth)), + (t || e) && n !== window && ((o = o || n.parentNode), !mt)) + ) + do + if ( + o && + o.getBoundingClientRect && + (b(o, "transform") !== "none" || + (e && b(o, "position") !== "static")) + ) { + var p = o.getBoundingClientRect(); + ((r -= p.top + parseInt(b(o, "border-top-width"))), + (a -= p.left + parseInt(b(o, "border-left-width"))), + (l = r + s.height), + (c = a + s.width)); + break; + } + while ((o = o.parentNode)); + if (i && n !== window) { + var u = Nt(o || n), + g = u && u.a, + m = u && u.d; + u && + ((r /= m), + (a /= g), + (d /= g), + (f /= m), + (l = r + f), + (c = a + d)); + } + return { top: r, left: a, bottom: l, right: c, width: d, height: f }; + } +} +function Ci(n, t, e) { + for (var i = xt(n, !0), o = N(n)[t]; i; ) { + var s = N(i)[e], + r = void 0; + if ((e === "top" || e === "left" ? (r = o >= s) : (r = o <= s), !r)) + return i; + if (i === dt()) break; + i = xt(i, !1); + } + return !1; +} +function kt(n, t, e, i) { + for (var o = 0, s = 0, r = n.children; s < r.length; ) { + if ( + r[s].style.display !== "none" && + r[s] !== v.ghost && + (i || r[s] !== v.dragged) && + lt(r[s], e.draggable, n, !1) + ) { + if (o === t) return r[s]; + o++; + } + s++; + } + return null; +} +function Ke(n, t) { + for ( + var e = n.lastElementChild; + e && (e === v.ghost || b(e, "display") === "none" || (t && !ve(e, t))); + ) + e = e.previousElementSibling; + return e || null; +} +function ot(n, t) { + var e = 0; + if (!n || !n.parentNode) return -1; + for (; (n = n.previousElementSibling); ) + n.nodeName.toUpperCase() !== "TEMPLATE" && + n !== v.clone && + (!t || ve(n, t)) && + e++; + return e; +} +function Li(n) { + var t = 0, + e = 0, + i = dt(); + if (n) + do { + var o = Nt(n), + s = o.a, + r = o.d; + ((t += n.scrollLeft * s), (e += n.scrollTop * r)); + } while (n !== i && (n = n.parentNode)); + return [t, e]; +} +function _n(n, t) { + for (var e in n) + if (n.hasOwnProperty(e)) { + for (var i in t) + if (t.hasOwnProperty(i) && t[i] === n[e][i]) return Number(e); + } + return -1; +} +function xt(n, t) { + if (!n || !n.getBoundingClientRect) return dt(); + var e = n, + i = !1; + do + if (e.clientWidth < e.scrollWidth || e.clientHeight < e.scrollHeight) { + var o = b(e); + if ( + (e.clientWidth < e.scrollWidth && + (o.overflowX == "auto" || o.overflowX == "scroll")) || + (e.clientHeight < e.scrollHeight && + (o.overflowY == "auto" || o.overflowY == "scroll")) + ) { + if (!e.getBoundingClientRect || e === document.body) + return dt(); + if (i || t) return e; + i = !0; + } + } + while ((e = e.parentNode)); + return dt(); +} +function Rn(n, t) { + if (n && t) for (var e in t) t.hasOwnProperty(e) && (n[e] = t[e]); + return n; +} +function _e(n, t) { + return ( + Math.round(n.top) === Math.round(t.top) && + Math.round(n.left) === Math.round(t.left) && + Math.round(n.height) === Math.round(t.height) && + Math.round(n.width) === Math.round(t.width) + ); +} +var jt; +function Bi(n, t) { + return function () { + if (!jt) { + var e = arguments, + i = this; + (e.length === 1 ? n.call(i, e[0]) : n.apply(i, e), + (jt = setTimeout(function () { + jt = void 0; + }, t))); + } + }; +} +function Pn() { + (clearTimeout(jt), (jt = void 0)); +} +function Fi(n, t, e) { + ((n.scrollLeft += t), (n.scrollTop += e)); +} +function Hi(n) { + var t = window.Polymer, + e = window.jQuery || window.Zepto; + return t && t.dom + ? t.dom(n).cloneNode(!0) + : e + ? e(n).clone(!0)[0] + : n.cloneNode(!0); +} +function Vi(n, t, e) { + var i = {}; + return ( + Array.from(n.children).forEach(function (o) { + var s, r, a, l; + if (!(!lt(o, t.draggable, n, !1) || o.animated || o === e)) { + var c = N(o); + ((i.left = Math.min( + (s = i.left) !== null && s !== void 0 ? s : 1 / 0, + c.left, + )), + (i.top = Math.min( + (r = i.top) !== null && r !== void 0 ? r : 1 / 0, + c.top, + )), + (i.right = Math.max( + (a = i.right) !== null && a !== void 0 ? a : -1 / 0, + c.right, + )), + (i.bottom = Math.max( + (l = i.bottom) !== null && l !== void 0 ? l : -1 / 0, + c.bottom, + ))); + } + }), + (i.width = i.right - i.left), + (i.height = i.bottom - i.top), + (i.x = i.left), + (i.y = i.top), + i + ); +} +var j = "Sortable" + new Date().getTime(); +function Mn() { + var n = [], + t; + return { + captureAnimationState: function () { + if (((n = []), !!this.options.animation)) { + var i = [].slice.call(this.el.children); + i.forEach(function (o) { + if (!(b(o, "display") === "none" || o === v.ghost)) { + n.push({ target: o, rect: N(o) }); + var s = ft({}, n[n.length - 1].rect); + if (o.thisAnimationDuration) { + var r = Nt(o, !0); + r && ((s.top -= r.f), (s.left -= r.e)); + } + o.fromRect = s; + } + }); + } + }, + addAnimationState: function (i) { + n.push(i); + }, + removeAnimationState: function (i) { + n.splice(_n(n, { target: i }), 1); + }, + animateAll: function (i) { + var o = this; + if (!this.options.animation) { + (clearTimeout(t), typeof i == "function" && i()); + return; + } + var s = !1, + r = 0; + (n.forEach(function (a) { + var l = 0, + c = a.target, + f = c.fromRect, + d = N(c), + p = c.prevFromRect, + u = c.prevToRect, + g = a.rect, + m = Nt(c, !0); + (m && ((d.top -= m.f), (d.left -= m.e)), + (c.toRect = d), + c.thisAnimationDuration && + _e(p, d) && + !_e(f, d) && + (g.top - d.top) / (g.left - d.left) === + (f.top - d.top) / (f.left - d.left) && + (l = kn(g, p, u, o.options)), + _e(d, f) || + ((c.prevFromRect = f), + (c.prevToRect = d), + l || (l = o.options.animation), + o.animate(c, g, d, l)), + l && + ((s = !0), + (r = Math.max(r, l)), + clearTimeout(c.animationResetTimer), + (c.animationResetTimer = setTimeout(function () { + ((c.animationTime = 0), + (c.prevFromRect = null), + (c.fromRect = null), + (c.prevToRect = null), + (c.thisAnimationDuration = null)); + }, l)), + (c.thisAnimationDuration = l))); + }), + clearTimeout(t), + s + ? (t = setTimeout(function () { + typeof i == "function" && i(); + }, r)) + : typeof i == "function" && i(), + (n = [])); + }, + animate: function (i, o, s, r) { + if (r) { + (b(i, "transition", ""), b(i, "transform", "")); + var a = Nt(this.el), + l = a && a.a, + c = a && a.d, + f = (o.left - s.left) / (l || 1), + d = (o.top - s.top) / (c || 1); + ((i.animatingX = !!f), + (i.animatingY = !!d), + b(i, "transform", "translate3d(" + f + "px," + d + "px,0)"), + (this.forRepaintDummy = Nn(i)), + b( + i, + "transition", + "transform " + + r + + "ms" + + (this.options.easing + ? " " + this.options.easing + : ""), + ), + b(i, "transform", "translate3d(0,0,0)"), + typeof i.animated == "number" && clearTimeout(i.animated), + (i.animated = setTimeout(function () { + (b(i, "transition", ""), + b(i, "transform", ""), + (i.animated = !1), + (i.animatingX = !1), + (i.animatingY = !1)); + }, r))); + } + }, + }; +} +function Nn(n) { + return n.offsetWidth; +} +function kn(n, t, e, i) { + return ( + (Math.sqrt(Math.pow(t.top - n.top, 2) + Math.pow(t.left - n.left, 2)) / + Math.sqrt( + Math.pow(t.top - e.top, 2) + Math.pow(t.left - e.left, 2), + )) * + i.animation + ); +} +var _t = [], + Re = { initializeByDefault: !0 }, + te = { + mount: function (t) { + for (var e in Re) + Re.hasOwnProperty(e) && !(e in t) && (t[e] = Re[e]); + (_t.forEach(function (i) { + if (i.pluginName === t.pluginName) + throw "Sortable: Cannot mount plugin ".concat( + t.pluginName, + " more than once", + ); + }), + _t.push(t)); + }, + pluginEvent: function (t, e, i) { + var o = this; + ((this.eventCanceled = !1), + (i.cancel = function () { + o.eventCanceled = !0; + })); + var s = t + "Global"; + _t.forEach(function (r) { + e[r.pluginName] && + (e[r.pluginName][s] && + e[r.pluginName][s](ft({ sortable: e }, i)), + e.options[r.pluginName] && + e[r.pluginName][t] && + e[r.pluginName][t](ft({ sortable: e }, i))); + }); + }, + initializePlugins: function (t, e, i, o) { + _t.forEach(function (a) { + var l = a.pluginName; + if (!(!t.options[l] && !a.initializeByDefault)) { + var c = new a(t, e, t.options); + ((c.sortable = t), + (c.options = t.options), + (t[l] = c), + gt(i, c.defaults)); + } + }); + for (var s in t.options) + if (t.options.hasOwnProperty(s)) { + var r = this.modifyOption(t, s, t.options[s]); + typeof r < "u" && (t.options[s] = r); + } + }, + getEventProperties: function (t, e) { + var i = {}; + return ( + _t.forEach(function (o) { + typeof o.eventProperties == "function" && + gt(i, o.eventProperties.call(e[o.pluginName], t)); + }), + i + ); + }, + modifyOption: function (t, e, i) { + var o; + return ( + _t.forEach(function (s) { + t[s.pluginName] && + s.optionListeners && + typeof s.optionListeners[e] == "function" && + (o = s.optionListeners[e].call(t[s.pluginName], i)); + }), + o + ); + }, + }; +function Bn(n) { + var t = n.sortable, + e = n.rootEl, + i = n.name, + o = n.targetEl, + s = n.cloneEl, + r = n.toEl, + a = n.fromEl, + l = n.oldIndex, + c = n.newIndex, + f = n.oldDraggableIndex, + d = n.newDraggableIndex, + p = n.originalEvent, + u = n.putSortable, + g = n.extraEventProperties; + if (((t = t || (e && e[j])), !!t)) { + var m, + S = t.options, + E = "on" + i.charAt(0).toUpperCase() + i.substr(1); + (window.CustomEvent && !mt && !Zt + ? (m = new CustomEvent(i, { bubbles: !0, cancelable: !0 })) + : ((m = document.createEvent("Event")), m.initEvent(i, !0, !0)), + (m.to = r || e), + (m.from = a || e), + (m.item = o || e), + (m.clone = s), + (m.oldIndex = l), + (m.newIndex = c), + (m.oldDraggableIndex = f), + (m.newDraggableIndex = d), + (m.originalEvent = p), + (m.pullMode = u ? u.lastPutMode : void 0)); + var w = ft(ft({}, g), te.getEventProperties(i, t)); + for (var D in w) m[D] = w[D]; + (e && e.dispatchEvent(m), S[E] && S[E].call(t, m)); + } +} +var Fn = ["evt"], + G = function (t, e) { + var i = + arguments.length > 2 && arguments[2] !== void 0 + ? arguments[2] + : {}, + o = i.evt, + s = In(i, Fn); + te.pluginEvent.bind(v)( + t, + e, + ft( + { + dragEl: h, + parentEl: R, + ghostEl: y, + rootEl: I, + nextEl: Lt, + lastDownEl: pe, + cloneEl: T, + cloneHidden: St, + dragStarted: Kt, + putSortable: H, + activeSortable: v.active, + originalEvent: o, + oldIndex: Mt, + oldDraggableIndex: qt, + newIndex: Z, + newDraggableIndex: wt, + hideGhostForTarget: $i, + unhideGhostForTarget: Ki, + cloneNowHidden: function () { + St = !0; + }, + cloneNowShown: function () { + St = !1; + }, + dispatchSortableEvent: function (a) { + K({ sortable: e, name: a, originalEvent: o }); + }, + }, + s, + ), + ); + }; +function K(n) { + Bn( + ft( + { + putSortable: H, + cloneEl: T, + targetEl: h, + rootEl: I, + oldIndex: Mt, + oldDraggableIndex: qt, + newIndex: Z, + newDraggableIndex: wt, + }, + n, + ), + ); +} +var h, + R, + y, + I, + Lt, + pe, + T, + St, + Mt, + Z, + qt, + wt, + ce, + H, + Pt = !1, + ye = !1, + we = [], + At, + at, + Pe, + Me, + Ii, + Ti, + Kt, + Rt, + Jt, + Qt = !1, + de = !1, + ge, + $, + Ne = [], + Ve = !1, + Se = [], + Oe = typeof document < "u", + fe = $e, + _i = Zt || mt ? "cssFloat" : "float", + Hn = Oe && !Pi && !$e && "draggable" in document.createElement("div"), + Wi = (function () { + if (Oe) { + if (mt) return !1; + var n = document.createElement("x"); + return ( + (n.style.cssText = "pointer-events:auto"), + n.style.pointerEvents === "auto" + ); + } + })(), + zi = function (t, e) { + var i = b(t), + o = + parseInt(i.width) - + parseInt(i.paddingLeft) - + parseInt(i.paddingRight) - + parseInt(i.borderLeftWidth) - + parseInt(i.borderRightWidth), + s = kt(t, 0, e), + r = kt(t, 1, e), + a = s && b(s), + l = r && b(r), + c = + a && + parseInt(a.marginLeft) + parseInt(a.marginRight) + N(s).width, + f = + l && + parseInt(l.marginLeft) + parseInt(l.marginRight) + N(r).width; + if (i.display === "flex") + return i.flexDirection === "column" || + i.flexDirection === "column-reverse" + ? "vertical" + : "horizontal"; + if (i.display === "grid") + return i.gridTemplateColumns.split(" ").length <= 1 + ? "vertical" + : "horizontal"; + if (s && a.float && a.float !== "none") { + var d = a.float === "left" ? "left" : "right"; + return r && (l.clear === "both" || l.clear === d) + ? "vertical" + : "horizontal"; + } + return s && + (a.display === "block" || + a.display === "flex" || + a.display === "table" || + a.display === "grid" || + (c >= o && i[_i] === "none") || + (r && i[_i] === "none" && c + f > o)) + ? "vertical" + : "horizontal"; + }, + Vn = function (t, e, i) { + var o = i ? t.left : t.top, + s = i ? t.right : t.bottom, + r = i ? t.width : t.height, + a = i ? e.left : e.top, + l = i ? e.right : e.bottom, + c = i ? e.width : e.height; + return o === a || s === l || o + r / 2 === a + c / 2; + }, + Wn = function (t, e) { + var i; + return ( + we.some(function (o) { + var s = o[j].options.emptyInsertThreshold; + if (!(!s || Ke(o))) { + var r = N(o), + a = t >= r.left - s && t <= r.right + s, + l = e >= r.top - s && e <= r.bottom + s; + if (a && l) return (i = o); + } + }), + i + ); + }, + Xi = function (t) { + function e(s, r) { + return function (a, l, c, f) { + var d = + a.options.group.name && + l.options.group.name && + a.options.group.name === l.options.group.name; + if (s == null && (r || d)) return !0; + if (s == null || s === !1) return !1; + if (r && s === "clone") return s; + if (typeof s == "function") + return e(s(a, l, c, f), r)(a, l, c, f); + var p = (r ? a : l).options.group.name; + return ( + s === !0 || + (typeof s == "string" && s === p) || + (s.join && s.indexOf(p) > -1) + ); + }; + } + var i = {}, + o = t.group; + ((!o || ue(o) != "object") && (o = { name: o }), + (i.name = o.name), + (i.checkPull = e(o.pull, !0)), + (i.checkPut = e(o.put)), + (i.revertClone = o.revertClone), + (t.group = i)); + }, + $i = function () { + !Wi && y && b(y, "display", "none"); + }, + Ki = function () { + !Wi && y && b(y, "display", ""); + }; +Oe && + !Pi && + document.addEventListener( + "click", + function (n) { + if (ye) + return ( + n.preventDefault(), + n.stopPropagation && n.stopPropagation(), + n.stopImmediatePropagation && n.stopImmediatePropagation(), + (ye = !1), + !1 + ); + }, + !0, + ); +var Ct = function (t) { + if (h) { + t = t.touches ? t.touches[0] : t; + var e = Wn(t.clientX, t.clientY); + if (e) { + var i = {}; + for (var o in t) t.hasOwnProperty(o) && (i[o] = t[o]); + ((i.target = i.rootEl = e), + (i.preventDefault = void 0), + (i.stopPropagation = void 0), + e[j]._onDragOver(i)); + } + } + }, + zn = function (t) { + h && h.parentNode[j]._isOutsideThisEl(t.target); + }; +function v(n, t) { + if (!(n && n.nodeType && n.nodeType === 1)) + throw "Sortable: `el` must be an HTMLElement, not ".concat( + {}.toString.call(n), + ); + ((this.el = n), (this.options = t = gt({}, t)), (n[j] = this)); + var e = { + group: null, + sort: !0, + disabled: !1, + store: null, + handle: null, + draggable: /^[uo]l$/i.test(n.nodeName) ? ">li" : ">*", + swapThreshold: 1, + invertSwap: !1, + invertedSwapThreshold: null, + removeCloneOnHide: !0, + direction: function () { + return zi(n, this.options); + }, + ghostClass: "sortable-ghost", + chosenClass: "sortable-chosen", + dragClass: "sortable-drag", + ignore: "a, img", + filter: null, + preventOnFilter: !0, + animation: 0, + easing: null, + setData: function (r, a) { + r.setData("Text", a.textContent); + }, + dropBubble: !1, + dragoverBubble: !1, + dataIdAttr: "data-id", + delay: 0, + delayOnTouchOnly: !1, + touchStartThreshold: + (Number.parseInt ? Number : window).parseInt( + window.devicePixelRatio, + 10, + ) || 1, + forceFallback: !1, + fallbackClass: "sortable-fallback", + fallbackOnBody: !1, + fallbackTolerance: 0, + fallbackOffset: { x: 0, y: 0 }, + supportPointer: + v.supportPointer !== !1 && "PointerEvent" in window && (!Gt || $e), + emptyInsertThreshold: 5, + }; + te.initializePlugins(this, n, e); + for (var i in e) !(i in t) && (t[i] = e[i]); + Xi(t); + for (var o in this) + o.charAt(0) === "_" && + typeof this[o] == "function" && + (this[o] = this[o].bind(this)); + ((this.nativeDraggable = t.forceFallback ? !1 : Hn), + this.nativeDraggable && (this.options.touchStartThreshold = 1), + t.supportPointer + ? O(n, "pointerdown", this._onTapStart) + : (O(n, "mousedown", this._onTapStart), + O(n, "touchstart", this._onTapStart)), + this.nativeDraggable && + (O(n, "dragover", this), O(n, "dragenter", this)), + we.push(this.el), + t.store && t.store.get && this.sort(t.store.get(this) || []), + gt(this, Mn())); +} +v.prototype = { + constructor: v, + _isOutsideThisEl: function (t) { + !this.el.contains(t) && t !== this.el && (Rt = null); + }, + _getDirection: function (t, e) { + return typeof this.options.direction == "function" + ? this.options.direction.call(this, t, e, h) + : this.options.direction; + }, + _onTapStart: function (t) { + if (t.cancelable) { + var e = this, + i = this.el, + o = this.options, + s = o.preventOnFilter, + r = t.type, + a = + (t.touches && t.touches[0]) || + (t.pointerType && t.pointerType === "touch" && t), + l = (a || t).target, + c = + (t.target.shadowRoot && + ((t.path && t.path[0]) || + (t.composedPath && t.composedPath()[0]))) || + l, + f = o.filter; + if ( + (qn(i), + !h && + !( + (/mousedown|pointerdown/.test(r) && t.button !== 0) || + o.disabled + ) && + !c.isContentEditable && + !( + !this.nativeDraggable && + Gt && + l && + l.tagName.toUpperCase() === "SELECT" + ) && + ((l = lt(l, o.draggable, i, !1)), + !(l && l.animated) && pe !== l)) + ) { + if ( + ((Mt = ot(l)), + (qt = ot(l, o.draggable)), + typeof f == "function") + ) { + if (f.call(this, t, l, this)) { + (K({ + sortable: e, + rootEl: c, + name: "filter", + targetEl: l, + toEl: i, + fromEl: i, + }), + G("filter", e, { evt: t }), + s && t.preventDefault()); + return; + } + } else if ( + f && + ((f = f.split(",").some(function (d) { + if (((d = lt(c, d.trim(), i, !1)), d)) + return ( + K({ + sortable: e, + rootEl: d, + name: "filter", + targetEl: l, + fromEl: i, + toEl: i, + }), + G("filter", e, { evt: t }), + !0 + ); + })), + f) + ) { + s && t.preventDefault(); + return; + } + (o.handle && !lt(c, o.handle, i, !1)) || + this._prepareDragStart(t, a, l); + } + } + }, + _prepareDragStart: function (t, e, i) { + var o = this, + s = o.el, + r = o.options, + a = s.ownerDocument, + l; + if (i && !h && i.parentNode === s) { + var c = N(i); + if ( + ((I = s), + (h = i), + (R = h.parentNode), + (Lt = h.nextSibling), + (pe = i), + (ce = r.group), + (v.dragged = h), + (At = { + target: h, + clientX: (e || t).clientX, + clientY: (e || t).clientY, + }), + (Ii = At.clientX - c.left), + (Ti = At.clientY - c.top), + (this._lastX = (e || t).clientX), + (this._lastY = (e || t).clientY), + (h.style["will-change"] = "all"), + (l = function () { + if ((G("delayEnded", o, { evt: t }), v.eventCanceled)) { + o._onDrop(); + return; + } + (o._disableDelayedDragEvents(), + !Di && o.nativeDraggable && (h.draggable = !0), + o._triggerDragStart(t, e), + K({ sortable: o, name: "choose", originalEvent: t }), + Q(h, r.chosenClass, !0)); + }), + r.ignore.split(",").forEach(function (f) { + ki(h, f.trim(), ke); + }), + O(a, "dragover", Ct), + O(a, "mousemove", Ct), + O(a, "touchmove", Ct), + r.supportPointer + ? (O(a, "pointerup", o._onDrop), + !this.nativeDraggable && O(a, "pointercancel", o._onDrop)) + : (O(a, "mouseup", o._onDrop), + O(a, "touchend", o._onDrop), + O(a, "touchcancel", o._onDrop)), + Di && + this.nativeDraggable && + ((this.options.touchStartThreshold = 4), + (h.draggable = !0)), + G("delayStart", this, { evt: t }), + r.delay && + (!r.delayOnTouchOnly || e) && + (!this.nativeDraggable || !(Zt || mt))) + ) { + if (v.eventCanceled) { + this._onDrop(); + return; + } + (r.supportPointer + ? (O(a, "pointerup", o._disableDelayedDrag), + O(a, "pointercancel", o._disableDelayedDrag)) + : (O(a, "mouseup", o._disableDelayedDrag), + O(a, "touchend", o._disableDelayedDrag), + O(a, "touchcancel", o._disableDelayedDrag)), + O(a, "mousemove", o._delayedDragTouchMoveHandler), + O(a, "touchmove", o._delayedDragTouchMoveHandler), + r.supportPointer && + O(a, "pointermove", o._delayedDragTouchMoveHandler), + (o._dragStartTimer = setTimeout(l, r.delay))); + } else l(); + } + }, + _delayedDragTouchMoveHandler: function (t) { + var e = t.touches ? t.touches[0] : t; + Math.max( + Math.abs(e.clientX - this._lastX), + Math.abs(e.clientY - this._lastY), + ) >= + Math.floor( + this.options.touchStartThreshold / + ((this.nativeDraggable && window.devicePixelRatio) || 1), + ) && this._disableDelayedDrag(); + }, + _disableDelayedDrag: function () { + (h && ke(h), + clearTimeout(this._dragStartTimer), + this._disableDelayedDragEvents()); + }, + _disableDelayedDragEvents: function () { + var t = this.el.ownerDocument; + (x(t, "mouseup", this._disableDelayedDrag), + x(t, "touchend", this._disableDelayedDrag), + x(t, "touchcancel", this._disableDelayedDrag), + x(t, "pointerup", this._disableDelayedDrag), + x(t, "pointercancel", this._disableDelayedDrag), + x(t, "mousemove", this._delayedDragTouchMoveHandler), + x(t, "touchmove", this._delayedDragTouchMoveHandler), + x(t, "pointermove", this._delayedDragTouchMoveHandler)); + }, + _triggerDragStart: function (t, e) { + ((e = e || (t.pointerType == "touch" && t)), + !this.nativeDraggable || e + ? this.options.supportPointer + ? O(document, "pointermove", this._onTouchMove) + : e + ? O(document, "touchmove", this._onTouchMove) + : O(document, "mousemove", this._onTouchMove) + : (O(h, "dragend", this), + O(I, "dragstart", this._onDragStart))); + try { + document.selection + ? me(function () { + document.selection.empty(); + }) + : window.getSelection().removeAllRanges(); + } catch {} + }, + _dragStarted: function (t, e) { + if (((Pt = !1), I && h)) { + (G("dragStarted", this, { evt: e }), + this.nativeDraggable && O(document, "dragover", zn)); + var i = this.options; + (!t && Q(h, i.dragClass, !1), + Q(h, i.ghostClass, !0), + (v.active = this), + t && this._appendGhost(), + K({ sortable: this, name: "start", originalEvent: e })); + } else this._nulling(); + }, + _emulateDragOver: function () { + if (at) { + ((this._lastX = at.clientX), (this._lastY = at.clientY), $i()); + for ( + var t = document.elementFromPoint(at.clientX, at.clientY), + e = t; + t && + t.shadowRoot && + ((t = t.shadowRoot.elementFromPoint(at.clientX, at.clientY)), + t !== e); + ) + e = t; + if ((h.parentNode[j]._isOutsideThisEl(t), e)) + do { + if (e[j]) { + var i = void 0; + if ( + ((i = e[j]._onDragOver({ + clientX: at.clientX, + clientY: at.clientY, + target: t, + rootEl: e, + })), + i && !this.options.dragoverBubble) + ) + break; + } + t = e; + } while ((e = Ni(e))); + Ki(); + } + }, + _onTouchMove: function (t) { + if (At) { + var e = this.options, + i = e.fallbackTolerance, + o = e.fallbackOffset, + s = t.touches ? t.touches[0] : t, + r = y && Nt(y, !0), + a = y && r && r.a, + l = y && r && r.d, + c = fe && $ && Li($), + f = + (s.clientX - At.clientX + o.x) / (a || 1) + + (c ? c[0] - Ne[0] : 0) / (a || 1), + d = + (s.clientY - At.clientY + o.y) / (l || 1) + + (c ? c[1] - Ne[1] : 0) / (l || 1); + if (!v.active && !Pt) { + if ( + i && + Math.max( + Math.abs(s.clientX - this._lastX), + Math.abs(s.clientY - this._lastY), + ) < i + ) + return; + this._onDragStart(t, !0); + } + if (y) { + r + ? ((r.e += f - (Pe || 0)), (r.f += d - (Me || 0))) + : (r = { a: 1, b: 0, c: 0, d: 1, e: f, f: d }); + var p = "matrix(" + .concat(r.a, ",") + .concat(r.b, ",") + .concat(r.c, ",") + .concat(r.d, ",") + .concat(r.e, ",") + .concat(r.f, ")"); + (b(y, "webkitTransform", p), + b(y, "mozTransform", p), + b(y, "msTransform", p), + b(y, "transform", p), + (Pe = f), + (Me = d), + (at = s)); + } + t.cancelable && t.preventDefault(); + } + }, + _appendGhost: function () { + if (!y) { + var t = this.options.fallbackOnBody ? document.body : I, + e = N(h, !0, fe, !0, t), + i = this.options; + if (fe) { + for ( + $ = t; + b($, "position") === "static" && + b($, "transform") === "none" && + $ !== document; + ) + $ = $.parentNode; + ($ !== document.body && $ !== document.documentElement + ? ($ === document && ($ = dt()), + (e.top += $.scrollTop), + (e.left += $.scrollLeft)) + : ($ = dt()), + (Ne = Li($))); + } + ((y = h.cloneNode(!0)), + Q(y, i.ghostClass, !1), + Q(y, i.fallbackClass, !0), + Q(y, i.dragClass, !0), + b(y, "transition", ""), + b(y, "transform", ""), + b(y, "box-sizing", "border-box"), + b(y, "margin", 0), + b(y, "top", e.top), + b(y, "left", e.left), + b(y, "width", e.width), + b(y, "height", e.height), + b(y, "opacity", "0.8"), + b(y, "position", fe ? "absolute" : "fixed"), + b(y, "zIndex", "100000"), + b(y, "pointerEvents", "none"), + (v.ghost = y), + t.appendChild(y), + b( + y, + "transform-origin", + (Ii / parseInt(y.style.width)) * 100 + + "% " + + (Ti / parseInt(y.style.height)) * 100 + + "%", + )); + } + }, + _onDragStart: function (t, e) { + var i = this, + o = t.dataTransfer, + s = i.options; + if ((G("dragStart", this, { evt: t }), v.eventCanceled)) { + this._onDrop(); + return; + } + (G("setupClone", this), + v.eventCanceled || + ((T = Hi(h)), + T.removeAttribute("id"), + (T.draggable = !1), + (T.style["will-change"] = ""), + this._hideClone(), + Q(T, this.options.chosenClass, !1), + (v.clone = T)), + (i.cloneId = me(function () { + (G("clone", i), + !v.eventCanceled && + (i.options.removeCloneOnHide || I.insertBefore(T, h), + i._hideClone(), + K({ sortable: i, name: "clone" }))); + })), + !e && Q(h, s.dragClass, !0), + e + ? ((ye = !0), (i._loopId = setInterval(i._emulateDragOver, 50))) + : (x(document, "mouseup", i._onDrop), + x(document, "touchend", i._onDrop), + x(document, "touchcancel", i._onDrop), + o && + ((o.effectAllowed = "move"), + s.setData && s.setData.call(i, o, h)), + O(document, "drop", i), + b(h, "transform", "translateZ(0)")), + (Pt = !0), + (i._dragStartId = me(i._dragStarted.bind(i, e, t))), + O(document, "selectstart", i), + (Kt = !0), + window.getSelection().removeAllRanges(), + Gt && b(document.body, "user-select", "none")); + }, + _onDragOver: function (t) { + var e = this.el, + i = t.target, + o, + s, + r, + a = this.options, + l = a.group, + c = v.active, + f = ce === l, + d = a.sort, + p = H || c, + u, + g = this, + m = !1; + if (Ve) return; + function S(L, et) { + G( + L, + g, + ft( + { + evt: t, + isOwner: f, + axis: u ? "vertical" : "horizontal", + revert: r, + dragRect: o, + targetRect: s, + canSort: d, + fromSortable: p, + target: i, + completed: w, + onMove: function (Ge, Gi) { + return he(I, e, h, o, Ge, N(Ge), t, Gi); + }, + changed: D, + }, + et, + ), + ); + } + function E() { + (S("dragOverAnimationCapture"), + g.captureAnimationState(), + g !== p && p.captureAnimationState()); + } + function w(L) { + return ( + S("dragOverCompleted", { insertion: L }), + L && + (f ? c._hideClone() : c._showClone(g), + g !== p && + (Q( + h, + H ? H.options.ghostClass : c.options.ghostClass, + !1, + ), + Q(h, a.ghostClass, !0)), + H !== g && g !== v.active + ? (H = g) + : g === v.active && H && (H = null), + p === g && (g._ignoreWhileAnimating = i), + g.animateAll(function () { + (S("dragOverAnimationComplete"), + (g._ignoreWhileAnimating = null)); + }), + g !== p && + (p.animateAll(), (p._ignoreWhileAnimating = null))), + ((i === h && !h.animated) || (i === e && !i.animated)) && + (Rt = null), + !a.dragoverBubble && + !t.rootEl && + i !== document && + (h.parentNode[j]._isOutsideThisEl(t.target), !L && Ct(t)), + !a.dragoverBubble && t.stopPropagation && t.stopPropagation(), + (m = !0) + ); + } + function D() { + ((Z = ot(h)), + (wt = ot(h, a.draggable)), + K({ + sortable: g, + name: "change", + toEl: e, + newIndex: Z, + newDraggableIndex: wt, + originalEvent: t, + })); + } + if ( + (t.preventDefault !== void 0 && t.cancelable && t.preventDefault(), + (i = lt(i, a.draggable, e, !0)), + S("dragOver"), + v.eventCanceled) + ) + return m; + if ( + h.contains(t.target) || + (i.animated && i.animatingX && i.animatingY) || + g._ignoreWhileAnimating === i + ) + return w(!1); + if ( + ((ye = !1), + c && + !a.disabled && + (f + ? d || (r = R !== I) + : H === this || + ((this.lastPutMode = ce.checkPull(this, c, h, t)) && + l.checkPut(this, c, h, t)))) + ) { + if ( + ((u = this._getDirection(t, i) === "vertical"), + (o = N(h)), + S("dragOverValid"), + v.eventCanceled) + ) + return m; + if (r) + return ( + (R = I), + E(), + this._hideClone(), + S("revert"), + v.eventCanceled || + (Lt ? I.insertBefore(h, Lt) : I.appendChild(h)), + w(!0) + ); + var A = Ke(e, a.draggable); + if (!A || (Yn(t, u, this) && !A.animated)) { + if (A === h) return w(!1); + if ( + (A && e === t.target && (i = A), + i && (s = N(i)), + he(I, e, h, o, i, s, t, !!i) !== !1) + ) + return ( + E(), + A && A.nextSibling + ? e.insertBefore(h, A.nextSibling) + : e.appendChild(h), + (R = e), + D(), + w(!0) + ); + } else if (A && Kn(t, u, this)) { + var C = kt(e, 0, a, !0); + if (C === h) return w(!1); + if (((i = C), (s = N(i)), he(I, e, h, o, i, s, t, !1) !== !1)) + return (E(), e.insertBefore(h, C), (R = e), D(), w(!0)); + } else if (i.parentNode === e) { + s = N(i); + var F = 0, + q, + J = h.parentNode !== e, + _ = !Vn( + (h.animated && h.toRect) || o, + (i.animated && i.toRect) || s, + u, + ), + V = u ? "top" : "left", + W = Ci(i, "top", "top") || Ci(h, "top", "top"), + tt = W ? W.scrollTop : void 0; + (Rt !== i && + ((q = s[V]), (Qt = !1), (de = (!_ && a.invertSwap) || J)), + (F = Un( + t, + i, + s, + u, + _ ? 1 : a.swapThreshold, + a.invertedSwapThreshold == null + ? a.swapThreshold + : a.invertedSwapThreshold, + de, + Rt === i, + ))); + var z; + if (F !== 0) { + var k = ot(h); + do ((k -= F), (z = R.children[k])); + while (z && (b(z, "display") === "none" || z === y)); + } + if (F === 0 || z === i) return w(!1); + ((Rt = i), (Jt = F)); + var Y = i.nextElementSibling, + B = !1; + B = F === 1; + var X = he(I, e, h, o, i, s, t, B); + if (X !== !1) + return ( + (X === 1 || X === -1) && (B = X === 1), + (Ve = !0), + setTimeout($n, 30), + E(), + B && !Y + ? e.appendChild(h) + : i.parentNode.insertBefore(h, B ? Y : i), + W && Fi(W, 0, tt - W.scrollTop), + (R = h.parentNode), + q !== void 0 && !de && (ge = Math.abs(q - N(i)[V])), + D(), + w(!0) + ); + } + if (e.contains(h)) return w(!1); + } + return !1; + }, + _ignoreWhileAnimating: null, + _offMoveEvents: function () { + (x(document, "mousemove", this._onTouchMove), + x(document, "touchmove", this._onTouchMove), + x(document, "pointermove", this._onTouchMove), + x(document, "dragover", Ct), + x(document, "mousemove", Ct), + x(document, "touchmove", Ct)); + }, + _offUbEvents: function () { + var t = this.el.ownerDocument; + (x(t, "mouseup", this._onDrop), + x(t, "touchend", this._onDrop), + x(t, "pointerup", this._onDrop), + x(t, "pointercancel", this._onDrop), + x(t, "touchcancel", this._onDrop), + x(document, "selectstart", this)); + }, + _onDrop: function (t) { + var e = this.el, + i = this.options; + if ( + ((Z = ot(h)), + (wt = ot(h, i.draggable)), + G("drop", this, { evt: t }), + (R = h && h.parentNode), + (Z = ot(h)), + (wt = ot(h, i.draggable)), + v.eventCanceled) + ) { + this._nulling(); + return; + } + ((Pt = !1), + (de = !1), + (Qt = !1), + clearInterval(this._loopId), + clearTimeout(this._dragStartTimer), + We(this.cloneId), + We(this._dragStartId), + this.nativeDraggable && + (x(document, "drop", this), + x(e, "dragstart", this._onDragStart)), + this._offMoveEvents(), + this._offUbEvents(), + Gt && b(document.body, "user-select", ""), + b(h, "transform", ""), + t && + (Kt && + (t.cancelable && t.preventDefault(), + !i.dropBubble && t.stopPropagation()), + y && y.parentNode && y.parentNode.removeChild(y), + (I === R || (H && H.lastPutMode !== "clone")) && + T && + T.parentNode && + T.parentNode.removeChild(T), + h && + (this.nativeDraggable && x(h, "dragend", this), + ke(h), + (h.style["will-change"] = ""), + Kt && + !Pt && + Q( + h, + H ? H.options.ghostClass : this.options.ghostClass, + !1, + ), + Q(h, this.options.chosenClass, !1), + K({ + sortable: this, + name: "unchoose", + toEl: R, + newIndex: null, + newDraggableIndex: null, + originalEvent: t, + }), + I !== R + ? (Z >= 0 && + (K({ + rootEl: R, + name: "add", + toEl: R, + fromEl: I, + originalEvent: t, + }), + K({ + sortable: this, + name: "remove", + toEl: R, + originalEvent: t, + }), + K({ + rootEl: R, + name: "sort", + toEl: R, + fromEl: I, + originalEvent: t, + }), + K({ + sortable: this, + name: "sort", + toEl: R, + originalEvent: t, + })), + H && H.save()) + : Z !== Mt && + Z >= 0 && + (K({ + sortable: this, + name: "update", + toEl: R, + originalEvent: t, + }), + K({ + sortable: this, + name: "sort", + toEl: R, + originalEvent: t, + })), + v.active && + ((Z == null || Z === -1) && ((Z = Mt), (wt = qt)), + K({ + sortable: this, + name: "end", + toEl: R, + originalEvent: t, + }), + this.save()))), + this._nulling()); + }, + _nulling: function () { + (G("nulling", this), + (I = + h = + R = + y = + Lt = + T = + pe = + St = + At = + at = + Kt = + Z = + wt = + Mt = + qt = + Rt = + Jt = + H = + ce = + v.dragged = + v.ghost = + v.clone = + v.active = + null), + Se.forEach(function (t) { + t.checked = !0; + }), + (Se.length = Pe = Me = 0)); + }, + handleEvent: function (t) { + switch (t.type) { + case "drop": + case "dragend": + this._onDrop(t); + break; + case "dragenter": + case "dragover": + h && (this._onDragOver(t), Xn(t)); + break; + case "selectstart": + t.preventDefault(); + break; + } + }, + toArray: function () { + for ( + var t = [], + e, + i = this.el.children, + o = 0, + s = i.length, + r = this.options; + o < s; + o++ + ) + ((e = i[o]), + lt(e, r.draggable, this.el, !1) && + t.push(e.getAttribute(r.dataIdAttr) || jn(e))); + return t; + }, + sort: function (t, e) { + var i = {}, + o = this.el; + (this.toArray().forEach(function (s, r) { + var a = o.children[r]; + lt(a, this.options.draggable, o, !1) && (i[s] = a); + }, this), + e && this.captureAnimationState(), + t.forEach(function (s) { + i[s] && (o.removeChild(i[s]), o.appendChild(i[s])); + }), + e && this.animateAll()); + }, + save: function () { + var t = this.options.store; + t && t.set && t.set(this); + }, + closest: function (t, e) { + return lt(t, e || this.options.draggable, this.el, !1); + }, + option: function (t, e) { + var i = this.options; + if (e === void 0) return i[t]; + var o = te.modifyOption(this, t, e); + (typeof o < "u" ? (i[t] = o) : (i[t] = e), t === "group" && Xi(i)); + }, + destroy: function () { + G("destroy", this); + var t = this.el; + ((t[j] = null), + x(t, "mousedown", this._onTapStart), + x(t, "touchstart", this._onTapStart), + x(t, "pointerdown", this._onTapStart), + this.nativeDraggable && + (x(t, "dragover", this), x(t, "dragenter", this)), + Array.prototype.forEach.call( + t.querySelectorAll("[draggable]"), + function (e) { + e.removeAttribute("draggable"); + }, + ), + this._onDrop(), + this._disableDelayedDragEvents(), + we.splice(we.indexOf(this.el), 1), + (this.el = t = null)); + }, + _hideClone: function () { + if (!St) { + if ((G("hideClone", this), v.eventCanceled)) return; + (b(T, "display", "none"), + this.options.removeCloneOnHide && + T.parentNode && + T.parentNode.removeChild(T), + (St = !0)); + } + }, + _showClone: function (t) { + if (t.lastPutMode !== "clone") { + this._hideClone(); + return; + } + if (St) { + if ((G("showClone", this), v.eventCanceled)) return; + (h.parentNode == I && !this.options.group.revertClone + ? I.insertBefore(T, h) + : Lt + ? I.insertBefore(T, Lt) + : I.appendChild(T), + this.options.group.revertClone && this.animate(h, T), + b(T, "display", ""), + (St = !1)); + } + }, +}; +function Xn(n) { + (n.dataTransfer && (n.dataTransfer.dropEffect = "move"), + n.cancelable && n.preventDefault()); +} +function he(n, t, e, i, o, s, r, a) { + var l, + c = n[j], + f = c.options.onMove, + d; + return ( + window.CustomEvent && !mt && !Zt + ? (l = new CustomEvent("move", { bubbles: !0, cancelable: !0 })) + : ((l = document.createEvent("Event")), + l.initEvent("move", !0, !0)), + (l.to = t), + (l.from = n), + (l.dragged = e), + (l.draggedRect = i), + (l.related = o || t), + (l.relatedRect = s || N(t)), + (l.willInsertAfter = a), + (l.originalEvent = r), + n.dispatchEvent(l), + f && (d = f.call(c, l, r)), + d + ); +} +function ke(n) { + n.draggable = !1; +} +function $n() { + Ve = !1; +} +function Kn(n, t, e) { + var i = N(kt(e.el, 0, e.options, !0)), + o = Vi(e.el, e.options, y), + s = 10; + return t + ? n.clientX < o.left - s || (n.clientY < i.top && n.clientX < i.right) + : n.clientY < o.top - s || (n.clientY < i.bottom && n.clientX < i.left); +} +function Yn(n, t, e) { + var i = N(Ke(e.el, e.options.draggable)), + o = Vi(e.el, e.options, y), + s = 10; + return t + ? n.clientX > o.right + s || + (n.clientY > i.bottom && n.clientX > i.left) + : n.clientY > o.bottom + s || + (n.clientX > i.right && n.clientY > i.top); +} +function Un(n, t, e, i, o, s, r, a) { + var l = i ? n.clientY : n.clientX, + c = i ? e.height : e.width, + f = i ? e.top : e.left, + d = i ? e.bottom : e.right, + p = !1; + if (!r) { + if (a && ge < c * o) { + if ( + (!Qt && + (Jt === 1 ? l > f + (c * s) / 2 : l < d - (c * s) / 2) && + (Qt = !0), + Qt) + ) + p = !0; + else if (Jt === 1 ? l < f + ge : l > d - ge) return -Jt; + } else if (l > f + (c * (1 - o)) / 2 && l < d - (c * (1 - o)) / 2) + return Gn(t); + } + return ( + (p = p || r), + p && (l < f + (c * s) / 2 || l > d - (c * s) / 2) + ? l > f + c / 2 + ? 1 + : -1 + : 0 + ); +} +function Gn(n) { + return ot(h) < ot(n) ? 1 : -1; +} +function jn(n) { + for ( + var t = n.tagName + n.className + n.src + n.href + n.textContent, + e = t.length, + i = 0; + e--; + ) + i += t.charCodeAt(e); + return i.toString(36); +} +function qn(n) { + Se.length = 0; + for (var t = n.getElementsByTagName("input"), e = t.length; e--; ) { + var i = t[e]; + i.checked && Se.push(i); + } +} +function me(n) { + return setTimeout(n, 0); +} +function We(n) { + return clearTimeout(n); +} +Oe && + O(document, "touchmove", function (n) { + (v.active || Pt) && n.cancelable && n.preventDefault(); + }); +v.utils = { + on: O, + off: x, + css: b, + find: ki, + is: function (t, e) { + return !!lt(t, e, t, !1); + }, + extend: Rn, + throttle: Bi, + closest: lt, + toggleClass: Q, + clone: Hi, + index: ot, + nextTick: me, + cancelNextTick: We, + detectDirection: zi, + getChild: kt, + expando: j, +}; +v.get = function (n) { + return n[j]; +}; +v.mount = function () { + for (var n = arguments.length, t = new Array(n), e = 0; e < n; e++) + t[e] = arguments[e]; + (t[0].constructor === Array && (t = t[0]), + t.forEach(function (i) { + if (!i.prototype || !i.prototype.constructor) + throw "Sortable: Mounted plugin must be a constructor function, not ".concat( + {}.toString.call(i), + ); + (i.utils && (v.utils = ft(ft({}, v.utils), i.utils)), te.mount(i)); + })); +}; +v.create = function (n, t) { + return new v(n, t); +}; +v.version = Tn; +var M = [], + Yt, + ze, + Xe = !1, + Be, + Fe, + xe, + Ut; +function Jn() { + function n() { + this.defaults = { + scroll: !0, + forceAutoScrollFallback: !1, + scrollSensitivity: 30, + scrollSpeed: 10, + bubbleScroll: !0, + }; + for (var t in this) + t.charAt(0) === "_" && + typeof this[t] == "function" && + (this[t] = this[t].bind(this)); + } + return ( + (n.prototype = { + dragStarted: function (e) { + var i = e.originalEvent; + this.sortable.nativeDraggable + ? O(document, "dragover", this._handleAutoScroll) + : this.options.supportPointer + ? O( + document, + "pointermove", + this._handleFallbackAutoScroll, + ) + : i.touches + ? O( + document, + "touchmove", + this._handleFallbackAutoScroll, + ) + : O( + document, + "mousemove", + this._handleFallbackAutoScroll, + ); + }, + dragOverCompleted: function (e) { + var i = e.originalEvent; + !this.options.dragOverBubble && + !i.rootEl && + this._handleAutoScroll(i); + }, + drop: function () { + (this.sortable.nativeDraggable + ? x(document, "dragover", this._handleAutoScroll) + : (x( + document, + "pointermove", + this._handleFallbackAutoScroll, + ), + x(document, "touchmove", this._handleFallbackAutoScroll), + x(document, "mousemove", this._handleFallbackAutoScroll)), + Ri(), + be(), + Pn()); + }, + nulling: function () { + ((xe = ze = Yt = Xe = Ut = Be = Fe = null), (M.length = 0)); + }, + _handleFallbackAutoScroll: function (e) { + this._handleAutoScroll(e, !0); + }, + _handleAutoScroll: function (e, i) { + var o = this, + s = (e.touches ? e.touches[0] : e).clientX, + r = (e.touches ? e.touches[0] : e).clientY, + a = document.elementFromPoint(s, r); + if ( + ((xe = e), + i || this.options.forceAutoScrollFallback || Zt || mt || Gt) + ) { + He(e, this.options, a, i); + var l = xt(a, !0); + Xe && + (!Ut || s !== Be || r !== Fe) && + (Ut && Ri(), + (Ut = setInterval(function () { + var c = xt(document.elementFromPoint(s, r), !0); + (c !== l && ((l = c), be()), + He(e, o.options, c, i)); + }, 10)), + (Be = s), + (Fe = r)); + } else { + if (!this.options.bubbleScroll || xt(a, !0) === dt()) { + be(); + return; + } + He(e, this.options, xt(a, !1), !1); + } + }, + }), + gt(n, { pluginName: "scroll", initializeByDefault: !0 }) + ); +} +function be() { + (M.forEach(function (n) { + clearInterval(n.pid); + }), + (M = [])); +} +function Ri() { + clearInterval(Ut); +} +var He = Bi(function (n, t, e, i) { + if (t.scroll) { + var o = (n.touches ? n.touches[0] : n).clientX, + s = (n.touches ? n.touches[0] : n).clientY, + r = t.scrollSensitivity, + a = t.scrollSpeed, + l = dt(), + c = !1, + f; + ze !== e && + ((ze = e), + be(), + (Yt = t.scroll), + (f = t.scrollFn), + Yt === !0 && (Yt = xt(e, !0))); + var d = 0, + p = Yt; + do { + var u = p, + g = N(u), + m = g.top, + S = g.bottom, + E = g.left, + w = g.right, + D = g.width, + A = g.height, + C = void 0, + F = void 0, + q = u.scrollWidth, + J = u.scrollHeight, + _ = b(u), + V = u.scrollLeft, + W = u.scrollTop; + u === l + ? ((C = + D < q && + (_.overflowX === "auto" || + _.overflowX === "scroll" || + _.overflowX === "visible")), + (F = + A < J && + (_.overflowY === "auto" || + _.overflowY === "scroll" || + _.overflowY === "visible"))) + : ((C = + D < q && + (_.overflowX === "auto" || _.overflowX === "scroll")), + (F = + A < J && + (_.overflowY === "auto" || + _.overflowY === "scroll"))); + var tt = + C && + (Math.abs(w - o) <= r && V + D < q) - + (Math.abs(E - o) <= r && !!V), + z = + F && + (Math.abs(S - s) <= r && W + A < J) - + (Math.abs(m - s) <= r && !!W); + if (!M[d]) for (var k = 0; k <= d; k++) M[k] || (M[k] = {}); + ((M[d].vx != tt || M[d].vy != z || M[d].el !== u) && + ((M[d].el = u), + (M[d].vx = tt), + (M[d].vy = z), + clearInterval(M[d].pid), + (tt != 0 || z != 0) && + ((c = !0), + (M[d].pid = setInterval( + function () { + i && + this.layer === 0 && + v.active._onTouchMove(xe); + var Y = M[this.layer].vy + ? M[this.layer].vy * a + : 0, + B = M[this.layer].vx + ? M[this.layer].vx * a + : 0; + (typeof f == "function" && + f.call( + v.dragged.parentNode[j], + B, + Y, + n, + xe, + M[this.layer].el, + ) !== "continue") || + Fi(M[this.layer].el, B, Y); + }.bind({ layer: d }), + 24, + )))), + d++); + } while (t.bubbleScroll && p !== l && (p = xt(p, !1))); + Xe = c; + } + }, 30), + Yi = function (t) { + var e = t.originalEvent, + i = t.putSortable, + o = t.dragEl, + s = t.activeSortable, + r = t.dispatchSortableEvent, + a = t.hideGhostForTarget, + l = t.unhideGhostForTarget; + if (e) { + var c = i || s; + a(); + var f = + e.changedTouches && e.changedTouches.length + ? e.changedTouches[0] + : e, + d = document.elementFromPoint(f.clientX, f.clientY); + (l(), + c && + !c.el.contains(d) && + (r("spill"), this.onSpill({ dragEl: o, putSortable: i }))); + } + }; +function Ye() {} +Ye.prototype = { + startIndex: null, + dragStart: function (t) { + var e = t.oldDraggableIndex; + this.startIndex = e; + }, + onSpill: function (t) { + var e = t.dragEl, + i = t.putSortable; + (this.sortable.captureAnimationState(), i && i.captureAnimationState()); + var o = kt(this.sortable.el, this.startIndex, this.options); + (o + ? this.sortable.el.insertBefore(e, o) + : this.sortable.el.appendChild(e), + this.sortable.animateAll(), + i && i.animateAll()); + }, + drop: Yi, +}; +gt(Ye, { pluginName: "revertOnSpill" }); +function Ue() {} +Ue.prototype = { + onSpill: function (t) { + var e = t.dragEl, + i = t.putSortable, + o = i || this.sortable; + (o.captureAnimationState(), + e.parentNode && e.parentNode.removeChild(e), + o.animateAll()); + }, + drop: Yi, +}; +gt(Ue, { pluginName: "removeOnSpill" }); +v.mount(new Jn()); +v.mount(Ue, Ye); +var Ui = v; +function bt(n) { + return n == null || n === "" || (typeof n == "string" && n.trim() === ""); +} +function P(n) { + return !bt(n); +} +var Ee = class { + constructor({ + canOptionLabelsWrap: t = !0, + canSelectPlaceholder: e = !0, + element: i, + getOptionLabelUsing: o = null, + getOptionLabelsUsing: s = null, + getOptionsUsing: r = null, + getSearchResultsUsing: a = null, + hasDynamicOptions: l = !1, + hasDynamicSearchResults: c = !0, + hasInitialNoOptionsMessage: f = !1, + initialOptionLabel: d = null, + initialOptionLabels: p = null, + initialState: u = null, + isAutofocused: g = !1, + isDisabled: m = !1, + isHtmlAllowed: S = !1, + isMultiple: E = !1, + isReorderable: w = !1, + isSearchable: D = !1, + livewireId: A = null, + loadingMessage: C = "Loading...", + maxItems: F = null, + maxItemsMessage: q = "Maximum number of items selected", + noOptionsMessage: J = "No options available", + noSearchResultsMessage: _ = "No results found", + onStateChange: V = () => {}, + options: W, + optionsLimit: tt = null, + placeholder: z, + position: k = null, + searchableOptionFields: Y = ["label"], + searchDebounce: B = 1e3, + searchingMessage: X = "Searching...", + searchPrompt: L = "Search...", + state: et, + statePath: ee = null, + }) { + ((this.canOptionLabelsWrap = t), + (this.canSelectPlaceholder = e), + (this.element = i), + (this.getOptionLabelUsing = o), + (this.getOptionLabelsUsing = s), + (this.getOptionsUsing = r), + (this.getSearchResultsUsing = a), + (this.hasDynamicOptions = l), + (this.hasDynamicSearchResults = c), + (this.hasInitialNoOptionsMessage = f), + (this.initialOptionLabel = d), + (this.initialOptionLabels = p), + (this.initialState = u), + (this.isAutofocused = g), + (this.isDisabled = m), + (this.isHtmlAllowed = S), + (this.isMultiple = E), + (this.isReorderable = w), + (this.isSearchable = D), + (this.livewireId = A), + (this.loadingMessage = C), + (this.maxItems = F), + (this.maxItemsMessage = q), + (this.noOptionsMessage = J), + (this.noSearchResultsMessage = _), + (this.onStateChange = V), + (this.options = W), + (this.optionsLimit = tt), + (this.originalOptions = JSON.parse(JSON.stringify(W))), + (this.placeholder = z), + (this.position = k), + (this.searchableOptionFields = Array.isArray(Y) ? Y : ["label"]), + (this.searchDebounce = B), + (this.searchingMessage = X), + (this.searchPrompt = L), + (this.state = et), + (this.statePath = ee), + (this.activeSearchId = 0), + (this.labelRepository = {}), + (this.isOpen = !1), + (this.selectedIndex = -1), + (this.searchQuery = ""), + (this.searchTimeout = null), + (this.isSearching = !1), + (this.selectedDisplayVersion = 0), + this.render(), + this.setUbEventListeners(), + this.isAutofocused && this.selectButton.focus()); + } + populateLabelRepositoryFromOptions(t) { + if (!(!t || !Array.isArray(t))) + for (let e of t) + e.options && Array.isArray(e.options) + ? this.populateLabelRepositoryFromOptions(e.options) + : e.value !== void 0 && + e.label !== void 0 && + (this.labelRepository[e.value] = e.label); + } + render() { + (this.populateLabelRepositoryFromOptions(this.options), + (this.container = document.createElement("div")), + (this.container.className = "fi-select-input-ctn"), + this.canOptionLabelsWrap || + this.container.classList.add( + "fi-select-input-ctn-option-labels-not-wrapped", + ), + this.container.setAttribute("aria-haspopup", "listbox"), + (this.selectButton = document.createElement("button")), + (this.selectButton.className = "fi-select-input-btn"), + (this.selectButton.type = "button"), + this.selectButton.setAttribute("aria-expanded", "false"), + (this.selectedDisplay = document.createElement("div")), + (this.selectedDisplay.className = "fi-select-input-value-ctn"), + this.updateSelectedDisplay(), + this.selectButton.appendChild(this.selectedDisplay), + (this.dropdown = document.createElement("div")), + (this.dropdown.className = "fi-dropdown-panel fi-scrollable"), + this.dropdown.setAttribute("role", "listbox"), + this.dropdown.setAttribute("tabindex", "-1"), + (this.dropdown.style.display = "none"), + (this.dropdownId = `fi-select-input-dropdown-${Math.random().toString(36).substring(2, 11)}`), + (this.dropdown.id = this.dropdownId), + this.isMultiple && + this.dropdown.setAttribute("aria-multiselectable", "true"), + this.isSearchable && + ((this.searchContainer = document.createElement("div")), + (this.searchContainer.className = "fi-select-input-search-ctn"), + (this.searchInput = document.createElement("input")), + (this.searchInput.className = "fi-input"), + (this.searchInput.type = "text"), + (this.searchInput.placeholder = this.searchPrompt), + this.searchInput.setAttribute("aria-label", "Search"), + this.searchContainer.appendChild(this.searchInput), + this.dropdown.appendChild(this.searchContainer), + this.searchInput.addEventListener("input", (t) => { + this.isDisabled || this.handleSearch(t); + }), + this.searchInput.addEventListener("keydown", (t) => { + if (!this.isDisabled) { + if (t.key === "Tab") { + t.preventDefault(); + let e = this.getVisibleOptions(); + if (e.length === 0) return; + (t.shiftKey + ? (this.selectedIndex = e.length - 1) + : (this.selectedIndex = 0), + e.forEach((i) => { + i.classList.remove("fi-selected"); + }), + e[this.selectedIndex].classList.add( + "fi-selected", + ), + e[this.selectedIndex].focus()); + } else if (t.key === "ArrowDown") { + if ( + (t.preventDefault(), + t.stopPropagation(), + this.getVisibleOptions().length === 0) + ) + return; + ((this.selectedIndex = -1), + this.searchInput.blur(), + this.focusNextOption()); + } else if (t.key === "ArrowUp") { + (t.preventDefault(), t.stopPropagation()); + let e = this.getVisibleOptions(); + if (e.length === 0) return; + ((this.selectedIndex = e.length - 1), + this.searchInput.blur(), + e[this.selectedIndex].classList.add( + "fi-selected", + ), + e[this.selectedIndex].focus(), + e[this.selectedIndex].id && + this.dropdown.setAttribute( + "aria-activedescendant", + e[this.selectedIndex].id, + ), + this.scrollOptionIntoView( + e[this.selectedIndex], + )); + } else if (t.key === "Enter") { + if ( + (t.preventDefault(), + t.stopPropagation(), + this.isSearching) + ) + return; + let e = this.getVisibleOptions(); + if (e.length === 0) return; + let i = e.find((s) => { + let r = + s.getAttribute("aria-disabled") === + "true", + a = s.classList.contains("fi-disabled"), + l = s.offsetParent === null; + return !(r || a || l); + }); + if (!i) return; + let o = i.getAttribute("data-value"); + if (o === null) return; + this.selectOption(o); + } + } + })), + (this.optionsList = document.createElement("ul")), + this.renderOptions(), + this.container.appendChild(this.selectButton), + this.container.appendChild(this.dropdown), + this.element.appendChild(this.container), + this.applyDisabledState()); + } + renderOptions() { + this.optionsList.innerHTML = ""; + let t = 0, + e = this.options, + i = 0, + o = !1; + (this.options.forEach((a) => { + a.options && Array.isArray(a.options) + ? ((i += a.options.length), (o = !0)) + : i++; + }), + o + ? (this.optionsList.className = "fi-select-input-options-ctn") + : i > 0 && (this.optionsList.className = "fi-dropdown-list")); + let s = o ? null : this.optionsList, + r = 0; + for (let a of e) { + if (this.optionsLimit > 0 && r >= this.optionsLimit) break; + if (a.options && Array.isArray(a.options)) { + let l = a.options; + if ( + (this.isMultiple && + Array.isArray(this.state) && + this.state.length > 0 && + (l = a.options.filter( + (c) => !this.state.includes(c.value), + )), + l.length > 0) + ) { + if (this.optionsLimit > 0) { + let c = this.optionsLimit - r; + c < l.length && (l = l.slice(0, c)); + } + (this.renderOptionGroup(a.label, l), + (r += l.length), + (t += l.length)); + } + } else { + if ( + this.isMultiple && + Array.isArray(this.state) && + this.state.includes(a.value) + ) + continue; + !s && + o && + ((s = document.createElement("ul")), + (s.className = "fi-dropdown-list"), + this.optionsList.appendChild(s)); + let l = this.createOptionElement(a.value, a); + (s.appendChild(l), r++, t++); + } + } + t === 0 + ? (this.searchQuery + ? this.showNoResultsMessage() + : this.hasInitialNoOptionsMessage || this.hasDynamicOptions + ? this.showNoOptionsMessage() + : this.isMultiple && + this.isOpen && + !this.isSearchable && + this.closeDropdown(), + this.optionsList.parentNode === this.dropdown && + this.dropdown.removeChild(this.optionsList)) + : (this.hideLoadingState(), + this.optionsList.parentNode !== this.dropdown && + this.dropdown.appendChild(this.optionsList)); + } + renderOptionGroup(t, e) { + if (e.length === 0) return; + let i = document.createElement("li"); + i.className = "fi-select-input-option-group"; + let o = document.createElement("div"); + ((o.className = "fi-dropdown-header"), (o.textContent = t)); + let s = document.createElement("ul"); + ((s.className = "fi-dropdown-list"), + e.forEach((r) => { + let a = this.createOptionElement(r.value, r); + s.appendChild(a); + }), + i.appendChild(o), + i.appendChild(s), + this.optionsList.appendChild(i)); + } + createOptionElement(t, e) { + let i = t, + o = e, + s = !1; + typeof e == "object" && + e !== null && + "label" in e && + "value" in e && + ((i = e.value), (o = e.label), (s = e.isDisabled || !1)); + let r = document.createElement("li"); + ((r.className = "fi-dropdown-list-item fi-select-input-option"), + s && r.classList.add("fi-disabled")); + let a = `fi-select-input-option-${Math.random().toString(36).substring(2, 11)}`; + if ( + ((r.id = a), + r.setAttribute("role", "option"), + r.setAttribute("data-value", i), + r.setAttribute("tabindex", "0"), + s && r.setAttribute("aria-disabled", "true"), + this.isHtmlAllowed && typeof o == "string") + ) { + let f = document.createElement("div"); + f.innerHTML = o; + let d = f.textContent || f.innerText || o; + r.setAttribute("aria-label", d); + } + let l = this.isMultiple + ? Array.isArray(this.state) && this.state.includes(i) + : this.state === i; + (r.setAttribute("aria-selected", l ? "true" : "false"), + l && r.classList.add("fi-selected")); + let c = document.createElement("span"); + return ( + this.isHtmlAllowed ? (c.innerHTML = o) : (c.textContent = o), + r.appendChild(c), + s || + r.addEventListener("click", (f) => { + (f.preventDefault(), + f.stopPropagation(), + this.selectOption(i), + this.isMultiple && + (this.isSearchable && this.searchInput + ? setTimeout(() => { + this.searchInput.focus(); + }, 0) + : setTimeout(() => { + r.focus(); + }, 0))); + }), + r + ); + } + async updateSelectedDisplay() { + this.selectedDisplayVersion = this.selectedDisplayVersion + 1; + let t = this.selectedDisplayVersion, + e = document.createDocumentFragment(); + if (this.isMultiple) { + if (!Array.isArray(this.state) || this.state.length === 0) { + let o = document.createElement("span"); + ((o.textContent = this.placeholder), + o.classList.add("fi-select-input-placeholder"), + e.appendChild(o)); + } else { + let o = await this.getLabelsForMultipleSelection(); + if (t !== this.selectedDisplayVersion) return; + this.addBadgesForSelectedOptions(o, e); + } + t === this.selectedDisplayVersion && + (this.selectedDisplay.replaceChildren(e), + this.isOpen && this.deferPositionDropdown()); + return; + } + if (this.state === null || this.state === "") { + let o = document.createElement("span"); + if ( + ((o.textContent = this.placeholder), + o.classList.add("fi-select-input-placeholder"), + e.appendChild(o), + t === this.selectedDisplayVersion) + ) { + this.selectedDisplay.replaceChildren(e); + let s = this.container.querySelector( + ".fi-select-input-value-remove-btn", + ); + (s && s.remove(), + this.container.classList.remove( + "fi-select-input-ctn-clearable", + )); + } + return; + } + let i = await this.getLabelForSingleSelection(); + t === this.selectedDisplayVersion && + (this.addSingleSelectionDisplay(i, e), + t === this.selectedDisplayVersion && + this.selectedDisplay.replaceChildren(e)); + } + async getLabelsForMultipleSelection() { + let t = this.getSelectedOptionLabels(), + e = []; + if (Array.isArray(this.state)) { + for (let o of this.state) + if (!P(this.labelRepository[o])) { + if (P(t[o])) { + this.labelRepository[o] = t[o]; + continue; + } + e.push(o.toString()); + } + } + if ( + e.length > 0 && + P(this.initialOptionLabels) && + JSON.stringify(this.state) === JSON.stringify(this.initialState) + ) { + if (Array.isArray(this.initialOptionLabels)) + for (let o of this.initialOptionLabels) + P(o) && + o.value !== void 0 && + o.label !== void 0 && + e.includes(o.value) && + (this.labelRepository[o.value] = o.label); + } else if (e.length > 0 && this.getOptionLabelsUsing) + try { + let o = await this.getOptionLabelsUsing(); + for (let s of o) + P(s) && + s.value !== void 0 && + s.label !== void 0 && + (this.labelRepository[s.value] = s.label); + } catch (o) { + console.error("Error fetching option labels:", o); + } + let i = []; + if (Array.isArray(this.state)) + for (let o of this.state) + P(this.labelRepository[o]) + ? i.push(this.labelRepository[o]) + : P(t[o]) + ? i.push(t[o]) + : i.push(o); + return i; + } + createBadgeElement(t, e) { + let i = document.createElement("span"); + ((i.className = + "fi-badge fi-size-md fi-color fi-color-primary fi-text-color-600 dark:fi-text-color-200"), + P(t) && i.setAttribute("data-value", t)); + let o = document.createElement("span"); + o.className = "fi-badge-label-ctn"; + let s = document.createElement("span"); + ((s.className = "fi-badge-label"), + this.canOptionLabelsWrap && s.classList.add("fi-wrapped"), + this.isHtmlAllowed ? (s.innerHTML = e) : (s.textContent = e), + o.appendChild(s), + i.appendChild(o)); + let r = this.createRemoveButton(t, e); + return (i.appendChild(r), i); + } + createRemoveButton(t, e) { + let i = document.createElement("button"); + return ( + (i.type = "button"), + (i.className = "fi-badge-delete-btn"), + (i.innerHTML = + ''), + i.setAttribute( + "aria-label", + "Remove " + + (this.isHtmlAllowed ? e.replace(/<[^>]*>/g, "") : e), + ), + i.addEventListener("click", (o) => { + (o.stopPropagation(), P(t) && this.selectOption(t)); + }), + i.addEventListener("keydown", (o) => { + (o.key === " " || o.key === "Enter") && + (o.preventDefault(), + o.stopPropagation(), + P(t) && this.selectOption(t)); + }), + i + ); + } + addBadgesForSelectedOptions(t, e = this.selectedDisplay) { + let i = document.createElement("div"); + ((i.className = "fi-select-input-value-badges-ctn"), + t.forEach((o, s) => { + let r = Array.isArray(this.state) ? this.state[s] : null, + a = this.createBadgeElement(r, o); + i.appendChild(a); + }), + e.appendChild(i), + this.isReorderable && + (i.addEventListener("click", (o) => { + o.stopPropagation(); + }), + i.addEventListener("mousedown", (o) => { + o.stopPropagation(); + }), + new Ui(i, { + animation: 150, + onEnd: () => { + let o = []; + (i.querySelectorAll("[data-value]").forEach((s) => { + o.push(s.getAttribute("data-value")); + }), + (this.state = o), + this.onStateChange(this.state)); + }, + }))); + } + async getLabelForSingleSelection() { + let t = this.labelRepository[this.state]; + if ( + (bt(t) && (t = this.getSelectedOptionLabel(this.state)), + bt(t) && + P(this.initialOptionLabel) && + this.state === this.initialState) + ) + ((t = this.initialOptionLabel), + P(this.state) && (this.labelRepository[this.state] = t)); + else if (bt(t) && this.getOptionLabelUsing) + try { + ((t = await this.getOptionLabelUsing()), + P(t) && + P(this.state) && + (this.labelRepository[this.state] = t)); + } catch (e) { + (console.error("Error fetching option label:", e), + (t = this.state)); + } + else bt(t) && (t = this.state); + return t; + } + addSingleSelectionDisplay(t, e = this.selectedDisplay) { + let i = document.createElement("span"); + if ( + ((i.className = "fi-select-input-value-label"), + this.isHtmlAllowed ? (i.innerHTML = t) : (i.textContent = t), + e.appendChild(i), + !this.canSelectPlaceholder || + this.container.querySelector( + ".fi-select-input-value-remove-btn", + )) + ) + return; + let o = document.createElement("button"); + ((o.type = "button"), + (o.className = "fi-select-input-value-remove-btn"), + (o.innerHTML = + ''), + o.setAttribute("aria-label", "Clear selection"), + o.addEventListener("click", (s) => { + (s.stopPropagation(), this.selectOption("")); + }), + o.addEventListener("keydown", (s) => { + (s.key === " " || s.key === "Enter") && + (s.preventDefault(), + s.stopPropagation(), + this.selectOption("")); + }), + this.container.appendChild(o), + this.container.classList.add("fi-select-input-ctn-clearable")); + } + getSelectedOptionLabel(t) { + if (P(this.labelRepository[t])) return this.labelRepository[t]; + let e = ""; + for (let i of this.options) + if (i.options && Array.isArray(i.options)) { + for (let o of i.options) + if (o.value === t) { + ((e = o.label), (this.labelRepository[t] = e)); + break; + } + } else if (i.value === t) { + ((e = i.label), (this.labelRepository[t] = e)); + break; + } + return e; + } + setUbEventListeners() { + ((this.buttonClickListener = () => { + this.toggleDropdown(); + }), + (this.documentClickListener = (t) => { + !this.container.contains(t.target) && + this.isOpen && + this.closeDropdown(); + }), + (this.buttonKeydownListener = (t) => { + this.isDisabled || this.handleSelectButtonKeydown(t); + }), + (this.dropdownKeydownListener = (t) => { + this.isDisabled || + (this.isSearchable && + document.activeElement === this.searchInput && + !["Tab", "Escape"].includes(t.key)) || + this.handleDropdownKeydown(t); + }), + this.selectButton.addEventListener( + "click", + this.buttonClickListener, + ), + document.addEventListener("click", this.documentClickListener), + this.selectButton.addEventListener( + "keydown", + this.buttonKeydownListener, + ), + this.dropdown.addEventListener( + "keydown", + this.dropdownKeydownListener, + ), + !this.isMultiple && + this.livewireId && + this.statePath && + this.getOptionLabelUsing && + ((this.refreshOptionLabelListener = async (t) => { + if ( + t.detail.livewireId === this.livewireId && + t.detail.statePath === this.statePath && + P(this.state) + ) + try { + delete this.labelRepository[this.state]; + let e = await this.getOptionLabelUsing(); + P(e) && (this.labelRepository[this.state] = e); + let i = this.selectedDisplay.querySelector( + ".fi-select-input-value-label", + ); + (P(i) && + (this.isHtmlAllowed + ? (i.innerHTML = e) + : (i.textContent = e)), + this.updateOptionLabelInList(this.state, e)); + } catch (e) { + console.error("Error refreshing option label:", e); + } + }), + window.addEventListener( + "filament-forms::select.refreshSelectedOptionLabel", + this.refreshOptionLabelListener, + ))); + } + updateOptionLabelInList(t, e) { + this.labelRepository[t] = e; + let i = this.getVisibleOptions(); + for (let o of i) + if (o.getAttribute("data-value") === String(t)) { + if (((o.innerHTML = ""), this.isHtmlAllowed)) { + let s = document.createElement("span"); + ((s.innerHTML = e), o.appendChild(s)); + } else o.appendChild(document.createTextNode(e)); + break; + } + for (let o of this.options) + if (o.options && Array.isArray(o.options)) { + for (let s of o.options) + if (s.value === t) { + s.label = e; + break; + } + } else if (o.value === t) { + o.label = e; + break; + } + for (let o of this.originalOptions) + if (o.options && Array.isArray(o.options)) { + for (let s of o.options) + if (s.value === t) { + s.label = e; + break; + } + } else if (o.value === t) { + o.label = e; + break; + } + } + handleSelectButtonKeydown(t) { + switch (t.key) { + case "ArrowDown": + (t.preventDefault(), + t.stopPropagation(), + this.isOpen ? this.focusNextOption() : this.openDropdown()); + break; + case "ArrowUp": + (t.preventDefault(), + t.stopPropagation(), + this.isOpen + ? this.focusPreviousOption() + : this.openDropdown()); + break; + case " ": + if ((t.preventDefault(), this.isOpen)) { + if (this.selectedIndex >= 0) { + let e = this.getVisibleOptions()[this.selectedIndex]; + e && e.click(); + } + } else this.openDropdown(); + break; + case "Enter": + break; + case "Escape": + this.isOpen && (t.preventDefault(), this.closeDropdown()); + break; + case "Tab": + this.isOpen && this.closeDropdown(); + break; + default: + if ( + this.isSearchable && + !t.ctrlKey && + !t.metaKey && + !t.altKey && + typeof t.key == "string" && + t.key.length === 1 + ) { + t.preventDefault(); + let e = t.key; + (this.isOpen || this.openDropdown(), + this.searchInput && + (this.searchInput.focus(), + (this.searchInput.value = + (this.searchInput.value || "") + e), + this.searchInput.dispatchEvent( + new Event("input", { bubbles: !0 }), + ))); + } + break; + } + } + handleDropdownKeydown(t) { + switch (t.key) { + case "ArrowDown": + (t.preventDefault(), + t.stopPropagation(), + this.focusNextOption()); + break; + case "ArrowUp": + (t.preventDefault(), + t.stopPropagation(), + this.focusPreviousOption()); + break; + case " ": + if ((t.preventDefault(), this.selectedIndex >= 0)) { + let e = this.getVisibleOptions()[this.selectedIndex]; + e && e.click(); + } + break; + case "Enter": + if ((t.preventDefault(), this.selectedIndex >= 0)) { + let e = this.getVisibleOptions()[this.selectedIndex]; + e && e.click(); + } else { + let e = this.element.closest("form"); + e && e.submit(); + } + break; + case "Escape": + (t.preventDefault(), + this.closeDropdown(), + this.selectButton.focus()); + break; + case "Tab": + this.closeDropdown(); + break; + default: + if ( + this.isSearchable && + !t.ctrlKey && + !t.metaKey && + !t.altKey && + typeof t.key == "string" && + t.key.length === 1 + ) { + t.preventDefault(); + let e = t.key; + this.searchInput && + (this.searchInput.focus(), + (this.searchInput.value = + (this.searchInput.value || "") + e), + this.searchInput.dispatchEvent( + new Event("input", { bubbles: !0 }), + )); + } + break; + } + } + toggleDropdown() { + if (!this.isDisabled) { + if (this.isOpen) { + this.closeDropdown(); + return; + } + (this.isMultiple && + !this.isSearchable && + !this.hasAvailableOptions()) || + this.openDropdown(); + } + } + hasAvailableOptions() { + for (let t of this.options) + if (t.options && Array.isArray(t.options)) { + for (let e of t.options) + if ( + !Array.isArray(this.state) || + !this.state.includes(e.value) + ) + return !0; + } else if ( + !Array.isArray(this.state) || + !this.state.includes(t.value) + ) + return !0; + return !1; + } + async openDropdown() { + ((this.dropdown.style.display = "block"), + (this.dropdown.style.opacity = "0")); + let t = + this.selectButton.closest(".fi-fixed-positioning-context") !== + null && + this.selectButton.closest(".fi-absolute-positioning-context") === + null; + if ( + ((this.dropdown.style.position = t ? "fixed" : "absolute"), + (this.dropdown.style.width = `${this.selectButton.offsetWidth}px`), + this.selectButton.setAttribute("aria-expanded", "true"), + (this.isOpen = !0), + this.positionDropdown(), + this.resizeListener || + ((this.resizeListener = () => { + ((this.dropdown.style.width = `${this.selectButton.offsetWidth}px`), + this.positionDropdown()); + }), + window.addEventListener("resize", this.resizeListener)), + this.scrollListener || + ((this.scrollListener = () => this.positionDropdown()), + window.addEventListener("scroll", this.scrollListener, !0)), + (this.dropdown.style.opacity = "1"), + this.isSearchable && + this.searchInput && + ((this.searchInput.value = ""), + (this.searchQuery = ""), + this.hasDynamicOptions || + ((this.options = JSON.parse( + JSON.stringify(this.originalOptions), + )), + this.renderOptions())), + this.hasDynamicOptions && this.getOptionsUsing) + ) { + this.showLoadingState(!1); + try { + let e = await this.getOptionsUsing(), + i = Array.isArray(e) + ? e + : e && Array.isArray(e.options) + ? e.options + : []; + if ( + ((this.options = i), + (this.originalOptions = JSON.parse(JSON.stringify(i))), + this.populateLabelRepositoryFromOptions(i), + this.isSearchable && + this.searchInput && + ((this.searchInput.value && + this.searchInput.value.trim() !== "") || + (this.searchQuery && + this.searchQuery.trim() !== ""))) + ) { + let o = (this.searchInput.value || this.searchQuery || "") + .trim() + .toLowerCase(); + (this.hideLoadingState(), this.filterOptions(o)); + } else this.renderOptions(); + } catch (e) { + (console.error("Error fetching options:", e), + this.hideLoadingState()); + } + } else + (!this.hasInitialNoOptionsMessage || this.searchQuery) && + this.hideLoadingState(); + if (this.isSearchable && this.searchInput) this.searchInput.focus(); + else { + this.selectedIndex = -1; + let e = this.getVisibleOptions(); + if (this.isMultiple) { + if (Array.isArray(this.state) && this.state.length > 0) { + for (let i = 0; i < e.length; i++) + if ( + this.state.includes(e[i].getAttribute("data-value")) + ) { + this.selectedIndex = i; + break; + } + } + } else + for (let i = 0; i < e.length; i++) + if (e[i].getAttribute("data-value") === this.state) { + this.selectedIndex = i; + break; + } + (this.selectedIndex === -1 && + e.length > 0 && + (this.selectedIndex = 0), + this.selectedIndex >= 0 && + (e[this.selectedIndex].classList.add("fi-selected"), + e[this.selectedIndex].focus())); + } + } + positionDropdown() { + let t = this.position === "top" ? "top-start" : "bottom-start", + e = [wi(4), Si({ padding: 5 })]; + this.position !== "top" && this.position !== "bottom" && e.push(xi()); + let i = + this.selectButton.closest(".fi-fixed-positioning-context") !== + null && + this.selectButton.closest(".fi-absolute-positioning-context") === + null; + Oi(this.selectButton, this.dropdown, { + placement: t, + middleware: e, + strategy: i ? "fixed" : "absolute", + }).then(({ x: o, y: s }) => { + Object.assign(this.dropdown.style, { + left: `${o}px`, + top: `${s}px`, + }); + }); + } + deferPositionDropdown() { + this.isOpen && + (this.positioningRequestAnimationFrame && + (cancelAnimationFrame(this.positioningRequestAnimationFrame), + (this.positioningRequestAnimationFrame = null)), + (this.positioningRequestAnimationFrame = requestAnimationFrame( + () => { + (this.positionDropdown(), + (this.positioningRequestAnimationFrame = null)); + }, + ))); + } + closeDropdown() { + ((this.dropdown.style.display = "none"), + this.selectButton.setAttribute("aria-expanded", "false"), + (this.isOpen = !1), + this.searchTimeout && + (clearTimeout(this.searchTimeout), (this.searchTimeout = null)), + this.activeSearchId++, + (this.isSearching = !1), + this.hideLoadingState(), + this.resizeListener && + (window.removeEventListener("resize", this.resizeListener), + (this.resizeListener = null)), + this.scrollListener && + (window.removeEventListener("scroll", this.scrollListener, !0), + (this.scrollListener = null)), + this.getVisibleOptions().forEach((e) => { + e.classList.remove("fi-selected"); + }), + this.dropdown.removeAttribute("aria-activedescendant")); + } + focusNextOption() { + let t = this.getVisibleOptions(); + if (t.length !== 0) { + if ( + (this.selectedIndex >= 0 && + this.selectedIndex < t.length && + t[this.selectedIndex].classList.remove("fi-selected"), + this.selectedIndex === t.length - 1 && + this.isSearchable && + this.searchInput) + ) { + ((this.selectedIndex = -1), + this.searchInput.focus(), + this.dropdown.removeAttribute("aria-activedescendant")); + return; + } + ((this.selectedIndex = (this.selectedIndex + 1) % t.length), + t[this.selectedIndex].classList.add("fi-selected"), + t[this.selectedIndex].focus(), + t[this.selectedIndex].id && + this.dropdown.setAttribute( + "aria-activedescendant", + t[this.selectedIndex].id, + ), + this.scrollOptionIntoView(t[this.selectedIndex])); + } + } + focusPreviousOption() { + let t = this.getVisibleOptions(); + if (t.length !== 0) { + if ( + (this.selectedIndex >= 0 && + this.selectedIndex < t.length && + t[this.selectedIndex].classList.remove("fi-selected"), + (this.selectedIndex === 0 || this.selectedIndex === -1) && + this.isSearchable && + this.searchInput) + ) { + ((this.selectedIndex = -1), + this.searchInput.focus(), + this.dropdown.removeAttribute("aria-activedescendant")); + return; + } + ((this.selectedIndex = + (this.selectedIndex - 1 + t.length) % t.length), + t[this.selectedIndex].classList.add("fi-selected"), + t[this.selectedIndex].focus(), + t[this.selectedIndex].id && + this.dropdown.setAttribute( + "aria-activedescendant", + t[this.selectedIndex].id, + ), + this.scrollOptionIntoView(t[this.selectedIndex])); + } + } + scrollOptionIntoView(t) { + if (!t) return; + let e = this.dropdown.getBoundingClientRect(), + i = t.getBoundingClientRect(); + i.bottom > e.bottom + ? (this.dropdown.scrollTop += i.bottom - e.bottom) + : i.top < e.top && (this.dropdown.scrollTop -= e.top - i.top); + } + getVisibleOptions() { + let t = []; + this.optionsList.classList.contains("fi-dropdown-list") + ? (t = Array.from( + this.optionsList.querySelectorAll( + ':scope > li[role="option"]', + ), + )) + : (t = Array.from( + this.optionsList.querySelectorAll( + ':scope > ul.fi-dropdown-list > li[role="option"]', + ), + )); + let e = Array.from( + this.optionsList.querySelectorAll( + 'li.fi-select-input-option-group > ul > li[role="option"]', + ), + ); + return [...t, ...e]; + } + getSelectedOptionLabels() { + if (!Array.isArray(this.state) || this.state.length === 0) return {}; + let t = {}; + for (let e of this.state) { + let i = !1; + for (let o of this.options) + if (o.options && Array.isArray(o.options)) { + for (let s of o.options) + if (s.value === e) { + ((t[e] = s.label), (i = !0)); + break; + } + if (i) break; + } else if (o.value === e) { + ((t[e] = o.label), (i = !0)); + break; + } + } + return t; + } + handleSearch(t) { + let e = t.target.value.trim(); + if ( + ((this.searchQuery = e), + this.searchTimeout && clearTimeout(this.searchTimeout), + e === "") + ) { + ((this.options = JSON.parse(JSON.stringify(this.originalOptions))), + this.renderOptions()); + return; + } + if ( + !this.getSearchResultsUsing || + typeof this.getSearchResultsUsing != "function" || + !this.hasDynamicSearchResults + ) { + this.filterOptions(e); + return; + } + this.searchTimeout = setTimeout(async () => { + this.searchTimeout = null; + let i = ++this.activeSearchId; + this.isSearching = !0; + try { + this.showLoadingState(!0); + let o = await this.getSearchResultsUsing(e); + if (i !== this.activeSearchId || !this.isOpen) return; + let s = Array.isArray(o) + ? o + : o && Array.isArray(o.options) + ? o.options + : []; + ((this.options = s), + this.populateLabelRepositoryFromOptions(s), + this.hideLoadingState(), + this.renderOptions(), + this.isOpen && this.deferPositionDropdown(), + this.options.length === 0 && this.showNoResultsMessage()); + } catch (o) { + i === this.activeSearchId && + (console.error("Error fetching search results:", o), + this.hideLoadingState(), + (this.options = JSON.parse( + JSON.stringify(this.originalOptions), + )), + this.renderOptions()); + } finally { + i === this.activeSearchId && (this.isSearching = !1); + } + }, this.searchDebounce); + } + showLoadingState(t = !1) { + (this.optionsList.parentNode === this.dropdown && + this.dropdown.removeChild(this.optionsList), + this.hideLoadingState()); + let e = document.createElement("div"); + ((e.className = "fi-select-input-message"), + (e.textContent = t ? this.searchingMessage : this.loadingMessage), + this.dropdown.appendChild(e), + this.isOpen && this.deferPositionDropdown()); + } + hideLoadingState() { + let t = this.dropdown.querySelector(".fi-select-input-message"); + t && t.remove(); + } + showNoOptionsMessage() { + (this.optionsList.parentNode === this.dropdown && + this.dropdown.removeChild(this.optionsList), + this.hideLoadingState()); + let t = document.createElement("div"); + ((t.className = "fi-select-input-message"), + (t.textContent = this.noOptionsMessage), + this.dropdown.appendChild(t), + this.isOpen && this.deferPositionDropdown()); + } + showNoResultsMessage() { + (this.optionsList.parentNode === this.dropdown && + this.dropdown.removeChild(this.optionsList), + this.hideLoadingState()); + let t = document.createElement("div"); + ((t.className = "fi-select-input-message"), + (t.textContent = this.noSearchResultsMessage), + this.dropdown.appendChild(t), + this.isOpen && this.deferPositionDropdown()); + } + filterOptions(t) { + let e = this.searchableOptionFields.includes("label"), + i = this.searchableOptionFields.includes("value"); + t = t.toLowerCase(); + let o = []; + for (let s of this.originalOptions) + if (s.options && Array.isArray(s.options)) { + let r = s.options.filter( + (a) => + (e && a.label.toLowerCase().includes(t)) || + (i && String(a.value).toLowerCase().includes(t)), + ); + r.length > 0 && o.push({ label: s.label, options: r }); + } else + ((e && s.label.toLowerCase().includes(t)) || + (i && String(s.value).toLowerCase().includes(t))) && + o.push(s); + ((this.options = o), + this.renderOptions(), + this.options.length === 0 && this.showNoResultsMessage(), + this.isOpen && this.positionDropdown()); + } + selectOption(t) { + if (this.isDisabled) return; + if (!this.isMultiple) { + ((this.state = t), + this.updateSelectedDisplay(), + this.renderOptions(), + this.closeDropdown(), + this.selectButton.focus(), + this.onStateChange(this.state)); + return; + } + let e = Array.isArray(this.state) ? [...this.state] : []; + if (e.includes(t)) { + let o = this.selectedDisplay.querySelector(`[data-value="${t}"]`); + if (P(o)) { + let s = o.parentElement; + P(s) && s.children.length === 1 + ? ((e = e.filter((r) => r !== t)), + (this.state = e), + this.updateSelectedDisplay()) + : (o.remove(), + (e = e.filter((r) => r !== t)), + (this.state = e)); + } else + ((e = e.filter((s) => s !== t)), + (this.state = e), + this.updateSelectedDisplay()); + (this.renderOptions(), + this.isOpen && this.deferPositionDropdown(), + this.maintainFocusInMultipleMode(), + this.onStateChange(this.state)); + return; + } + if (this.maxItems && e.length >= this.maxItems) { + this.maxItemsMessage && alert(this.maxItemsMessage); + return; + } + (e.push(t), (this.state = e)); + let i = this.selectedDisplay.querySelector( + ".fi-select-input-value-badges-ctn", + ); + (bt(i) ? this.updateSelectedDisplay() : this.addSingleBadge(t, i), + this.renderOptions(), + this.isOpen && this.deferPositionDropdown(), + this.maintainFocusInMultipleMode(), + this.onStateChange(this.state)); + } + async addSingleBadge(t, e) { + let i = this.labelRepository[t]; + if ( + (bt(i) && + ((i = this.getSelectedOptionLabel(t)), + P(i) && (this.labelRepository[t] = i)), + bt(i) && this.getOptionLabelsUsing) + ) + try { + let s = await this.getOptionLabelsUsing(); + for (let r of s) + if (P(r) && r.value === t && r.label !== void 0) { + ((i = r.label), (this.labelRepository[t] = i)); + break; + } + } catch (s) { + console.error("Error fetching option label:", s); + } + bt(i) && (i = t); + let o = this.createBadgeElement(t, i); + e.appendChild(o); + } + maintainFocusInMultipleMode() { + if (this.isSearchable && this.searchInput) { + this.searchInput.focus(); + return; + } + let t = this.getVisibleOptions(); + if (t.length !== 0) { + if ( + ((this.selectedIndex = -1), + Array.isArray(this.state) && this.state.length > 0) + ) { + for (let e = 0; e < t.length; e++) + if (this.state.includes(t[e].getAttribute("data-value"))) { + this.selectedIndex = e; + break; + } + } + (this.selectedIndex === -1 && (this.selectedIndex = 0), + t[this.selectedIndex].classList.add("fi-selected"), + t[this.selectedIndex].focus()); + } + } + disable() { + this.isDisabled || + ((this.isDisabled = !0), + this.applyDisabledState(), + this.isOpen && this.closeDropdown()); + } + enable() { + this.isDisabled && ((this.isDisabled = !1), this.applyDisabledState()); + } + applyDisabledState() { + if (this.isDisabled) { + if ( + (this.selectButton.setAttribute("disabled", "disabled"), + this.selectButton.setAttribute("aria-disabled", "true"), + this.selectButton.classList.add("fi-disabled"), + this.isMultiple && + this.container + .querySelectorAll(".fi-select-input-badge-remove") + .forEach((e) => { + (e.setAttribute("disabled", "disabled"), + e.classList.add("fi-disabled")); + }), + !this.isMultiple && this.canSelectPlaceholder) + ) { + let t = this.container.querySelector( + ".fi-select-input-value-remove-btn", + ); + t && + (t.setAttribute("disabled", "disabled"), + t.classList.add("fi-disabled")); + } + this.isSearchable && + this.searchInput && + (this.searchInput.setAttribute("disabled", "disabled"), + this.searchInput.classList.add("fi-disabled")); + } else { + if ( + (this.selectButton.removeAttribute("disabled"), + this.selectButton.removeAttribute("aria-disabled"), + this.selectButton.classList.remove("fi-disabled"), + this.isMultiple && + this.container + .querySelectorAll(".fi-select-input-badge-remove") + .forEach((e) => { + (e.removeAttribute("disabled"), + e.classList.remove("fi-disabled")); + }), + !this.isMultiple && this.canSelectPlaceholder) + ) { + let t = this.container.querySelector( + ".fi-select-input-value-remove-btn", + ); + t && + (t.removeAttribute("disabled"), + t.classList.add("fi-disabled")); + } + this.isSearchable && + this.searchInput && + (this.searchInput.removeAttribute("disabled"), + this.searchInput.classList.remove("fi-disabled")); + } + } + destroy() { + (this.selectButton && + this.buttonClickListener && + this.selectButton.removeEventListener( + "click", + this.buttonClickListener, + ), + this.documentClickListener && + document.removeEventListener( + "click", + this.documentClickListener, + ), + this.selectButton && + this.buttonKeydownListener && + this.selectButton.removeEventListener( + "keydown", + this.buttonKeydownListener, + ), + this.dropdown && + this.dropdownKeydownListener && + this.dropdown.removeEventListener( + "keydown", + this.dropdownKeydownListener, + ), + this.resizeListener && + (window.removeEventListener("resize", this.resizeListener), + (this.resizeListener = null)), + this.scrollListener && + (window.removeEventListener("scroll", this.scrollListener, !0), + (this.scrollListener = null)), + this.refreshOptionLabelListener && + window.removeEventListener( + "filament-forms::select.refreshSelectedOptionLabel", + this.refreshOptionLabelListener, + ), + this.isOpen && this.closeDropdown(), + this.searchTimeout && + (clearTimeout(this.searchTimeout), (this.searchTimeout = null)), + this.container && this.container.remove()); + } +}; +function Qn({ + canOptionLabelsWrap: n, + canSelectPlaceholder: t, + getOptionLabelUsing: e, + getOptionLabelsUsing: i, + getOptionsUsing: o, + getSearchResultsUsing: s, + hasDynamicOptions: r, + hasDynamicSearchResults: a, + hasInitialNoOptionsMessage: l, + initialOptionLabel: c, + initialOptionLabels: f, + initialState: d, + isAutofocused: p, + isDisabled: u, + isHtmlAllowed: g, + isMultiple: m, + isReorderable: S, + isSearchable: E, + livewireId: w, + loadingMessage: D, + maxItems: A, + maxItemsMessage: C, + noOptionsMessage: F, + noSearchResultsMessage: q, + options: J, + optionsLimit: _, + placeholder: V, + position: W, + searchDebounce: tt, + searchingMessage: z, + searchPrompt: k, + searchableOptionFields: Y, + state: B, + statePath: X, +}) { + return { + select: null, + state: B, + init() { + ((this.select = new Ee({ + canOptionLabelsWrap: n, + canSelectPlaceholder: t, + element: this.$refs.select, + getOptionLabelUsing: e, + getOptionLabelsUsing: i, + getOptionsUsing: o, + getSearchResultsUsing: s, + hasDynamicOptions: r, + hasDynamicSearchResults: a, + hasInitialNoOptionsMessage: l, + initialOptionLabel: c, + initialOptionLabels: f, + initialState: d, + isAutofocused: p, + isDisabled: u, + isHtmlAllowed: g, + isMultiple: m, + isReorderable: S, + isSearchable: E, + livewireId: w, + loadingMessage: D, + maxItems: A, + maxItemsMessage: C, + noOptionsMessage: F, + noSearchResultsMessage: q, + onStateChange: (L) => { + this.state = L; + }, + options: J, + optionsLimit: _, + placeholder: V, + position: W, + searchableOptionFields: Y, + searchDebounce: tt, + searchingMessage: z, + searchPrompt: k, + state: this.state, + statePath: X, + })), + this.$watch("state", (L) => { + this.$nextTick(() => { + this.select && + this.select.state !== L && + ((this.select.state = L), + this.select.updateSelectedDisplay(), + this.select.renderOptions()); + }); + })); + }, + destroy() { + this.select && (this.select.destroy(), (this.select = null)); + }, + }; +} +export { Qn as default }; /*! Bundled license information: sortablejs/modular/sortable.esm.js: diff --git a/public/js/filament/support/support.js b/public/js/filament/support/support.js index 1847b592..467a9ba8 100644 --- a/public/js/filament/support/support.js +++ b/public/js/filament/support/support.js @@ -1,28 +1,9061 @@ -(()=>{var qo=Object.create;var Ti=Object.defineProperty;var Go=Object.getOwnPropertyDescriptor;var Ko=Object.getOwnPropertyNames;var Jo=Object.getPrototypeOf,Qo=Object.prototype.hasOwnProperty;var Kr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Zo=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ko(t))!Qo.call(e,i)&&i!==r&&Ti(e,i,{get:()=>t[i],enumerable:!(n=Go(t,i))||n.enumerable});return e};var ea=(e,t,r)=>(r=e!=null?qo(Jo(e)):{},Zo(t||!e||!e.__esModule?Ti(r,"default",{value:e,enumerable:!0}):r,e));var uo=Kr(()=>{});var po=Kr(()=>{});var ho=Kr((Hs,yr)=>{(function(){"use strict";var e="input is invalid type",t="finalize already called",r=typeof window=="object",n=r?window:{};n.JS_MD5_NO_WINDOW&&(r=!1);var i=!r&&typeof self=="object",o=!n.JS_MD5_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;o?n=global:i&&(n=self);var a=!n.JS_MD5_NO_COMMON_JS&&typeof yr=="object"&&yr.exports,c=typeof define=="function"&&define.amd,f=!n.JS_MD5_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",u="0123456789abcdef".split(""),y=[128,32768,8388608,-2147483648],m=[0,8,16,24],O=["hex","array","digest","buffer","arrayBuffer","base64"],S="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),x=[],M;if(f){var I=new ArrayBuffer(68);M=new Uint8Array(I),x=new Uint32Array(I)}var $=Array.isArray;(n.JS_MD5_NO_NODE_JS||!$)&&($=function(l){return Object.prototype.toString.call(l)==="[object Array]"});var A=ArrayBuffer.isView;f&&(n.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW||!A)&&(A=function(l){return typeof l=="object"&&l.buffer&&l.buffer.constructor===ArrayBuffer});var N=function(l){var h=typeof l;if(h==="string")return[l,!0];if(h!=="object"||l===null)throw new Error(e);if(f&&l.constructor===ArrayBuffer)return[new Uint8Array(l),!1];if(!$(l)&&!A(l))throw new Error(e);return[l,!1]},Y=function(l){return function(h){return new X(!0).update(h)[l]()}},ne=function(){var l=Y("hex");o&&(l=J(l)),l.create=function(){return new X},l.update=function(p){return l.create().update(p)};for(var h=0;h>>6,ze[P++]=128|p&63):p<55296||p>=57344?(ze[P++]=224|p>>>12,ze[P++]=128|p>>>6&63,ze[P++]=128|p&63):(p=65536+((p&1023)<<10|l.charCodeAt(++j)&1023),ze[P++]=240|p>>>18,ze[P++]=128|p>>>12&63,ze[P++]=128|p>>>6&63,ze[P++]=128|p&63);else for(P=this.start;j>>2]|=p<>>2]|=(192|p>>>6)<>>2]|=(128|p&63)<=57344?(Z[P>>>2]|=(224|p>>>12)<>>2]|=(128|p>>>6&63)<>>2]|=(128|p&63)<>>2]|=(240|p>>>18)<>>2]|=(128|p>>>12&63)<>>2]|=(128|p>>>6&63)<>>2]|=(128|p&63)<>>2]|=l[j]<=64?(this.start=P-64,this.hash(),this.hashed=!0):this.start=P}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this},X.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var l=this.blocks,h=this.lastByteIndex;l[h>>>2]|=y[h&3],h>=56&&(this.hashed||this.hash(),l[0]=l[16],l[16]=l[1]=l[2]=l[3]=l[4]=l[5]=l[6]=l[7]=l[8]=l[9]=l[10]=l[11]=l[12]=l[13]=l[14]=l[15]=0),l[14]=this.bytes<<3,l[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},X.prototype.hash=function(){var l,h,v,p,j,P,R=this.blocks;this.first?(l=R[0]-680876937,l=(l<<7|l>>>25)-271733879<<0,p=(-1732584194^l&2004318071)+R[1]-117830708,p=(p<<12|p>>>20)+l<<0,v=(-271733879^p&(l^-271733879))+R[2]-1126478375,v=(v<<17|v>>>15)+p<<0,h=(l^v&(p^l))+R[3]-1316259209,h=(h<<22|h>>>10)+v<<0):(l=this.h0,h=this.h1,v=this.h2,p=this.h3,l+=(p^h&(v^p))+R[0]-680876936,l=(l<<7|l>>>25)+h<<0,p+=(v^l&(h^v))+R[1]-389564586,p=(p<<12|p>>>20)+l<<0,v+=(h^p&(l^h))+R[2]+606105819,v=(v<<17|v>>>15)+p<<0,h+=(l^v&(p^l))+R[3]-1044525330,h=(h<<22|h>>>10)+v<<0),l+=(p^h&(v^p))+R[4]-176418897,l=(l<<7|l>>>25)+h<<0,p+=(v^l&(h^v))+R[5]+1200080426,p=(p<<12|p>>>20)+l<<0,v+=(h^p&(l^h))+R[6]-1473231341,v=(v<<17|v>>>15)+p<<0,h+=(l^v&(p^l))+R[7]-45705983,h=(h<<22|h>>>10)+v<<0,l+=(p^h&(v^p))+R[8]+1770035416,l=(l<<7|l>>>25)+h<<0,p+=(v^l&(h^v))+R[9]-1958414417,p=(p<<12|p>>>20)+l<<0,v+=(h^p&(l^h))+R[10]-42063,v=(v<<17|v>>>15)+p<<0,h+=(l^v&(p^l))+R[11]-1990404162,h=(h<<22|h>>>10)+v<<0,l+=(p^h&(v^p))+R[12]+1804603682,l=(l<<7|l>>>25)+h<<0,p+=(v^l&(h^v))+R[13]-40341101,p=(p<<12|p>>>20)+l<<0,v+=(h^p&(l^h))+R[14]-1502002290,v=(v<<17|v>>>15)+p<<0,h+=(l^v&(p^l))+R[15]+1236535329,h=(h<<22|h>>>10)+v<<0,l+=(v^p&(h^v))+R[1]-165796510,l=(l<<5|l>>>27)+h<<0,p+=(h^v&(l^h))+R[6]-1069501632,p=(p<<9|p>>>23)+l<<0,v+=(l^h&(p^l))+R[11]+643717713,v=(v<<14|v>>>18)+p<<0,h+=(p^l&(v^p))+R[0]-373897302,h=(h<<20|h>>>12)+v<<0,l+=(v^p&(h^v))+R[5]-701558691,l=(l<<5|l>>>27)+h<<0,p+=(h^v&(l^h))+R[10]+38016083,p=(p<<9|p>>>23)+l<<0,v+=(l^h&(p^l))+R[15]-660478335,v=(v<<14|v>>>18)+p<<0,h+=(p^l&(v^p))+R[4]-405537848,h=(h<<20|h>>>12)+v<<0,l+=(v^p&(h^v))+R[9]+568446438,l=(l<<5|l>>>27)+h<<0,p+=(h^v&(l^h))+R[14]-1019803690,p=(p<<9|p>>>23)+l<<0,v+=(l^h&(p^l))+R[3]-187363961,v=(v<<14|v>>>18)+p<<0,h+=(p^l&(v^p))+R[8]+1163531501,h=(h<<20|h>>>12)+v<<0,l+=(v^p&(h^v))+R[13]-1444681467,l=(l<<5|l>>>27)+h<<0,p+=(h^v&(l^h))+R[2]-51403784,p=(p<<9|p>>>23)+l<<0,v+=(l^h&(p^l))+R[7]+1735328473,v=(v<<14|v>>>18)+p<<0,h+=(p^l&(v^p))+R[12]-1926607734,h=(h<<20|h>>>12)+v<<0,j=h^v,l+=(j^p)+R[5]-378558,l=(l<<4|l>>>28)+h<<0,p+=(j^l)+R[8]-2022574463,p=(p<<11|p>>>21)+l<<0,P=p^l,v+=(P^h)+R[11]+1839030562,v=(v<<16|v>>>16)+p<<0,h+=(P^v)+R[14]-35309556,h=(h<<23|h>>>9)+v<<0,j=h^v,l+=(j^p)+R[1]-1530992060,l=(l<<4|l>>>28)+h<<0,p+=(j^l)+R[4]+1272893353,p=(p<<11|p>>>21)+l<<0,P=p^l,v+=(P^h)+R[7]-155497632,v=(v<<16|v>>>16)+p<<0,h+=(P^v)+R[10]-1094730640,h=(h<<23|h>>>9)+v<<0,j=h^v,l+=(j^p)+R[13]+681279174,l=(l<<4|l>>>28)+h<<0,p+=(j^l)+R[0]-358537222,p=(p<<11|p>>>21)+l<<0,P=p^l,v+=(P^h)+R[3]-722521979,v=(v<<16|v>>>16)+p<<0,h+=(P^v)+R[6]+76029189,h=(h<<23|h>>>9)+v<<0,j=h^v,l+=(j^p)+R[9]-640364487,l=(l<<4|l>>>28)+h<<0,p+=(j^l)+R[12]-421815835,p=(p<<11|p>>>21)+l<<0,P=p^l,v+=(P^h)+R[15]+530742520,v=(v<<16|v>>>16)+p<<0,h+=(P^v)+R[2]-995338651,h=(h<<23|h>>>9)+v<<0,l+=(v^(h|~p))+R[0]-198630844,l=(l<<6|l>>>26)+h<<0,p+=(h^(l|~v))+R[7]+1126891415,p=(p<<10|p>>>22)+l<<0,v+=(l^(p|~h))+R[14]-1416354905,v=(v<<15|v>>>17)+p<<0,h+=(p^(v|~l))+R[5]-57434055,h=(h<<21|h>>>11)+v<<0,l+=(v^(h|~p))+R[12]+1700485571,l=(l<<6|l>>>26)+h<<0,p+=(h^(l|~v))+R[3]-1894986606,p=(p<<10|p>>>22)+l<<0,v+=(l^(p|~h))+R[10]-1051523,v=(v<<15|v>>>17)+p<<0,h+=(p^(v|~l))+R[1]-2054922799,h=(h<<21|h>>>11)+v<<0,l+=(v^(h|~p))+R[8]+1873313359,l=(l<<6|l>>>26)+h<<0,p+=(h^(l|~v))+R[15]-30611744,p=(p<<10|p>>>22)+l<<0,v+=(l^(p|~h))+R[6]-1560198380,v=(v<<15|v>>>17)+p<<0,h+=(p^(v|~l))+R[13]+1309151649,h=(h<<21|h>>>11)+v<<0,l+=(v^(h|~p))+R[4]-145523070,l=(l<<6|l>>>26)+h<<0,p+=(h^(l|~v))+R[11]-1120210379,p=(p<<10|p>>>22)+l<<0,v+=(l^(p|~h))+R[2]+718787259,v=(v<<15|v>>>17)+p<<0,h+=(p^(v|~l))+R[9]-343485551,h=(h<<21|h>>>11)+v<<0,this.first?(this.h0=l+1732584193<<0,this.h1=h-271733879<<0,this.h2=v-1732584194<<0,this.h3=p+271733878<<0,this.first=!1):(this.h0=this.h0+l<<0,this.h1=this.h1+h<<0,this.h2=this.h2+v<<0,this.h3=this.h3+p<<0)},X.prototype.hex=function(){this.finalize();var l=this.h0,h=this.h1,v=this.h2,p=this.h3;return u[l>>>4&15]+u[l&15]+u[l>>>12&15]+u[l>>>8&15]+u[l>>>20&15]+u[l>>>16&15]+u[l>>>28&15]+u[l>>>24&15]+u[h>>>4&15]+u[h&15]+u[h>>>12&15]+u[h>>>8&15]+u[h>>>20&15]+u[h>>>16&15]+u[h>>>28&15]+u[h>>>24&15]+u[v>>>4&15]+u[v&15]+u[v>>>12&15]+u[v>>>8&15]+u[v>>>20&15]+u[v>>>16&15]+u[v>>>28&15]+u[v>>>24&15]+u[p>>>4&15]+u[p&15]+u[p>>>12&15]+u[p>>>8&15]+u[p>>>20&15]+u[p>>>16&15]+u[p>>>28&15]+u[p>>>24&15]},X.prototype.toString=X.prototype.hex,X.prototype.digest=function(){this.finalize();var l=this.h0,h=this.h1,v=this.h2,p=this.h3;return[l&255,l>>>8&255,l>>>16&255,l>>>24&255,h&255,h>>>8&255,h>>>16&255,h>>>24&255,v&255,v>>>8&255,v>>>16&255,v>>>24&255,p&255,p>>>8&255,p>>>16&255,p>>>24&255]},X.prototype.array=X.prototype.digest,X.prototype.arrayBuffer=function(){this.finalize();var l=new ArrayBuffer(16),h=new Uint32Array(l);return h[0]=this.h0,h[1]=this.h1,h[2]=this.h2,h[3]=this.h3,l},X.prototype.buffer=X.prototype.arrayBuffer,X.prototype.base64=function(){for(var l,h,v,p="",j=this.array(),P=0;P<15;)l=j[P++],h=j[P++],v=j[P++],p+=S[l>>>2]+S[(l<<4|h>>>4)&63]+S[(h<<2|v>>>6)&63]+S[v&63];return l=j[P],p+=S[l>>>2]+S[l<<4&63]+"==",p};function Q(l,h){var v,p=N(l);if(l=p[0],p[1]){var j=[],P=l.length,R=0,Z;for(v=0;v>>6,j[R++]=128|Z&63):Z<55296||Z>=57344?(j[R++]=224|Z>>>12,j[R++]=128|Z>>>6&63,j[R++]=128|Z&63):(Z=65536+((Z&1023)<<10|l.charCodeAt(++v)&1023),j[R++]=240|Z>>>18,j[R++]=128|Z>>>12&63,j[R++]=128|Z>>>6&63,j[R++]=128|Z&63);l=j}l.length>64&&(l=new X(!0).update(l).array());var ze=[],Rt=[];for(v=0;v<64;++v){var Ut=l[v]||0;ze[v]=92^Ut,Rt[v]=54^Ut}X.call(this,h),this.update(Rt),this.oKeyPad=ze,this.inner=!0,this.sharedMemory=h}Q.prototype=new X,Q.prototype.finalize=function(){if(X.prototype.finalize.call(this),this.inner){this.inner=!1;var l=this.array();X.call(this,this.sharedMemory),this.update(this.oKeyPad),this.update(l),X.prototype.finalize.call(this)}};var me=ne();me.md5=me,me.md5.hmac=de(),a?yr.exports=me:(n.md5=me,c&&define(function(){return me}))})()});var Hi=["top","right","bottom","left"],Pi=["start","end"],Mi=Hi.reduce((e,t)=>e.concat(t,t+"-"+Pi[0],t+"-"+Pi[1]),[]),Et=Math.min,tt=Math.max,hr=Math.round,pr=Math.floor,nn=e=>({x:e,y:e}),ta={left:"right",right:"left",bottom:"top",top:"bottom"},na={start:"end",end:"start"};function Jr(e,t,r){return tt(e,Et(t,r))}function jt(e,t){return typeof e=="function"?e(t):e}function pt(e){return e.split("-")[0]}function xt(e){return e.split("-")[1]}function $i(e){return e==="x"?"y":"x"}function Qr(e){return e==="y"?"height":"width"}function Pn(e){return["top","bottom"].includes(pt(e))?"y":"x"}function Zr(e){return $i(Pn(e))}function Wi(e,t,r){r===void 0&&(r=!1);let n=xt(e),i=Zr(e),o=Qr(i),a=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=mr(a)),[a,mr(a)]}function ra(e){let t=mr(e);return[vr(e),t,vr(t)]}function vr(e){return e.replace(/start|end/g,t=>na[t])}function ia(e,t,r){let n=["left","right"],i=["right","left"],o=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return r?t?i:n:t?n:i;case"left":case"right":return t?o:a;default:return[]}}function oa(e,t,r,n){let i=xt(e),o=ia(pt(e),r==="start",n);return i&&(o=o.map(a=>a+"-"+i),t&&(o=o.concat(o.map(vr)))),o}function mr(e){return e.replace(/left|right|bottom|top/g,t=>ta[t])}function aa(e){return{top:0,right:0,bottom:0,left:0,...e}}function ei(e){return typeof e!="number"?aa(e):{top:e,right:e,bottom:e,left:e}}function Dn(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function Ri(e,t,r){let{reference:n,floating:i}=e,o=Pn(t),a=Zr(t),c=Qr(a),f=pt(t),u=o==="y",y=n.x+n.width/2-i.width/2,m=n.y+n.height/2-i.height/2,O=n[c]/2-i[c]/2,S;switch(f){case"top":S={x:y,y:n.y-i.height};break;case"bottom":S={x:y,y:n.y+n.height};break;case"right":S={x:n.x+n.width,y:m};break;case"left":S={x:n.x-i.width,y:m};break;default:S={x:n.x,y:n.y}}switch(xt(t)){case"start":S[a]-=O*(r&&u?-1:1);break;case"end":S[a]+=O*(r&&u?-1:1);break}return S}var sa=async(e,t,r)=>{let{placement:n="bottom",strategy:i="absolute",middleware:o=[],platform:a}=r,c=o.filter(Boolean),f=await(a.isRTL==null?void 0:a.isRTL(t)),u=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:y,y:m}=Ri(u,n,f),O=n,S={},x=0;for(let M=0;M({name:"arrow",options:e,async fn(t){let{x:r,y:n,placement:i,rects:o,platform:a,elements:c,middlewareData:f}=t,{element:u,padding:y=0}=jt(e,t)||{};if(u==null)return{};let m=ei(y),O={x:r,y:n},S=Zr(i),x=Qr(S),M=await a.getDimensions(u),I=S==="y",$=I?"top":"left",A=I?"bottom":"right",N=I?"clientHeight":"clientWidth",Y=o.reference[x]+o.reference[S]-O[S]-o.floating[x],ne=O[S]-o.reference[S],J=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u)),V=J?J[N]:0;(!V||!await(a.isElement==null?void 0:a.isElement(J)))&&(V=c.floating[N]||o.floating[x]);let de=Y/2-ne/2,X=V/2-M[x]/2-1,Q=Et(m[$],X),me=Et(m[A],X),l=Q,h=V-M[x]-me,v=V/2-M[x]/2+de,p=Jr(l,v,h),j=!f.arrow&&xt(i)!=null&&v!==p&&o.reference[x]/2-(vxt(i)===e),...r.filter(i=>xt(i)!==e)]:r.filter(i=>pt(i)===i)).filter(i=>e?xt(i)===e||(t?vr(i)!==i:!1):!0)}var fa=function(e){return e===void 0&&(e={}),{name:"autoPlacement",options:e,async fn(t){var r,n,i;let{rects:o,middlewareData:a,placement:c,platform:f,elements:u}=t,{crossAxis:y=!1,alignment:m,allowedPlacements:O=Mi,autoAlignment:S=!0,...x}=jt(e,t),M=m!==void 0||O===Mi?ca(m||null,S,O):O,I=await _n(t,x),$=((r=a.autoPlacement)==null?void 0:r.index)||0,A=M[$];if(A==null)return{};let N=Wi(A,o,await(f.isRTL==null?void 0:f.isRTL(u.floating)));if(c!==A)return{reset:{placement:M[0]}};let Y=[I[pt(A)],I[N[0]],I[N[1]]],ne=[...((n=a.autoPlacement)==null?void 0:n.overflows)||[],{placement:A,overflows:Y}],J=M[$+1];if(J)return{data:{index:$+1,overflows:ne},reset:{placement:J}};let V=ne.map(Q=>{let me=xt(Q.placement);return[Q.placement,me&&y?Q.overflows.slice(0,2).reduce((l,h)=>l+h,0):Q.overflows[0],Q.overflows]}).sort((Q,me)=>Q[1]-me[1]),X=((i=V.filter(Q=>Q[2].slice(0,xt(Q[0])?2:3).every(me=>me<=0))[0])==null?void 0:i[0])||V[0][0];return X!==c?{data:{index:$+1,overflows:ne},reset:{placement:X}}:{}}}},ua=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;let{placement:i,middlewareData:o,rects:a,initialPlacement:c,platform:f,elements:u}=t,{mainAxis:y=!0,crossAxis:m=!0,fallbackPlacements:O,fallbackStrategy:S="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:M=!0,...I}=jt(e,t);if((r=o.arrow)!=null&&r.alignmentOffset)return{};let $=pt(i),A=pt(c)===c,N=await(f.isRTL==null?void 0:f.isRTL(u.floating)),Y=O||(A||!M?[mr(c)]:ra(c));!O&&x!=="none"&&Y.push(...oa(c,M,x,N));let ne=[c,...Y],J=await _n(t,I),V=[],de=((n=o.flip)==null?void 0:n.overflows)||[];if(y&&V.push(J[$]),m){let l=Wi(i,a,N);V.push(J[l[0]],J[l[1]])}if(de=[...de,{placement:i,overflows:V}],!V.every(l=>l<=0)){var X,Q;let l=(((X=o.flip)==null?void 0:X.index)||0)+1,h=ne[l];if(h)return{data:{index:l,overflows:de},reset:{placement:h}};let v=(Q=de.filter(p=>p.overflows[0]<=0).sort((p,j)=>p.overflows[1]-j.overflows[1])[0])==null?void 0:Q.placement;if(!v)switch(S){case"bestFit":{var me;let p=(me=de.map(j=>[j.placement,j.overflows.filter(P=>P>0).reduce((P,R)=>P+R,0)]).sort((j,P)=>j[1]-P[1])[0])==null?void 0:me[0];p&&(v=p);break}case"initialPlacement":v=c;break}if(i!==v)return{reset:{placement:v}}}return{}}}};function Ii(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Li(e){return Hi.some(t=>e[t]>=0)}var da=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){let{rects:r}=t,{strategy:n="referenceHidden",...i}=jt(e,t);switch(n){case"referenceHidden":{let o=await _n(t,{...i,elementContext:"reference"}),a=Ii(o,r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Li(a)}}}case"escaped":{let o=await _n(t,{...i,altBoundary:!0}),a=Ii(o,r.floating);return{data:{escapedOffsets:a,escaped:Li(a)}}}default:return{}}}}};function Ui(e){let t=Et(...e.map(o=>o.left)),r=Et(...e.map(o=>o.top)),n=tt(...e.map(o=>o.right)),i=tt(...e.map(o=>o.bottom));return{x:t,y:r,width:n-t,height:i-r}}function pa(e){let t=e.slice().sort((i,o)=>i.y-o.y),r=[],n=null;for(let i=0;in.height/2?r.push([o]):r[r.length-1].push(o),n=o}return r.map(i=>Dn(Ui(i)))}var ha=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){let{placement:r,elements:n,rects:i,platform:o,strategy:a}=t,{padding:c=2,x:f,y:u}=jt(e,t),y=Array.from(await(o.getClientRects==null?void 0:o.getClientRects(n.reference))||[]),m=pa(y),O=Dn(Ui(y)),S=ei(c);function x(){if(m.length===2&&m[0].left>m[1].right&&f!=null&&u!=null)return m.find(I=>f>I.left-S.left&&fI.top-S.top&&u=2){if(Pn(r)==="y"){let Q=m[0],me=m[m.length-1],l=pt(r)==="top",h=Q.top,v=me.bottom,p=l?Q.left:me.left,j=l?Q.right:me.right,P=j-p,R=v-h;return{top:h,bottom:v,left:p,right:j,width:P,height:R,x:p,y:h}}let I=pt(r)==="left",$=tt(...m.map(Q=>Q.right)),A=Et(...m.map(Q=>Q.left)),N=m.filter(Q=>I?Q.left===A:Q.right===$),Y=N[0].top,ne=N[N.length-1].bottom,J=A,V=$,de=V-J,X=ne-Y;return{top:Y,bottom:ne,left:J,right:V,width:de,height:X,x:J,y:Y}}return O}let M=await o.getElementRects({reference:{getBoundingClientRect:x},floating:n.floating,strategy:a});return i.reference.x!==M.reference.x||i.reference.y!==M.reference.y||i.reference.width!==M.reference.width||i.reference.height!==M.reference.height?{reset:{rects:M}}:{}}}};async function va(e,t){let{placement:r,platform:n,elements:i}=e,o=await(n.isRTL==null?void 0:n.isRTL(i.floating)),a=pt(r),c=xt(r),f=Pn(r)==="y",u=["left","top"].includes(a)?-1:1,y=o&&f?-1:1,m=jt(t,e),{mainAxis:O,crossAxis:S,alignmentAxis:x}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...m};return c&&typeof x=="number"&&(S=c==="end"?x*-1:x),f?{x:S*y,y:O*u}:{x:O*u,y:S*y}}var Vi=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;let{x:i,y:o,placement:a,middlewareData:c}=t,f=await va(t,e);return a===((r=c.offset)==null?void 0:r.placement)&&(n=c.arrow)!=null&&n.alignmentOffset?{}:{x:i+f.x,y:o+f.y,data:{...f,placement:a}}}}},ma=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:r,y:n,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:c={fn:I=>{let{x:$,y:A}=I;return{x:$,y:A}}},...f}=jt(e,t),u={x:r,y:n},y=await _n(t,f),m=Pn(pt(i)),O=$i(m),S=u[O],x=u[m];if(o){let I=O==="y"?"top":"left",$=O==="y"?"bottom":"right",A=S+y[I],N=S-y[$];S=Jr(A,S,N)}if(a){let I=m==="y"?"top":"left",$=m==="y"?"bottom":"right",A=x+y[I],N=x-y[$];x=Jr(A,x,N)}let M=c.fn({...t,[O]:S,[m]:x});return{...M,data:{x:M.x-r,y:M.y-n}}}}},ga=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){let{placement:r,rects:n,platform:i,elements:o}=t,{apply:a=()=>{},...c}=jt(e,t),f=await _n(t,c),u=pt(r),y=xt(r),m=Pn(r)==="y",{width:O,height:S}=n.floating,x,M;u==="top"||u==="bottom"?(x=u,M=y===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(M=u,x=y==="end"?"top":"bottom");let I=S-f[x],$=O-f[M],A=!t.middlewareData.shift,N=I,Y=$;if(m){let J=O-f.left-f.right;Y=y||A?Et($,J):J}else{let J=S-f.top-f.bottom;N=y||A?Et(I,J):J}if(A&&!y){let J=tt(f.left,0),V=tt(f.right,0),de=tt(f.top,0),X=tt(f.bottom,0);m?Y=O-2*(J!==0||V!==0?J+V:tt(f.left,f.right)):N=S-2*(de!==0||X!==0?de+X:tt(f.top,f.bottom))}await a({...t,availableWidth:Y,availableHeight:N});let ne=await i.getDimensions(o.floating);return O!==ne.width||S!==ne.height?{reset:{rects:!0}}:{}}}};function rn(e){return zi(e)?(e.nodeName||"").toLowerCase():"#document"}function ct(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Bt(e){var t;return(t=(zi(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function zi(e){return e instanceof Node||e instanceof ct(e).Node}function Nt(e){return e instanceof Element||e instanceof ct(e).Element}function Tt(e){return e instanceof HTMLElement||e instanceof ct(e).HTMLElement}function Fi(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ct(e).ShadowRoot}function zn(e){let{overflow:t,overflowX:r,overflowY:n,display:i}=ht(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(i)}function ba(e){return["table","td","th"].includes(rn(e))}function ti(e){let t=ni(),r=ht(e);return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function ya(e){let t=Tn(e);for(;Tt(t)&&!gr(t);){if(ti(t))return t;t=Tn(t)}return null}function ni(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function gr(e){return["html","body","#document"].includes(rn(e))}function ht(e){return ct(e).getComputedStyle(e)}function br(e){return Nt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Tn(e){if(rn(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Fi(e)&&e.host||Bt(e);return Fi(t)?t.host:t}function Yi(e){let t=Tn(e);return gr(t)?e.ownerDocument?e.ownerDocument.body:e.body:Tt(t)&&zn(t)?t:Yi(t)}function Vn(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);let i=Yi(e),o=i===((n=e.ownerDocument)==null?void 0:n.body),a=ct(i);return o?t.concat(a,a.visualViewport||[],zn(i)?i:[],a.frameElement&&r?Vn(a.frameElement):[]):t.concat(i,Vn(i,[],r))}function Xi(e){let t=ht(e),r=parseFloat(t.width)||0,n=parseFloat(t.height)||0,i=Tt(e),o=i?e.offsetWidth:r,a=i?e.offsetHeight:n,c=hr(r)!==o||hr(n)!==a;return c&&(r=o,n=a),{width:r,height:n,$:c}}function ri(e){return Nt(e)?e:e.contextElement}function Cn(e){let t=ri(e);if(!Tt(t))return nn(1);let r=t.getBoundingClientRect(),{width:n,height:i,$:o}=Xi(t),a=(o?hr(r.width):r.width)/n,c=(o?hr(r.height):r.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}var wa=nn(0);function qi(e){let t=ct(e);return!ni()||!t.visualViewport?wa:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function xa(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==ct(e)?!1:t}function vn(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);let i=e.getBoundingClientRect(),o=ri(e),a=nn(1);t&&(n?Nt(n)&&(a=Cn(n)):a=Cn(e));let c=xa(o,r,n)?qi(o):nn(0),f=(i.left+c.x)/a.x,u=(i.top+c.y)/a.y,y=i.width/a.x,m=i.height/a.y;if(o){let O=ct(o),S=n&&Nt(n)?ct(n):n,x=O,M=x.frameElement;for(;M&&n&&S!==x;){let I=Cn(M),$=M.getBoundingClientRect(),A=ht(M),N=$.left+(M.clientLeft+parseFloat(A.paddingLeft))*I.x,Y=$.top+(M.clientTop+parseFloat(A.paddingTop))*I.y;f*=I.x,u*=I.y,y*=I.x,m*=I.y,f+=N,u+=Y,x=ct(M),M=x.frameElement}}return Dn({width:y,height:m,x:f,y:u})}var Ea=[":popover-open",":modal"];function Gi(e){return Ea.some(t=>{try{return e.matches(t)}catch{return!1}})}function Oa(e){let{elements:t,rect:r,offsetParent:n,strategy:i}=e,o=i==="fixed",a=Bt(n),c=t?Gi(t.floating):!1;if(n===a||c&&o)return r;let f={scrollLeft:0,scrollTop:0},u=nn(1),y=nn(0),m=Tt(n);if((m||!m&&!o)&&((rn(n)!=="body"||zn(a))&&(f=br(n)),Tt(n))){let O=vn(n);u=Cn(n),y.x=O.x+n.clientLeft,y.y=O.y+n.clientTop}return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-f.scrollLeft*u.x+y.x,y:r.y*u.y-f.scrollTop*u.y+y.y}}function Sa(e){return Array.from(e.getClientRects())}function Ki(e){return vn(Bt(e)).left+br(e).scrollLeft}function Aa(e){let t=Bt(e),r=br(e),n=e.ownerDocument.body,i=tt(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=tt(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight),a=-r.scrollLeft+Ki(e),c=-r.scrollTop;return ht(n).direction==="rtl"&&(a+=tt(t.clientWidth,n.clientWidth)-i),{width:i,height:o,x:a,y:c}}function Ca(e,t){let r=ct(e),n=Bt(e),i=r.visualViewport,o=n.clientWidth,a=n.clientHeight,c=0,f=0;if(i){o=i.width,a=i.height;let u=ni();(!u||u&&t==="fixed")&&(c=i.offsetLeft,f=i.offsetTop)}return{width:o,height:a,x:c,y:f}}function Da(e,t){let r=vn(e,!0,t==="fixed"),n=r.top+e.clientTop,i=r.left+e.clientLeft,o=Tt(e)?Cn(e):nn(1),a=e.clientWidth*o.x,c=e.clientHeight*o.y,f=i*o.x,u=n*o.y;return{width:a,height:c,x:f,y:u}}function ki(e,t,r){let n;if(t==="viewport")n=Ca(e,r);else if(t==="document")n=Aa(Bt(e));else if(Nt(t))n=Da(t,r);else{let i=qi(e);n={...t,x:t.x-i.x,y:t.y-i.y}}return Dn(n)}function Ji(e,t){let r=Tn(e);return r===t||!Nt(r)||gr(r)?!1:ht(r).position==="fixed"||Ji(r,t)}function _a(e,t){let r=t.get(e);if(r)return r;let n=Vn(e,[],!1).filter(c=>Nt(c)&&rn(c)!=="body"),i=null,o=ht(e).position==="fixed",a=o?Tn(e):e;for(;Nt(a)&&!gr(a);){let c=ht(a),f=ti(a);!f&&c.position==="fixed"&&(i=null),(o?!f&&!i:!f&&c.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||zn(a)&&!f&&Ji(e,a))?n=n.filter(y=>y!==a):i=c,a=Tn(a)}return t.set(e,n),n}function Ta(e){let{element:t,boundary:r,rootBoundary:n,strategy:i}=e,a=[...r==="clippingAncestors"?_a(t,this._c):[].concat(r),n],c=a[0],f=a.reduce((u,y)=>{let m=ki(t,y,i);return u.top=tt(m.top,u.top),u.right=Et(m.right,u.right),u.bottom=Et(m.bottom,u.bottom),u.left=tt(m.left,u.left),u},ki(t,c,i));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function Pa(e){let{width:t,height:r}=Xi(e);return{width:t,height:r}}function Ma(e,t,r){let n=Tt(t),i=Bt(t),o=r==="fixed",a=vn(e,!0,o,t),c={scrollLeft:0,scrollTop:0},f=nn(0);if(n||!n&&!o)if((rn(t)!=="body"||zn(i))&&(c=br(t)),n){let m=vn(t,!0,o,t);f.x=m.x+t.clientLeft,f.y=m.y+t.clientTop}else i&&(f.x=Ki(i));let u=a.left+c.scrollLeft-f.x,y=a.top+c.scrollTop-f.y;return{x:u,y,width:a.width,height:a.height}}function Ni(e,t){return!Tt(e)||ht(e).position==="fixed"?null:t?t(e):e.offsetParent}function Qi(e,t){let r=ct(e);if(!Tt(e)||Gi(e))return r;let n=Ni(e,t);for(;n&&ba(n)&&ht(n).position==="static";)n=Ni(n,t);return n&&(rn(n)==="html"||rn(n)==="body"&&ht(n).position==="static"&&!ti(n))?r:n||ya(e)||r}var Ra=async function(e){let t=this.getOffsetParent||Qi,r=this.getDimensions;return{reference:Ma(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await r(e.floating)}}};function Ia(e){return ht(e).direction==="rtl"}var La={convertOffsetParentRelativeRectToViewportRelativeRect:Oa,getDocumentElement:Bt,getClippingRect:Ta,getOffsetParent:Qi,getElementRects:Ra,getClientRects:Sa,getDimensions:Pa,getScale:Cn,isElement:Nt,isRTL:Ia};function Fa(e,t){let r=null,n,i=Bt(e);function o(){var c;clearTimeout(n),(c=r)==null||c.disconnect(),r=null}function a(c,f){c===void 0&&(c=!1),f===void 0&&(f=1),o();let{left:u,top:y,width:m,height:O}=e.getBoundingClientRect();if(c||t(),!m||!O)return;let S=pr(y),x=pr(i.clientWidth-(u+m)),M=pr(i.clientHeight-(y+O)),I=pr(u),A={rootMargin:-S+"px "+-x+"px "+-M+"px "+-I+"px",threshold:tt(0,Et(1,f))||1},N=!0;function Y(ne){let J=ne[0].intersectionRatio;if(J!==f){if(!N)return a();J?a(!1,J):n=setTimeout(()=>{a(!1,1e-7)},100)}N=!1}try{r=new IntersectionObserver(Y,{...A,root:i.ownerDocument})}catch{r=new IntersectionObserver(Y,A)}r.observe(e)}return a(!0),o}function ji(e,t,r,n){n===void 0&&(n={});let{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:f=!1}=n,u=ri(e),y=i||o?[...u?Vn(u):[],...Vn(t)]:[];y.forEach($=>{i&&$.addEventListener("scroll",r,{passive:!0}),o&&$.addEventListener("resize",r)});let m=u&&c?Fa(u,r):null,O=-1,S=null;a&&(S=new ResizeObserver($=>{let[A]=$;A&&A.target===u&&S&&(S.unobserve(t),cancelAnimationFrame(O),O=requestAnimationFrame(()=>{var N;(N=S)==null||N.observe(t)})),r()}),u&&!f&&S.observe(u),S.observe(t));let x,M=f?vn(e):null;f&&I();function I(){let $=vn(e);M&&($.x!==M.x||$.y!==M.y||$.width!==M.width||$.height!==M.height)&&r(),M=$,x=requestAnimationFrame(I)}return r(),()=>{var $;y.forEach(A=>{i&&A.removeEventListener("scroll",r),o&&A.removeEventListener("resize",r)}),m?.(),($=S)==null||$.disconnect(),S=null,f&&cancelAnimationFrame(x)}}var ii=fa,Zi=ma,eo=ua,to=ga,no=da,ro=la,io=ha,Bi=(e,t,r)=>{let n=new Map,i={platform:La,...r},o={...i.platform,_c:n};return sa(e,t,{...i,platform:o})},ka=e=>{let t={placement:"bottom",strategy:"absolute",middleware:[]},r=Object.keys(e),n=i=>e[i];return r.includes("offset")&&t.middleware.push(Vi(n("offset"))),r.includes("teleport")&&(t.strategy="fixed"),r.includes("placement")&&(t.placement=n("placement")),r.some(i=>/^auto-?placement$/i.test(i))&&!r.includes("flip")&&t.middleware.push(ii(n("autoPlacement"))),r.includes("flip")&&t.middleware.push(eo(n("flip"))),r.includes("shift")&&t.middleware.push(Zi(n("shift"))),r.includes("inline")&&t.middleware.push(io(n("inline"))),r.includes("arrow")&&t.middleware.push(ro(n("arrow"))),r.includes("hide")&&t.middleware.push(no(n("hide"))),r.includes("size")&&t.middleware.push(to(n("size"))),t},Na=(e,t)=>{let r={component:{trap:!1},float:{placement:"bottom",strategy:"absolute",middleware:[]}},n=i=>e[e.indexOf(i)+1];if(e.includes("trap")&&(r.component.trap=!0),e.includes("teleport")&&(r.float.strategy="fixed"),e.includes("offset")&&r.float.middleware.push(Vi(t.offset||10)),e.includes("placement")&&(r.float.placement=n("placement")),e.some(i=>/^auto-?placement$/i.test(i))&&!e.includes("flip")&&r.float.middleware.push(ii(t.autoPlacement)),e.includes("flip")&&r.float.middleware.push(eo(t.flip)),e.includes("shift")&&r.float.middleware.push(Zi(t.shift)),e.includes("inline")&&r.float.middleware.push(io(t.inline)),e.includes("arrow")&&r.float.middleware.push(ro(t.arrow)),e.includes("hide")&&r.float.middleware.push(no(t.hide)),e.includes("size")){let i=t.size?.availableWidth??null,o=t.size?.availableHeight??null;i&&delete t.size.availableWidth,o&&delete t.size.availableHeight,r.float.middleware.push(to({...t.size,apply({availableWidth:a,availableHeight:c,elements:f}){Object.assign(f.floating.style,{maxWidth:`${i??a}px`,maxHeight:`${o??c}px`})}}))}return r},ja=e=>{var t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz".split(""),r="";e||(e=Math.floor(Math.random()*t.length));for(var n=0;n{}){let r=!1;return function(){r?t.apply(this,arguments):(r=!0,e.apply(this,arguments))}}function Ha(e){let t={dismissable:!0,trap:!1};function r(n,i=null){if(n){if(n.hasAttribute("aria-expanded")||n.setAttribute("aria-expanded",!1),i.hasAttribute("id"))n.setAttribute("aria-controls",i.getAttribute("id"));else{let o=`panel-${ja(8)}`;n.setAttribute("aria-controls",o),i.setAttribute("id",o)}i.setAttribute("aria-modal",!0),i.setAttribute("role","dialog")}}e.magic("float",n=>(i={},o={})=>{let a={...t,...o},c=Object.keys(i).length>0?ka(i):{middleware:[ii()]},f=n,u=n.parentElement.closest("[x-data]"),y=u.querySelector('[x-ref="panel"]');r(f,y);function m(){return y.style.display=="block"}function O(){y.style.display="none",f.setAttribute("aria-expanded","false"),a.trap&&y.setAttribute("x-trap","false"),ji(n,y,M)}function S(){y.style.display="block",f.setAttribute("aria-expanded","true"),a.trap&&y.setAttribute("x-trap","true"),M()}function x(){m()?O():S()}async function M(){return await Bi(n,y,c).then(({middlewareData:I,placement:$,x:A,y:N})=>{if(I.arrow){let Y=I.arrow?.x,ne=I.arrow?.y,J=c.middleware.filter(de=>de.name=="arrow")[0].options.element,V={top:"bottom",right:"left",bottom:"top",left:"right"}[$.split("-")[0]];Object.assign(J.style,{left:Y!=null?`${Y}px`:"",top:ne!=null?`${ne}px`:"",right:"",bottom:"",[V]:"-4px"})}if(I.hide){let{referenceHidden:Y}=I.hide;Object.assign(y.style,{visibility:Y?"hidden":"visible"})}Object.assign(y.style,{left:`${A}px`,top:`${N}px`})})}a.dismissable&&(window.addEventListener("click",I=>{!u.contains(I.target)&&m()&&x()}),window.addEventListener("keydown",I=>{I.key==="Escape"&&m()&&x()},!0)),x()}),e.directive("float",(n,{modifiers:i,expression:o},{evaluate:a,effect:c})=>{let f=o?a(o):{},u=i.length>0?Na(i,f):{},y=null;u.float.strategy=="fixed"&&(n.style.position="fixed");let m=V=>n.parentElement&&!n.parentElement.closest("[x-data]").contains(V.target)?n.close():null,O=V=>V.key==="Escape"?n.close():null,S=n.getAttribute("x-ref"),x=n.parentElement.closest("[x-data]"),M=x.querySelectorAll(`[\\@click^="$refs.${S}"]`),I=x.querySelectorAll(`[x-on\\:click^="$refs.${S}"]`);n.style.setProperty("display","none"),r([...M,...I][0],n),n._x_isShown=!1,n.trigger=null,n._x_doHide||(n._x_doHide=()=>{n.style.setProperty("display","none",i.includes("important")?"important":void 0)}),n._x_doShow||(n._x_doShow=()=>{n.style.setProperty("display","block",i.includes("important")?"important":void 0)});let $=()=>{n._x_doHide(),n._x_isShown=!1},A=()=>{n._x_doShow(),n._x_isShown=!0},N=()=>setTimeout(A),Y=Ba(V=>V?A():$(),V=>{typeof n._x_toggleAndCascadeWithTransitions=="function"?n._x_toggleAndCascadeWithTransitions(n,V,A,$):V?N():$()}),ne,J=!0;c(()=>a(V=>{!J&&V===ne||(i.includes("immediate")&&(V?N():$()),Y(V),ne=V,J=!1)})),n.open=async function(V){n.trigger=V.currentTarget?V.currentTarget:V,Y(!0),n.trigger.setAttribute("aria-expanded","true"),u.component.trap&&n.setAttribute("x-trap","true"),y=ji(n.trigger,n,()=>{Bi(n.trigger,n,u.float).then(({middlewareData:de,placement:X,x:Q,y:me})=>{if(de.arrow){let l=de.arrow?.x,h=de.arrow?.y,v=u.float.middleware.filter(j=>j.name=="arrow")[0].options.element,p={top:"bottom",right:"left",bottom:"top",left:"right"}[X.split("-")[0]];Object.assign(v.style,{left:l!=null?`${l}px`:"",top:h!=null?`${h}px`:"",right:"",bottom:"",[p]:"-4px"})}if(de.hide){let{referenceHidden:l}=de.hide;Object.assign(n.style,{visibility:l?"hidden":"visible"})}Object.assign(n.style,{left:`${Q}px`,top:`${me}px`})})}),window.addEventListener("click",m),window.addEventListener("keydown",O,!0)},n.close=function(){if(!n._x_isShown)return!1;Y(!1),n.trigger.setAttribute("aria-expanded","false"),u.component.trap&&n.setAttribute("x-trap","false"),y(),window.removeEventListener("click",m),window.removeEventListener("keydown",O,!1)},n.toggle=function(V){n._x_isShown?n.close():n.open(V)}})}var oo=Ha;function $a(e){e.store("lazyLoadedAssets",{loaded:new Set,check(a){return Array.isArray(a)?a.every(c=>this.loaded.has(c)):this.loaded.has(a)},markLoaded(a){Array.isArray(a)?a.forEach(c=>this.loaded.add(c)):this.loaded.add(a)}});let t=a=>new CustomEvent(a,{bubbles:!0,composed:!0,cancelable:!0}),r=(a,c={},f,u)=>{let y=document.createElement(a);return Object.entries(c).forEach(([m,O])=>y[m]=O),f&&(u?f.insertBefore(y,u):f.appendChild(y)),y},n=(a,c,f={},u=null,y=null)=>{let m=a==="link"?`link[href="${c}"]`:`script[src="${c}"]`;if(document.querySelector(m)||e.store("lazyLoadedAssets").check(c))return Promise.resolve();let O=a==="link"?{...f,href:c}:{...f,src:c},S=r(a,O,u,y);return new Promise((x,M)=>{S.onload=()=>{e.store("lazyLoadedAssets").markLoaded(c),x()},S.onerror=()=>{M(new Error(`Failed to load ${a}: ${c}`))}})},i=async(a,c,f=null,u=null)=>{let y={type:"text/css",rel:"stylesheet"};c&&(y.media=c);let m=document.head,O=null;if(f&&u){let S=document.querySelector(`link[href*="${u}"]`);S?(m=S.parentElement,O=f==="before"?S:S.nextSibling):(console.warn(`Target (${u}) not found for ${a}. Appending to head.`),m=document.head,O=null)}await n("link",a,y,m,O)},o=async(a,c,f=null,u=null,y=null)=>{let m=document.head,O=null;if(f&&u){let x=document.querySelector(`script[src*="${u}"]`);x?(m=x.parentElement,O=f==="before"?x:x.nextSibling):(console.warn(`Target (${u}) not found for ${a}. Falling back to head or body.`),m=document.head,O=null)}else(c.has("body-start")||c.has("body-end"))&&(m=document.body,c.has("body-start")&&(O=document.body.firstChild));let S={};y&&(S.type="module"),await n("script",a,S,m,O)};e.directive("load-css",(a,{expression:c},{evaluate:f})=>{let u=f(c),y=a.media,m=a.getAttribute("data-dispatch"),O=a.getAttribute("data-css-before")?"before":a.getAttribute("data-css-after")?"after":null,S=a.getAttribute("data-css-before")||a.getAttribute("data-css-after")||null;Promise.all(u.map(x=>i(x,y,O,S))).then(()=>{m&&window.dispatchEvent(t(`${m}-css`))}).catch(console.error)}),e.directive("load-js",(a,{expression:c,modifiers:f},{evaluate:u})=>{let y=u(c),m=new Set(f),O=a.getAttribute("data-js-before")?"before":a.getAttribute("data-js-after")?"after":null,S=a.getAttribute("data-js-before")||a.getAttribute("data-js-after")||null,x=a.getAttribute("data-js-as-module")||a.getAttribute("data-as-module")||!1,M=a.getAttribute("data-dispatch");Promise.all(y.map(I=>o(I,m,O,S,x))).then(()=>{M&&window.dispatchEvent(t(`${M}-js`))}).catch(console.error)})}var ao=$a;function Wa(){return!0}function Ua({component:e,argument:t}){return new Promise(r=>{if(t)window.addEventListener(t,()=>r(),{once:!0});else{let n=i=>{i.detail.id===e.id&&(window.removeEventListener("async-alpine:load",n),r())};window.addEventListener("async-alpine:load",n)}})}function Va(){return new Promise(e=>{"requestIdleCallback"in window?window.requestIdleCallback(e):setTimeout(e,200)})}function za({argument:e}){return new Promise(t=>{if(!e)return console.log("Async Alpine: media strategy requires a media query. Treating as 'eager'"),t();let r=window.matchMedia(`(${e})`);r.matches?t():r.addEventListener("change",t,{once:!0})})}function Ya({component:e,argument:t}){return new Promise(r=>{let n=t||"0px 0px 0px 0px",i=new IntersectionObserver(o=>{o[0].isIntersecting&&(i.disconnect(),r())},{rootMargin:n});i.observe(e.el)})}var so={eager:Wa,event:Ua,idle:Va,media:za,visible:Ya};async function Xa(e){let t=qa(e.strategy);await oi(e,t)}async function oi(e,t){if(t.type==="expression"){if(t.operator==="&&")return Promise.all(t.parameters.map(r=>oi(e,r)));if(t.operator==="||")return Promise.any(t.parameters.map(r=>oi(e,r)))}return so[t.method]?so[t.method]({component:e,argument:t.argument}):!1}function qa(e){let t=Ga(e),r=co(t);return r.type==="method"?{type:"expression",operator:"&&",parameters:[r]}:r}function Ga(e){let t=/\s*([()])\s*|\s*(\|\||&&|\|)\s*|\s*((?:[^()&|]+\([^()]+\))|[^()&|]+)\s*/g,r=[],n;for(;(n=t.exec(e))!==null;){let[i,o,a,c]=n;if(o!==void 0)r.push({type:"parenthesis",value:o});else if(a!==void 0)r.push({type:"operator",value:a==="|"?"&&":a});else{let f={type:"method",method:c.trim()};c.includes("(")&&(f.method=c.substring(0,c.indexOf("(")).trim(),f.argument=c.substring(c.indexOf("(")+1,c.indexOf(")"))),c.method==="immediate"&&(c.method="eager"),r.push(f)}}return r}function co(e){let t=lo(e);for(;e.length>0&&(e[0].value==="&&"||e[0].value==="|"||e[0].value==="||");){let r=e.shift().value,n=lo(e);t.type==="expression"&&t.operator===r?t.parameters.push(n):t={type:"expression",operator:r,parameters:[t,n]}}return t}function lo(e){if(e[0].value==="("){e.shift();let t=co(e);return e[0].value===")"&&e.shift(),t}else return e.shift()}function fo(e){let t="load",r=e.prefixed("load-src"),n=e.prefixed("ignore"),i={defaultStrategy:"eager",keepRelativeURLs:!1},o=!1,a={},c=0;function f(){return c++}e.asyncOptions=A=>{i={...i,...A}},e.asyncData=(A,N=!1)=>{a[A]={loaded:!1,download:N}},e.asyncUrl=(A,N)=>{!A||!N||a[A]||(a[A]={loaded:!1,download:()=>import($(N))})},e.asyncAlias=A=>{o=A};let u=A=>{e.skipDuringClone(()=>{A._x_async||(A._x_async="init",A._x_ignore=!0,A.setAttribute(n,""))})()},y=async A=>{e.skipDuringClone(async()=>{if(A._x_async!=="init")return;A._x_async="await";let{name:N,strategy:Y}=m(A);await Xa({name:N,strategy:Y,el:A,id:A.id||f()}),A.isConnected&&(await O(N),A.isConnected&&(x(A),A._x_async="loaded"))})()};y.inline=u,e.directive(t,y).before("ignore");function m(A){let N=I(A.getAttribute(e.prefixed("data"))),Y=A.getAttribute(e.prefixed(t))||i.defaultStrategy,ne=A.getAttribute(r);return ne&&e.asyncUrl(N,ne),{name:N,strategy:Y}}async function O(A){if(A.startsWith("_x_async_")||(M(A),!a[A]||a[A].loaded))return;let N=await S(A);e.data(A,N),a[A].loaded=!0}async function S(A){if(!a[A])return;let N=await a[A].download(A);return typeof N=="function"?N:N[A]||N.default||Object.values(N)[0]||!1}function x(A){e.destroyTree(A),A._x_ignore=!1,A.removeAttribute(n),!A.closest(`[${n}]`)&&e.initTree(A)}function M(A){if(!(!o||a[A])){if(typeof o=="function"){e.asyncData(A,o);return}e.asyncUrl(A,o.replaceAll("[name]",A))}}function I(A){return(A||"").trim().split(/[({]/g)[0]||`_x_async_${f()}`}function $(A){return i.keepRelativeURLs||new RegExp("^(?:[a-z+]+:)?//","i").test(A)?A:new URL(A,document.baseURI).href}}var Xo=ea(ho(),1);function vo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Mt(e){for(var t=1;t=0)&&(r[i]=e[i]);return r}function Qa(e,t){if(e==null)return{};var r=Ja(e,t),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Za="1.15.6";function Ht(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var Wt=Ht(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),er=Ht(/Edge/i),mo=Ht(/firefox/i),Gn=Ht(/safari/i)&&!Ht(/chrome/i)&&!Ht(/android/i),yi=Ht(/iP(ad|od|hone)/i),So=Ht(/chrome/i)&&Ht(/android/i),Ao={capture:!1,passive:!1};function Oe(e,t,r){e.addEventListener(t,r,!Wt&&Ao)}function Ee(e,t,r){e.removeEventListener(t,r,!Wt&&Ao)}function Tr(e,t){if(t){if(t[0]===">"&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function Co(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function St(e,t,r,n){if(e){r=r||document;do{if(t!=null&&(t[0]===">"?e.parentNode===r&&Tr(e,t):Tr(e,t))||n&&e===r)return e;if(e===r)break}while(e=Co(e))}return null}var go=/\s+/g;function ft(e,t,r){if(e&&t)if(e.classList)e.classList[r?"add":"remove"](t);else{var n=(" "+e.className+" ").replace(go," ").replace(" "+t+" "," ");e.className=(n+(r?" "+t:"")).replace(go," ")}}function ae(e,t,r){var n=e&&e.style;if(n){if(r===void 0)return document.defaultView&&document.defaultView.getComputedStyle?r=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(r=e.currentStyle),t===void 0?r:r[t];!(t in n)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),n[t]=r+(typeof r=="string"?"":"px")}}function Fn(e,t){var r="";if(typeof e=="string")r=e;else do{var n=ae(e,"transform");n&&n!=="none"&&(r=n+" "+r)}while(!t&&(e=e.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(r)}function Do(e,t,r){if(e){var n=e.getElementsByTagName(t),i=0,o=n.length;if(r)for(;i=o:a=i<=o,!a)return n;if(n===Pt())break;n=sn(n,!1)}return!1}function kn(e,t,r,n){for(var i=0,o=0,a=e.children;o2&&arguments[2]!==void 0?arguments[2]:{},i=n.evt,o=Qa(n,ss);tr.pluginEvent.bind(se)(t,r,Mt({dragEl:k,parentEl:Ve,ghostEl:ue,rootEl:Ne,nextEl:bn,lastDownEl:Ar,cloneEl:We,cloneHidden:an,dragStarted:Yn,putSortable:Qe,activeSortable:se.active,originalEvent:i,oldIndex:Ln,oldDraggableIndex:Jn,newIndex:ut,newDraggableIndex:on,hideGhostForTarget:Fo,unhideGhostForTarget:ko,cloneNowHidden:function(){an=!0},cloneNowShown:function(){an=!1},dispatchSortableEvent:function(c){it({sortable:r,name:c,originalEvent:i})}},o))};function it(e){as(Mt({putSortable:Qe,cloneEl:We,targetEl:k,rootEl:Ne,oldIndex:Ln,oldDraggableIndex:Jn,newIndex:ut,newDraggableIndex:on},e))}var k,Ve,ue,Ne,bn,Ar,We,an,Ln,ut,Jn,on,wr,Qe,In=!1,Pr=!1,Mr=[],mn,Ot,li,ci,wo,xo,Yn,Rn,Qn,Zn=!1,xr=!1,Cr,nt,fi=[],vi=!1,Rr=[],Lr=typeof document<"u",Er=yi,Eo=er||Wt?"cssFloat":"float",ls=Lr&&!So&&!yi&&"draggable"in document.createElement("div"),Ro=(function(){if(Lr){if(Wt)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}})(),Io=function(t,r){var n=ae(t),i=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),o=kn(t,0,r),a=kn(t,1,r),c=o&&ae(o),f=a&&ae(a),u=c&&parseInt(c.marginLeft)+parseInt(c.marginRight)+qe(o).width,y=f&&parseInt(f.marginLeft)+parseInt(f.marginRight)+qe(a).width;if(n.display==="flex")return n.flexDirection==="column"||n.flexDirection==="column-reverse"?"vertical":"horizontal";if(n.display==="grid")return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(o&&c.float&&c.float!=="none"){var m=c.float==="left"?"left":"right";return a&&(f.clear==="both"||f.clear===m)?"vertical":"horizontal"}return o&&(c.display==="block"||c.display==="flex"||c.display==="table"||c.display==="grid"||u>=i&&n[Eo]==="none"||a&&n[Eo]==="none"&&u+y>i)?"vertical":"horizontal"},cs=function(t,r,n){var i=n?t.left:t.top,o=n?t.right:t.bottom,a=n?t.width:t.height,c=n?r.left:r.top,f=n?r.right:r.bottom,u=n?r.width:r.height;return i===c||o===f||i+a/2===c+u/2},fs=function(t,r){var n;return Mr.some(function(i){var o=i[st].options.emptyInsertThreshold;if(!(!o||wi(i))){var a=qe(i),c=t>=a.left-o&&t<=a.right+o,f=r>=a.top-o&&r<=a.bottom+o;if(c&&f)return n=i}}),n},Lo=function(t){function r(o,a){return function(c,f,u,y){var m=c.options.group.name&&f.options.group.name&&c.options.group.name===f.options.group.name;if(o==null&&(a||m))return!0;if(o==null||o===!1)return!1;if(a&&o==="clone")return o;if(typeof o=="function")return r(o(c,f,u,y),a)(c,f,u,y);var O=(a?c:f).options.group.name;return o===!0||typeof o=="string"&&o===O||o.join&&o.indexOf(O)>-1}}var n={},i=t.group;(!i||Sr(i)!="object")&&(i={name:i}),n.name=i.name,n.checkPull=r(i.pull,!0),n.checkPut=r(i.put),n.revertClone=i.revertClone,t.group=n},Fo=function(){!Ro&&ue&&ae(ue,"display","none")},ko=function(){!Ro&&ue&&ae(ue,"display","")};Lr&&!So&&document.addEventListener("click",function(e){if(Pr)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Pr=!1,!1},!0);var gn=function(t){if(k){t=t.touches?t.touches[0]:t;var r=fs(t.clientX,t.clientY);if(r){var n={};for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.target=n.rootEl=r,n.preventDefault=void 0,n.stopPropagation=void 0,r[st]._onDragOver(n)}}},us=function(t){k&&k.parentNode[st]._isOutsideThisEl(t.target)};function se(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=$t({},t),e[st]=this;var r={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Io(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(a,c){a.setData("Text",c.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:se.supportPointer!==!1&&"PointerEvent"in window&&(!Gn||yi),emptyInsertThreshold:5};tr.initializePlugins(this,e,r);for(var n in r)!(n in t)&&(t[n]=r[n]);Lo(t);for(var i in this)i.charAt(0)==="_"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this));this.nativeDraggable=t.forceFallback?!1:ls,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?Oe(e,"pointerdown",this._onTapStart):(Oe(e,"mousedown",this._onTapStart),Oe(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(Oe(e,"dragover",this),Oe(e,"dragenter",this)),Mr.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),$t(this,rs())}se.prototype={constructor:se,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(Rn=null)},_getDirection:function(t,r){return typeof this.options.direction=="function"?this.options.direction.call(this,t,r,k):this.options.direction},_onTapStart:function(t){if(t.cancelable){var r=this,n=this.el,i=this.options,o=i.preventOnFilter,a=t.type,c=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,f=(c||t).target,u=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||f,y=i.filter;if(ys(n),!k&&!(/mousedown|pointerdown/.test(a)&&t.button!==0||i.disabled)&&!u.isContentEditable&&!(!this.nativeDraggable&&Gn&&f&&f.tagName.toUpperCase()==="SELECT")&&(f=St(f,i.draggable,n,!1),!(f&&f.animated)&&Ar!==f)){if(Ln=vt(f),Jn=vt(f,i.draggable),typeof y=="function"){if(y.call(this,t,f,this)){it({sortable:r,rootEl:u,name:"filter",targetEl:f,toEl:n,fromEl:n}),at("filter",r,{evt:t}),o&&t.preventDefault();return}}else if(y&&(y=y.split(",").some(function(m){if(m=St(u,m.trim(),n,!1),m)return it({sortable:r,rootEl:m,name:"filter",targetEl:f,fromEl:n,toEl:n}),at("filter",r,{evt:t}),!0}),y)){o&&t.preventDefault();return}i.handle&&!St(u,i.handle,n,!1)||this._prepareDragStart(t,c,f)}}},_prepareDragStart:function(t,r,n){var i=this,o=i.el,a=i.options,c=o.ownerDocument,f;if(n&&!k&&n.parentNode===o){var u=qe(n);if(Ne=o,k=n,Ve=k.parentNode,bn=k.nextSibling,Ar=n,wr=a.group,se.dragged=k,mn={target:k,clientX:(r||t).clientX,clientY:(r||t).clientY},wo=mn.clientX-u.left,xo=mn.clientY-u.top,this._lastX=(r||t).clientX,this._lastY=(r||t).clientY,k.style["will-change"]="all",f=function(){if(at("delayEnded",i,{evt:t}),se.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!mo&&i.nativeDraggable&&(k.draggable=!0),i._triggerDragStart(t,r),it({sortable:i,name:"choose",originalEvent:t}),ft(k,a.chosenClass,!0)},a.ignore.split(",").forEach(function(y){Do(k,y.trim(),ui)}),Oe(c,"dragover",gn),Oe(c,"mousemove",gn),Oe(c,"touchmove",gn),a.supportPointer?(Oe(c,"pointerup",i._onDrop),!this.nativeDraggable&&Oe(c,"pointercancel",i._onDrop)):(Oe(c,"mouseup",i._onDrop),Oe(c,"touchend",i._onDrop),Oe(c,"touchcancel",i._onDrop)),mo&&this.nativeDraggable&&(this.options.touchStartThreshold=4,k.draggable=!0),at("delayStart",this,{evt:t}),a.delay&&(!a.delayOnTouchOnly||r)&&(!this.nativeDraggable||!(er||Wt))){if(se.eventCanceled){this._onDrop();return}a.supportPointer?(Oe(c,"pointerup",i._disableDelayedDrag),Oe(c,"pointercancel",i._disableDelayedDrag)):(Oe(c,"mouseup",i._disableDelayedDrag),Oe(c,"touchend",i._disableDelayedDrag),Oe(c,"touchcancel",i._disableDelayedDrag)),Oe(c,"mousemove",i._delayedDragTouchMoveHandler),Oe(c,"touchmove",i._delayedDragTouchMoveHandler),a.supportPointer&&Oe(c,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(f,a.delay)}else f()}},_delayedDragTouchMoveHandler:function(t){var r=t.touches?t.touches[0]:t;Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){k&&ui(k),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;Ee(t,"mouseup",this._disableDelayedDrag),Ee(t,"touchend",this._disableDelayedDrag),Ee(t,"touchcancel",this._disableDelayedDrag),Ee(t,"pointerup",this._disableDelayedDrag),Ee(t,"pointercancel",this._disableDelayedDrag),Ee(t,"mousemove",this._delayedDragTouchMoveHandler),Ee(t,"touchmove",this._delayedDragTouchMoveHandler),Ee(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,r){r=r||t.pointerType=="touch"&&t,!this.nativeDraggable||r?this.options.supportPointer?Oe(document,"pointermove",this._onTouchMove):r?Oe(document,"touchmove",this._onTouchMove):Oe(document,"mousemove",this._onTouchMove):(Oe(k,"dragend",this),Oe(Ne,"dragstart",this._onDragStart));try{document.selection?Dr(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,r){if(In=!1,Ne&&k){at("dragStarted",this,{evt:r}),this.nativeDraggable&&Oe(document,"dragover",us);var n=this.options;!t&&ft(k,n.dragClass,!1),ft(k,n.ghostClass,!0),se.active=this,t&&this._appendGhost(),it({sortable:this,name:"start",originalEvent:r})}else this._nulling()},_emulateDragOver:function(){if(Ot){this._lastX=Ot.clientX,this._lastY=Ot.clientY,Fo();for(var t=document.elementFromPoint(Ot.clientX,Ot.clientY),r=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Ot.clientX,Ot.clientY),t!==r);)r=t;if(k.parentNode[st]._isOutsideThisEl(t),r)do{if(r[st]){var n=void 0;if(n=r[st]._onDragOver({clientX:Ot.clientX,clientY:Ot.clientY,target:t,rootEl:r}),n&&!this.options.dragoverBubble)break}t=r}while(r=Co(r));ko()}},_onTouchMove:function(t){if(mn){var r=this.options,n=r.fallbackTolerance,i=r.fallbackOffset,o=t.touches?t.touches[0]:t,a=ue&&Fn(ue,!0),c=ue&&a&&a.a,f=ue&&a&&a.d,u=Er&&nt&&yo(nt),y=(o.clientX-mn.clientX+i.x)/(c||1)+(u?u[0]-fi[0]:0)/(c||1),m=(o.clientY-mn.clientY+i.y)/(f||1)+(u?u[1]-fi[1]:0)/(f||1);if(!se.active&&!In){if(n&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))=0&&(it({rootEl:Ve,name:"add",toEl:Ve,fromEl:Ne,originalEvent:t}),it({sortable:this,name:"remove",toEl:Ve,originalEvent:t}),it({rootEl:Ve,name:"sort",toEl:Ve,fromEl:Ne,originalEvent:t}),it({sortable:this,name:"sort",toEl:Ve,originalEvent:t})),Qe&&Qe.save()):ut!==Ln&&ut>=0&&(it({sortable:this,name:"update",toEl:Ve,originalEvent:t}),it({sortable:this,name:"sort",toEl:Ve,originalEvent:t})),se.active&&((ut==null||ut===-1)&&(ut=Ln,on=Jn),it({sortable:this,name:"end",toEl:Ve,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){at("nulling",this),Ne=k=Ve=ue=bn=We=Ar=an=mn=Ot=Yn=ut=on=Ln=Jn=Rn=Qn=Qe=wr=se.dragged=se.ghost=se.clone=se.active=null,Rr.forEach(function(t){t.checked=!0}),Rr.length=li=ci=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":k&&(this._onDragOver(t),ds(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],r,n=this.el.children,i=0,o=n.length,a=this.options;ii.right+o||e.clientY>n.bottom&&e.clientX>n.left:e.clientY>i.bottom+o||e.clientX>n.right&&e.clientY>n.top}function ms(e,t,r,n,i,o,a,c){var f=n?e.clientY:e.clientX,u=n?r.height:r.width,y=n?r.top:r.left,m=n?r.bottom:r.right,O=!1;if(!a){if(c&&Cry+u*o/2:fm-Cr)return-Qn}else if(f>y+u*(1-i)/2&&fm-u*o/2)?f>y+u/2?1:-1:0}function gs(e){return vt(k){e.directive("sortable",t=>{let r=parseInt(t.dataset?.sortableAnimationDuration);r!==0&&!r&&(r=300),t.sortable=Oi.create(t,{group:t.getAttribute("x-sortable-group"),draggable:"[x-sortable-item]",handle:"[x-sortable-handle]",dataIdAttr:"x-sortable-item",animation:r,ghostClass:"fi-sortable-ghost",onEnd(n){let{item:i,to:o,oldDraggableIndex:a,newDraggableIndex:c}=n;if(a===c)return;let f=this.options.draggable,u=o.querySelectorAll(`:scope > ${f}`)[c-1];u&&o.insertBefore(i,u.nextSibling)}})})};var xs=Object.create,Ci=Object.defineProperty,Es=Object.getPrototypeOf,Os=Object.prototype.hasOwnProperty,Ss=Object.getOwnPropertyNames,As=Object.getOwnPropertyDescriptor,Cs=e=>Ci(e,"__esModule",{value:!0}),Bo=(e,t)=>()=>(t||(t={exports:{}},e(t.exports,t)),t.exports),Ds=(e,t,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Ss(t))!Os.call(e,n)&&n!=="default"&&Ci(e,n,{get:()=>t[n],enumerable:!(r=As(t,n))||r.enumerable});return e},Ho=e=>Ds(Cs(Ci(e!=null?xs(Es(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),_s=Bo(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});function t(d){var s=d.getBoundingClientRect();return{width:s.width,height:s.height,top:s.top,right:s.right,bottom:s.bottom,left:s.left,x:s.left,y:s.top}}function r(d){if(d==null)return window;if(d.toString()!=="[object Window]"){var s=d.ownerDocument;return s&&s.defaultView||window}return d}function n(d){var s=r(d),b=s.pageXOffset,_=s.pageYOffset;return{scrollLeft:b,scrollTop:_}}function i(d){var s=r(d).Element;return d instanceof s||d instanceof Element}function o(d){var s=r(d).HTMLElement;return d instanceof s||d instanceof HTMLElement}function a(d){if(typeof ShadowRoot>"u")return!1;var s=r(d).ShadowRoot;return d instanceof s||d instanceof ShadowRoot}function c(d){return{scrollLeft:d.scrollLeft,scrollTop:d.scrollTop}}function f(d){return d===r(d)||!o(d)?n(d):c(d)}function u(d){return d?(d.nodeName||"").toLowerCase():null}function y(d){return((i(d)?d.ownerDocument:d.document)||window.document).documentElement}function m(d){return t(y(d)).left+n(d).scrollLeft}function O(d){return r(d).getComputedStyle(d)}function S(d){var s=O(d),b=s.overflow,_=s.overflowX,T=s.overflowY;return/auto|scroll|overlay|hidden/.test(b+T+_)}function x(d,s,b){b===void 0&&(b=!1);var _=y(s),T=t(d),F=o(s),U={scrollLeft:0,scrollTop:0},H={x:0,y:0};return(F||!F&&!b)&&((u(s)!=="body"||S(_))&&(U=f(s)),o(s)?(H=t(s),H.x+=s.clientLeft,H.y+=s.clientTop):_&&(H.x=m(_))),{x:T.left+U.scrollLeft-H.x,y:T.top+U.scrollTop-H.y,width:T.width,height:T.height}}function M(d){var s=t(d),b=d.offsetWidth,_=d.offsetHeight;return Math.abs(s.width-b)<=1&&(b=s.width),Math.abs(s.height-_)<=1&&(_=s.height),{x:d.offsetLeft,y:d.offsetTop,width:b,height:_}}function I(d){return u(d)==="html"?d:d.assignedSlot||d.parentNode||(a(d)?d.host:null)||y(d)}function $(d){return["html","body","#document"].indexOf(u(d))>=0?d.ownerDocument.body:o(d)&&S(d)?d:$(I(d))}function A(d,s){var b;s===void 0&&(s=[]);var _=$(d),T=_===((b=d.ownerDocument)==null?void 0:b.body),F=r(_),U=T?[F].concat(F.visualViewport||[],S(_)?_:[]):_,H=s.concat(U);return T?H:H.concat(A(I(U)))}function N(d){return["table","td","th"].indexOf(u(d))>=0}function Y(d){return!o(d)||O(d).position==="fixed"?null:d.offsetParent}function ne(d){var s=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,b=navigator.userAgent.indexOf("Trident")!==-1;if(b&&o(d)){var _=O(d);if(_.position==="fixed")return null}for(var T=I(d);o(T)&&["html","body"].indexOf(u(T))<0;){var F=O(T);if(F.transform!=="none"||F.perspective!=="none"||F.contain==="paint"||["transform","perspective"].indexOf(F.willChange)!==-1||s&&F.willChange==="filter"||s&&F.filter&&F.filter!=="none")return T;T=T.parentNode}return null}function J(d){for(var s=r(d),b=Y(d);b&&N(b)&&O(b).position==="static";)b=Y(b);return b&&(u(b)==="html"||u(b)==="body"&&O(b).position==="static")?s:b||ne(d)||s}var V="top",de="bottom",X="right",Q="left",me="auto",l=[V,de,X,Q],h="start",v="end",p="clippingParents",j="viewport",P="popper",R="reference",Z=l.reduce(function(d,s){return d.concat([s+"-"+h,s+"-"+v])},[]),ze=[].concat(l,[me]).reduce(function(d,s){return d.concat([s,s+"-"+h,s+"-"+v])},[]),Rt="beforeRead",Ut="read",Fr="afterRead",kr="beforeMain",Nr="main",Vt="afterMain",nr="beforeWrite",jr="write",rr="afterWrite",It=[Rt,Ut,Fr,kr,Nr,Vt,nr,jr,rr];function Br(d){var s=new Map,b=new Set,_=[];d.forEach(function(F){s.set(F.name,F)});function T(F){b.add(F.name);var U=[].concat(F.requires||[],F.requiresIfExists||[]);U.forEach(function(H){if(!b.has(H)){var G=s.get(H);G&&T(G)}}),_.push(F)}return d.forEach(function(F){b.has(F.name)||T(F)}),_}function mt(d){var s=Br(d);return It.reduce(function(b,_){return b.concat(s.filter(function(T){return T.phase===_}))},[])}function zt(d){var s;return function(){return s||(s=new Promise(function(b){Promise.resolve().then(function(){s=void 0,b(d())})})),s}}function At(d){for(var s=arguments.length,b=new Array(s>1?s-1:0),_=1;_=0,_=b&&o(d)?J(d):d;return i(_)?s.filter(function(T){return i(T)&&Nn(T,_)&&u(T)!=="body"}):[]}function wn(d,s,b){var _=s==="clippingParents"?yn(d):[].concat(s),T=[].concat(_,[b]),F=T[0],U=T.reduce(function(H,G){var oe=sr(d,G);return H.top=gt(oe.top,H.top),H.right=ln(oe.right,H.right),H.bottom=ln(oe.bottom,H.bottom),H.left=gt(oe.left,H.left),H},sr(d,F));return U.width=U.right-U.left,U.height=U.bottom-U.top,U.x=U.left,U.y=U.top,U}function cn(d){return d.split("-")[1]}function dt(d){return["top","bottom"].indexOf(d)>=0?"x":"y"}function lr(d){var s=d.reference,b=d.element,_=d.placement,T=_?ot(_):null,F=_?cn(_):null,U=s.x+s.width/2-b.width/2,H=s.y+s.height/2-b.height/2,G;switch(T){case V:G={x:U,y:s.y-b.height};break;case de:G={x:U,y:s.y+s.height};break;case X:G={x:s.x+s.width,y:H};break;case Q:G={x:s.x-b.width,y:H};break;default:G={x:s.x,y:s.y}}var oe=T?dt(T):null;if(oe!=null){var z=oe==="y"?"height":"width";switch(F){case h:G[oe]=G[oe]-(s[z]/2-b[z]/2);break;case v:G[oe]=G[oe]+(s[z]/2-b[z]/2);break}}return G}function cr(){return{top:0,right:0,bottom:0,left:0}}function fr(d){return Object.assign({},cr(),d)}function ur(d,s){return s.reduce(function(b,_){return b[_]=d,b},{})}function qt(d,s){s===void 0&&(s={});var b=s,_=b.placement,T=_===void 0?d.placement:_,F=b.boundary,U=F===void 0?p:F,H=b.rootBoundary,G=H===void 0?j:H,oe=b.elementContext,z=oe===void 0?P:oe,De=b.altBoundary,Fe=De===void 0?!1:De,Ce=b.padding,xe=Ce===void 0?0:Ce,Me=fr(typeof xe!="number"?xe:ur(xe,l)),Se=z===P?R:P,Be=d.elements.reference,Re=d.rects.popper,He=d.elements[Fe?Se:z],ce=wn(i(He)?He:He.contextElement||y(d.elements.popper),U,G),Pe=t(Be),_e=lr({reference:Pe,element:Re,strategy:"absolute",placement:T}),ke=Xt(Object.assign({},Re,_e)),Le=z===P?ke:Pe,Ye={top:ce.top-Le.top+Me.top,bottom:Le.bottom-ce.bottom+Me.bottom,left:ce.left-Le.left+Me.left,right:Le.right-ce.right+Me.right},$e=d.modifiersData.offset;if(z===P&&$e){var Ue=$e[T];Object.keys(Ye).forEach(function(wt){var et=[X,de].indexOf(wt)>=0?1:-1,Ft=[V,de].indexOf(wt)>=0?"y":"x";Ye[wt]+=Ue[Ft]*et})}return Ye}var dr="Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.",Vr="Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.",xn={placement:"bottom",modifiers:[],strategy:"absolute"};function fn(){for(var d=arguments.length,s=new Array(d),b=0;b100){console.error(Vr);break}if(z.reset===!0){z.reset=!1,Pe=-1;continue}var _e=z.orderedModifiers[Pe],ke=_e.fn,Le=_e.options,Ye=Le===void 0?{}:Le,$e=_e.name;typeof ke=="function"&&(z=ke({state:z,options:Ye,name:$e,instance:Ce})||z)}}},update:zt(function(){return new Promise(function(Se){Ce.forceUpdate(),Se(z)})}),destroy:function(){Me(),Fe=!0}};if(!fn(H,G))return console.error(dr),Ce;Ce.setOptions(oe).then(function(Se){!Fe&&oe.onFirstUpdate&&oe.onFirstUpdate(Se)});function xe(){z.orderedModifiers.forEach(function(Se){var Be=Se.name,Re=Se.options,He=Re===void 0?{}:Re,ce=Se.effect;if(typeof ce=="function"){var Pe=ce({state:z,name:Be,instance:Ce,options:He}),_e=function(){};De.push(Pe||_e)}})}function Me(){De.forEach(function(Se){return Se()}),De=[]}return Ce}}var On={passive:!0};function zr(d){var s=d.state,b=d.instance,_=d.options,T=_.scroll,F=T===void 0?!0:T,U=_.resize,H=U===void 0?!0:U,G=r(s.elements.popper),oe=[].concat(s.scrollParents.reference,s.scrollParents.popper);return F&&oe.forEach(function(z){z.addEventListener("scroll",b.update,On)}),H&&G.addEventListener("resize",b.update,On),function(){F&&oe.forEach(function(z){z.removeEventListener("scroll",b.update,On)}),H&&G.removeEventListener("resize",b.update,On)}}var jn={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:zr,data:{}};function Yr(d){var s=d.state,b=d.name;s.modifiersData[b]=lr({reference:s.rects.reference,element:s.rects.popper,strategy:"absolute",placement:s.placement})}var Bn={name:"popperOffsets",enabled:!0,phase:"read",fn:Yr,data:{}},Xr={top:"auto",right:"auto",bottom:"auto",left:"auto"};function qr(d){var s=d.x,b=d.y,_=window,T=_.devicePixelRatio||1;return{x:Yt(Yt(s*T)/T)||0,y:Yt(Yt(b*T)/T)||0}}function Hn(d){var s,b=d.popper,_=d.popperRect,T=d.placement,F=d.offsets,U=d.position,H=d.gpuAcceleration,G=d.adaptive,oe=d.roundOffsets,z=oe===!0?qr(F):typeof oe=="function"?oe(F):F,De=z.x,Fe=De===void 0?0:De,Ce=z.y,xe=Ce===void 0?0:Ce,Me=F.hasOwnProperty("x"),Se=F.hasOwnProperty("y"),Be=Q,Re=V,He=window;if(G){var ce=J(b),Pe="clientHeight",_e="clientWidth";ce===r(b)&&(ce=y(b),O(ce).position!=="static"&&(Pe="scrollHeight",_e="scrollWidth")),ce=ce,T===V&&(Re=de,xe-=ce[Pe]-_.height,xe*=H?1:-1),T===Q&&(Be=X,Fe-=ce[_e]-_.width,Fe*=H?1:-1)}var ke=Object.assign({position:U},G&&Xr);if(H){var Le;return Object.assign({},ke,(Le={},Le[Re]=Se?"0":"",Le[Be]=Me?"0":"",Le.transform=(He.devicePixelRatio||1)<2?"translate("+Fe+"px, "+xe+"px)":"translate3d("+Fe+"px, "+xe+"px, 0)",Le))}return Object.assign({},ke,(s={},s[Re]=Se?xe+"px":"",s[Be]=Me?Fe+"px":"",s.transform="",s))}function g(d){var s=d.state,b=d.options,_=b.gpuAcceleration,T=_===void 0?!0:_,F=b.adaptive,U=F===void 0?!0:F,H=b.roundOffsets,G=H===void 0?!0:H,oe=O(s.elements.popper).transitionProperty||"";U&&["transform","top","right","bottom","left"].some(function(De){return oe.indexOf(De)>=0})&&console.warn(["Popper: Detected CSS transitions on at least one of the following",'CSS properties: "transform", "top", "right", "bottom", "left".',` +(() => { + var qo = Object.create; + var Ti = Object.defineProperty; + var Go = Object.getOwnPropertyDescriptor; + var Ko = Object.getOwnPropertyNames; + var Jo = Object.getPrototypeOf, + Qo = Object.prototype.hasOwnProperty; + var Kr = (e, t) => () => ( + t || e((t = { exports: {} }).exports, t), + t.exports + ); + var Zo = (e, t, r, n) => { + if ((t && typeof t == "object") || typeof t == "function") + for (let i of Ko(t)) + !Qo.call(e, i) && + i !== r && + Ti(e, i, { + get: () => t[i], + enumerable: !(n = Go(t, i)) || n.enumerable, + }); + return e; + }; + var ea = (e, t, r) => ( + (r = e != null ? qo(Jo(e)) : {}), + Zo( + t || !e || !e.__esModule + ? Ti(r, "default", { value: e, enumerable: !0 }) + : r, + e, + ) + ); + var uo = Kr(() => {}); + var po = Kr(() => {}); + var ho = Kr((Hs, yr) => { + (function () { + "use strict"; + var e = "input is invalid type", + t = "finalize already called", + r = typeof window == "object", + n = r ? window : {}; + n.JS_MD5_NO_WINDOW && (r = !1); + var i = !r && typeof self == "object", + o = + !n.JS_MD5_NO_NODE_JS && + typeof process == "object" && + process.versions && + process.versions.node; + o ? (n = global) : i && (n = self); + var a = + !n.JS_MD5_NO_COMMON_JS && + typeof yr == "object" && + yr.exports, + c = typeof define == "function" && define.amd, + f = !n.JS_MD5_NO_ARRAY_BUFFER && typeof ArrayBuffer < "u", + u = "0123456789abcdef".split(""), + y = [128, 32768, 8388608, -2147483648], + m = [0, 8, 16, 24], + O = [ + "hex", + "array", + "digest", + "buffer", + "arrayBuffer", + "base64", + ], + S = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split( + "", + ), + x = [], + M; + if (f) { + var I = new ArrayBuffer(68); + ((M = new Uint8Array(I)), (x = new Uint32Array(I))); + } + var $ = Array.isArray; + (n.JS_MD5_NO_NODE_JS || !$) && + ($ = function (l) { + return ( + Object.prototype.toString.call(l) === "[object Array]" + ); + }); + var A = ArrayBuffer.isView; + f && + (n.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW || !A) && + (A = function (l) { + return ( + typeof l == "object" && + l.buffer && + l.buffer.constructor === ArrayBuffer + ); + }); + var N = function (l) { + var h = typeof l; + if (h === "string") return [l, !0]; + if (h !== "object" || l === null) throw new Error(e); + if (f && l.constructor === ArrayBuffer) + return [new Uint8Array(l), !1]; + if (!$(l) && !A(l)) throw new Error(e); + return [l, !1]; + }, + Y = function (l) { + return function (h) { + return new X(!0).update(h)[l](); + }; + }, + ne = function () { + var l = Y("hex"); + (o && (l = J(l)), + (l.create = function () { + return new X(); + }), + (l.update = function (p) { + return l.create().update(p); + })); + for (var h = 0; h < O.length; ++h) { + var v = O[h]; + l[v] = Y(v); + } + return l; + }, + J = function (l) { + var h = uo(), + v = po().Buffer, + p; + v.from && !n.JS_MD5_NO_BUFFER_FROM + ? (p = v.from) + : (p = function (P) { + return new v(P); + }); + var j = function (P) { + if (typeof P == "string") + return h + .createHash("md5") + .update(P, "utf8") + .digest("hex"); + if (P == null) throw new Error(e); + return ( + P.constructor === ArrayBuffer && + (P = new Uint8Array(P)), + $(P) || A(P) || P.constructor === v + ? h.createHash("md5").update(p(P)).digest("hex") + : l(P) + ); + }; + return j; + }, + V = function (l) { + return function (h, v) { + return new Q(h, !0).update(v)[l](); + }; + }, + de = function () { + var l = V("hex"); + ((l.create = function (p) { + return new Q(p); + }), + (l.update = function (p, j) { + return l.create(p).update(j); + })); + for (var h = 0; h < O.length; ++h) { + var v = O[h]; + l[v] = V(v); + } + return l; + }; + function X(l) { + if (l) + ((x[0] = + x[16] = + x[1] = + x[2] = + x[3] = + x[4] = + x[5] = + x[6] = + x[7] = + x[8] = + x[9] = + x[10] = + x[11] = + x[12] = + x[13] = + x[14] = + x[15] = + 0), + (this.blocks = x), + (this.buffer8 = M)); + else if (f) { + var h = new ArrayBuffer(68); + ((this.buffer8 = new Uint8Array(h)), + (this.blocks = new Uint32Array(h))); + } else + this.blocks = [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ]; + ((this.h0 = + this.h1 = + this.h2 = + this.h3 = + this.start = + this.bytes = + this.hBytes = + 0), + (this.finalized = this.hashed = !1), + (this.first = !0)); + } + ((X.prototype.update = function (l) { + if (this.finalized) throw new Error(t); + var h = N(l); + l = h[0]; + for ( + var v = h[1], + p, + j = 0, + P, + R = l.length, + Z = this.blocks, + ze = this.buffer8; + j < R; + ) { + if ( + (this.hashed && + ((this.hashed = !1), + (Z[0] = Z[16]), + (Z[16] = + Z[1] = + Z[2] = + Z[3] = + Z[4] = + Z[5] = + Z[6] = + Z[7] = + Z[8] = + Z[9] = + Z[10] = + Z[11] = + Z[12] = + Z[13] = + Z[14] = + Z[15] = + 0)), + v) + ) + if (f) + for (P = this.start; j < R && P < 64; ++j) + ((p = l.charCodeAt(j)), + p < 128 + ? (ze[P++] = p) + : p < 2048 + ? ((ze[P++] = 192 | (p >>> 6)), + (ze[P++] = 128 | (p & 63))) + : p < 55296 || p >= 57344 + ? ((ze[P++] = 224 | (p >>> 12)), + (ze[P++] = + 128 | ((p >>> 6) & 63)), + (ze[P++] = 128 | (p & 63))) + : ((p = + 65536 + + (((p & 1023) << 10) | + (l.charCodeAt(++j) & + 1023))), + (ze[P++] = 240 | (p >>> 18)), + (ze[P++] = + 128 | ((p >>> 12) & 63)), + (ze[P++] = + 128 | ((p >>> 6) & 63)), + (ze[P++] = 128 | (p & 63)))); + else + for (P = this.start; j < R && P < 64; ++j) + ((p = l.charCodeAt(j)), + p < 128 + ? (Z[P >>> 2] |= p << m[P++ & 3]) + : p < 2048 + ? ((Z[P >>> 2] |= + (192 | (p >>> 6)) << + m[P++ & 3]), + (Z[P >>> 2] |= + (128 | (p & 63)) << m[P++ & 3])) + : p < 55296 || p >= 57344 + ? ((Z[P >>> 2] |= + (224 | (p >>> 12)) << + m[P++ & 3]), + (Z[P >>> 2] |= + (128 | ((p >>> 6) & 63)) << + m[P++ & 3]), + (Z[P >>> 2] |= + (128 | (p & 63)) << + m[P++ & 3])) + : ((p = + 65536 + + (((p & 1023) << 10) | + (l.charCodeAt(++j) & + 1023))), + (Z[P >>> 2] |= + (240 | (p >>> 18)) << + m[P++ & 3]), + (Z[P >>> 2] |= + (128 | ((p >>> 12) & 63)) << + m[P++ & 3]), + (Z[P >>> 2] |= + (128 | ((p >>> 6) & 63)) << + m[P++ & 3]), + (Z[P >>> 2] |= + (128 | (p & 63)) << + m[P++ & 3]))); + else if (f) + for (P = this.start; j < R && P < 64; ++j) + ze[P++] = l[j]; + else + for (P = this.start; j < R && P < 64; ++j) + Z[P >>> 2] |= l[j] << m[P++ & 3]; + ((this.lastByteIndex = P), + (this.bytes += P - this.start), + P >= 64 + ? ((this.start = P - 64), + this.hash(), + (this.hashed = !0)) + : (this.start = P)); + } + return ( + this.bytes > 4294967295 && + ((this.hBytes += (this.bytes / 4294967296) << 0), + (this.bytes = this.bytes % 4294967296)), + this + ); + }), + (X.prototype.finalize = function () { + if (!this.finalized) { + this.finalized = !0; + var l = this.blocks, + h = this.lastByteIndex; + ((l[h >>> 2] |= y[h & 3]), + h >= 56 && + (this.hashed || this.hash(), + (l[0] = l[16]), + (l[16] = + l[1] = + l[2] = + l[3] = + l[4] = + l[5] = + l[6] = + l[7] = + l[8] = + l[9] = + l[10] = + l[11] = + l[12] = + l[13] = + l[14] = + l[15] = + 0)), + (l[14] = this.bytes << 3), + (l[15] = (this.hBytes << 3) | (this.bytes >>> 29)), + this.hash()); + } + }), + (X.prototype.hash = function () { + var l, + h, + v, + p, + j, + P, + R = this.blocks; + (this.first + ? ((l = R[0] - 680876937), + (l = (((l << 7) | (l >>> 25)) - 271733879) << 0), + (p = + (-1732584194 ^ (l & 2004318071)) + + R[1] - + 117830708), + (p = (((p << 12) | (p >>> 20)) + l) << 0), + (v = + (-271733879 ^ (p & (l ^ -271733879))) + + R[2] - + 1126478375), + (v = (((v << 17) | (v >>> 15)) + p) << 0), + (h = (l ^ (v & (p ^ l))) + R[3] - 1316259209), + (h = (((h << 22) | (h >>> 10)) + v) << 0)) + : ((l = this.h0), + (h = this.h1), + (v = this.h2), + (p = this.h3), + (l += (p ^ (h & (v ^ p))) + R[0] - 680876936), + (l = (((l << 7) | (l >>> 25)) + h) << 0), + (p += (v ^ (l & (h ^ v))) + R[1] - 389564586), + (p = (((p << 12) | (p >>> 20)) + l) << 0), + (v += (h ^ (p & (l ^ h))) + R[2] + 606105819), + (v = (((v << 17) | (v >>> 15)) + p) << 0), + (h += (l ^ (v & (p ^ l))) + R[3] - 1044525330), + (h = (((h << 22) | (h >>> 10)) + v) << 0)), + (l += (p ^ (h & (v ^ p))) + R[4] - 176418897), + (l = (((l << 7) | (l >>> 25)) + h) << 0), + (p += (v ^ (l & (h ^ v))) + R[5] + 1200080426), + (p = (((p << 12) | (p >>> 20)) + l) << 0), + (v += (h ^ (p & (l ^ h))) + R[6] - 1473231341), + (v = (((v << 17) | (v >>> 15)) + p) << 0), + (h += (l ^ (v & (p ^ l))) + R[7] - 45705983), + (h = (((h << 22) | (h >>> 10)) + v) << 0), + (l += (p ^ (h & (v ^ p))) + R[8] + 1770035416), + (l = (((l << 7) | (l >>> 25)) + h) << 0), + (p += (v ^ (l & (h ^ v))) + R[9] - 1958414417), + (p = (((p << 12) | (p >>> 20)) + l) << 0), + (v += (h ^ (p & (l ^ h))) + R[10] - 42063), + (v = (((v << 17) | (v >>> 15)) + p) << 0), + (h += (l ^ (v & (p ^ l))) + R[11] - 1990404162), + (h = (((h << 22) | (h >>> 10)) + v) << 0), + (l += (p ^ (h & (v ^ p))) + R[12] + 1804603682), + (l = (((l << 7) | (l >>> 25)) + h) << 0), + (p += (v ^ (l & (h ^ v))) + R[13] - 40341101), + (p = (((p << 12) | (p >>> 20)) + l) << 0), + (v += (h ^ (p & (l ^ h))) + R[14] - 1502002290), + (v = (((v << 17) | (v >>> 15)) + p) << 0), + (h += (l ^ (v & (p ^ l))) + R[15] + 1236535329), + (h = (((h << 22) | (h >>> 10)) + v) << 0), + (l += (v ^ (p & (h ^ v))) + R[1] - 165796510), + (l = (((l << 5) | (l >>> 27)) + h) << 0), + (p += (h ^ (v & (l ^ h))) + R[6] - 1069501632), + (p = (((p << 9) | (p >>> 23)) + l) << 0), + (v += (l ^ (h & (p ^ l))) + R[11] + 643717713), + (v = (((v << 14) | (v >>> 18)) + p) << 0), + (h += (p ^ (l & (v ^ p))) + R[0] - 373897302), + (h = (((h << 20) | (h >>> 12)) + v) << 0), + (l += (v ^ (p & (h ^ v))) + R[5] - 701558691), + (l = (((l << 5) | (l >>> 27)) + h) << 0), + (p += (h ^ (v & (l ^ h))) + R[10] + 38016083), + (p = (((p << 9) | (p >>> 23)) + l) << 0), + (v += (l ^ (h & (p ^ l))) + R[15] - 660478335), + (v = (((v << 14) | (v >>> 18)) + p) << 0), + (h += (p ^ (l & (v ^ p))) + R[4] - 405537848), + (h = (((h << 20) | (h >>> 12)) + v) << 0), + (l += (v ^ (p & (h ^ v))) + R[9] + 568446438), + (l = (((l << 5) | (l >>> 27)) + h) << 0), + (p += (h ^ (v & (l ^ h))) + R[14] - 1019803690), + (p = (((p << 9) | (p >>> 23)) + l) << 0), + (v += (l ^ (h & (p ^ l))) + R[3] - 187363961), + (v = (((v << 14) | (v >>> 18)) + p) << 0), + (h += (p ^ (l & (v ^ p))) + R[8] + 1163531501), + (h = (((h << 20) | (h >>> 12)) + v) << 0), + (l += (v ^ (p & (h ^ v))) + R[13] - 1444681467), + (l = (((l << 5) | (l >>> 27)) + h) << 0), + (p += (h ^ (v & (l ^ h))) + R[2] - 51403784), + (p = (((p << 9) | (p >>> 23)) + l) << 0), + (v += (l ^ (h & (p ^ l))) + R[7] + 1735328473), + (v = (((v << 14) | (v >>> 18)) + p) << 0), + (h += (p ^ (l & (v ^ p))) + R[12] - 1926607734), + (h = (((h << 20) | (h >>> 12)) + v) << 0), + (j = h ^ v), + (l += (j ^ p) + R[5] - 378558), + (l = (((l << 4) | (l >>> 28)) + h) << 0), + (p += (j ^ l) + R[8] - 2022574463), + (p = (((p << 11) | (p >>> 21)) + l) << 0), + (P = p ^ l), + (v += (P ^ h) + R[11] + 1839030562), + (v = (((v << 16) | (v >>> 16)) + p) << 0), + (h += (P ^ v) + R[14] - 35309556), + (h = (((h << 23) | (h >>> 9)) + v) << 0), + (j = h ^ v), + (l += (j ^ p) + R[1] - 1530992060), + (l = (((l << 4) | (l >>> 28)) + h) << 0), + (p += (j ^ l) + R[4] + 1272893353), + (p = (((p << 11) | (p >>> 21)) + l) << 0), + (P = p ^ l), + (v += (P ^ h) + R[7] - 155497632), + (v = (((v << 16) | (v >>> 16)) + p) << 0), + (h += (P ^ v) + R[10] - 1094730640), + (h = (((h << 23) | (h >>> 9)) + v) << 0), + (j = h ^ v), + (l += (j ^ p) + R[13] + 681279174), + (l = (((l << 4) | (l >>> 28)) + h) << 0), + (p += (j ^ l) + R[0] - 358537222), + (p = (((p << 11) | (p >>> 21)) + l) << 0), + (P = p ^ l), + (v += (P ^ h) + R[3] - 722521979), + (v = (((v << 16) | (v >>> 16)) + p) << 0), + (h += (P ^ v) + R[6] + 76029189), + (h = (((h << 23) | (h >>> 9)) + v) << 0), + (j = h ^ v), + (l += (j ^ p) + R[9] - 640364487), + (l = (((l << 4) | (l >>> 28)) + h) << 0), + (p += (j ^ l) + R[12] - 421815835), + (p = (((p << 11) | (p >>> 21)) + l) << 0), + (P = p ^ l), + (v += (P ^ h) + R[15] + 530742520), + (v = (((v << 16) | (v >>> 16)) + p) << 0), + (h += (P ^ v) + R[2] - 995338651), + (h = (((h << 23) | (h >>> 9)) + v) << 0), + (l += (v ^ (h | ~p)) + R[0] - 198630844), + (l = (((l << 6) | (l >>> 26)) + h) << 0), + (p += (h ^ (l | ~v)) + R[7] + 1126891415), + (p = (((p << 10) | (p >>> 22)) + l) << 0), + (v += (l ^ (p | ~h)) + R[14] - 1416354905), + (v = (((v << 15) | (v >>> 17)) + p) << 0), + (h += (p ^ (v | ~l)) + R[5] - 57434055), + (h = (((h << 21) | (h >>> 11)) + v) << 0), + (l += (v ^ (h | ~p)) + R[12] + 1700485571), + (l = (((l << 6) | (l >>> 26)) + h) << 0), + (p += (h ^ (l | ~v)) + R[3] - 1894986606), + (p = (((p << 10) | (p >>> 22)) + l) << 0), + (v += (l ^ (p | ~h)) + R[10] - 1051523), + (v = (((v << 15) | (v >>> 17)) + p) << 0), + (h += (p ^ (v | ~l)) + R[1] - 2054922799), + (h = (((h << 21) | (h >>> 11)) + v) << 0), + (l += (v ^ (h | ~p)) + R[8] + 1873313359), + (l = (((l << 6) | (l >>> 26)) + h) << 0), + (p += (h ^ (l | ~v)) + R[15] - 30611744), + (p = (((p << 10) | (p >>> 22)) + l) << 0), + (v += (l ^ (p | ~h)) + R[6] - 1560198380), + (v = (((v << 15) | (v >>> 17)) + p) << 0), + (h += (p ^ (v | ~l)) + R[13] + 1309151649), + (h = (((h << 21) | (h >>> 11)) + v) << 0), + (l += (v ^ (h | ~p)) + R[4] - 145523070), + (l = (((l << 6) | (l >>> 26)) + h) << 0), + (p += (h ^ (l | ~v)) + R[11] - 1120210379), + (p = (((p << 10) | (p >>> 22)) + l) << 0), + (v += (l ^ (p | ~h)) + R[2] + 718787259), + (v = (((v << 15) | (v >>> 17)) + p) << 0), + (h += (p ^ (v | ~l)) + R[9] - 343485551), + (h = (((h << 21) | (h >>> 11)) + v) << 0), + this.first + ? ((this.h0 = (l + 1732584193) << 0), + (this.h1 = (h - 271733879) << 0), + (this.h2 = (v - 1732584194) << 0), + (this.h3 = (p + 271733878) << 0), + (this.first = !1)) + : ((this.h0 = (this.h0 + l) << 0), + (this.h1 = (this.h1 + h) << 0), + (this.h2 = (this.h2 + v) << 0), + (this.h3 = (this.h3 + p) << 0))); + }), + (X.prototype.hex = function () { + this.finalize(); + var l = this.h0, + h = this.h1, + v = this.h2, + p = this.h3; + return ( + u[(l >>> 4) & 15] + + u[l & 15] + + u[(l >>> 12) & 15] + + u[(l >>> 8) & 15] + + u[(l >>> 20) & 15] + + u[(l >>> 16) & 15] + + u[(l >>> 28) & 15] + + u[(l >>> 24) & 15] + + u[(h >>> 4) & 15] + + u[h & 15] + + u[(h >>> 12) & 15] + + u[(h >>> 8) & 15] + + u[(h >>> 20) & 15] + + u[(h >>> 16) & 15] + + u[(h >>> 28) & 15] + + u[(h >>> 24) & 15] + + u[(v >>> 4) & 15] + + u[v & 15] + + u[(v >>> 12) & 15] + + u[(v >>> 8) & 15] + + u[(v >>> 20) & 15] + + u[(v >>> 16) & 15] + + u[(v >>> 28) & 15] + + u[(v >>> 24) & 15] + + u[(p >>> 4) & 15] + + u[p & 15] + + u[(p >>> 12) & 15] + + u[(p >>> 8) & 15] + + u[(p >>> 20) & 15] + + u[(p >>> 16) & 15] + + u[(p >>> 28) & 15] + + u[(p >>> 24) & 15] + ); + }), + (X.prototype.toString = X.prototype.hex), + (X.prototype.digest = function () { + this.finalize(); + var l = this.h0, + h = this.h1, + v = this.h2, + p = this.h3; + return [ + l & 255, + (l >>> 8) & 255, + (l >>> 16) & 255, + (l >>> 24) & 255, + h & 255, + (h >>> 8) & 255, + (h >>> 16) & 255, + (h >>> 24) & 255, + v & 255, + (v >>> 8) & 255, + (v >>> 16) & 255, + (v >>> 24) & 255, + p & 255, + (p >>> 8) & 255, + (p >>> 16) & 255, + (p >>> 24) & 255, + ]; + }), + (X.prototype.array = X.prototype.digest), + (X.prototype.arrayBuffer = function () { + this.finalize(); + var l = new ArrayBuffer(16), + h = new Uint32Array(l); + return ( + (h[0] = this.h0), + (h[1] = this.h1), + (h[2] = this.h2), + (h[3] = this.h3), + l + ); + }), + (X.prototype.buffer = X.prototype.arrayBuffer), + (X.prototype.base64 = function () { + for (var l, h, v, p = "", j = this.array(), P = 0; P < 15; ) + ((l = j[P++]), + (h = j[P++]), + (v = j[P++]), + (p += + S[l >>> 2] + + S[((l << 4) | (h >>> 4)) & 63] + + S[((h << 2) | (v >>> 6)) & 63] + + S[v & 63])); + return ( + (l = j[P]), + (p += S[l >>> 2] + S[(l << 4) & 63] + "=="), + p + ); + })); + function Q(l, h) { + var v, + p = N(l); + if (((l = p[0]), p[1])) { + var j = [], + P = l.length, + R = 0, + Z; + for (v = 0; v < P; ++v) + ((Z = l.charCodeAt(v)), + Z < 128 + ? (j[R++] = Z) + : Z < 2048 + ? ((j[R++] = 192 | (Z >>> 6)), + (j[R++] = 128 | (Z & 63))) + : Z < 55296 || Z >= 57344 + ? ((j[R++] = 224 | (Z >>> 12)), + (j[R++] = 128 | ((Z >>> 6) & 63)), + (j[R++] = 128 | (Z & 63))) + : ((Z = + 65536 + + (((Z & 1023) << 10) | + (l.charCodeAt(++v) & 1023))), + (j[R++] = 240 | (Z >>> 18)), + (j[R++] = 128 | ((Z >>> 12) & 63)), + (j[R++] = 128 | ((Z >>> 6) & 63)), + (j[R++] = 128 | (Z & 63)))); + l = j; + } + l.length > 64 && (l = new X(!0).update(l).array()); + var ze = [], + Rt = []; + for (v = 0; v < 64; ++v) { + var Ut = l[v] || 0; + ((ze[v] = 92 ^ Ut), (Rt[v] = 54 ^ Ut)); + } + (X.call(this, h), + this.update(Rt), + (this.oKeyPad = ze), + (this.inner = !0), + (this.sharedMemory = h)); + } + ((Q.prototype = new X()), + (Q.prototype.finalize = function () { + if ((X.prototype.finalize.call(this), this.inner)) { + this.inner = !1; + var l = this.array(); + (X.call(this, this.sharedMemory), + this.update(this.oKeyPad), + this.update(l), + X.prototype.finalize.call(this)); + } + })); + var me = ne(); + ((me.md5 = me), + (me.md5.hmac = de()), + a + ? (yr.exports = me) + : ((n.md5 = me), + c && + define(function () { + return me; + }))); + })(); + }); + var Hi = ["top", "right", "bottom", "left"], + Pi = ["start", "end"], + Mi = Hi.reduce( + (e, t) => e.concat(t, t + "-" + Pi[0], t + "-" + Pi[1]), + [], + ), + Et = Math.min, + tt = Math.max, + hr = Math.round, + pr = Math.floor, + nn = (e) => ({ x: e, y: e }), + ta = { left: "right", right: "left", bottom: "top", top: "bottom" }, + na = { start: "end", end: "start" }; + function Jr(e, t, r) { + return tt(e, Et(t, r)); + } + function jt(e, t) { + return typeof e == "function" ? e(t) : e; + } + function pt(e) { + return e.split("-")[0]; + } + function xt(e) { + return e.split("-")[1]; + } + function $i(e) { + return e === "x" ? "y" : "x"; + } + function Qr(e) { + return e === "y" ? "height" : "width"; + } + function Pn(e) { + return ["top", "bottom"].includes(pt(e)) ? "y" : "x"; + } + function Zr(e) { + return $i(Pn(e)); + } + function Wi(e, t, r) { + r === void 0 && (r = !1); + let n = xt(e), + i = Zr(e), + o = Qr(i), + a = + i === "x" + ? n === (r ? "end" : "start") + ? "right" + : "left" + : n === "start" + ? "bottom" + : "top"; + return (t.reference[o] > t.floating[o] && (a = mr(a)), [a, mr(a)]); + } + function ra(e) { + let t = mr(e); + return [vr(e), t, vr(t)]; + } + function vr(e) { + return e.replace(/start|end/g, (t) => na[t]); + } + function ia(e, t, r) { + let n = ["left", "right"], + i = ["right", "left"], + o = ["top", "bottom"], + a = ["bottom", "top"]; + switch (e) { + case "top": + case "bottom": + return r ? (t ? i : n) : t ? n : i; + case "left": + case "right": + return t ? o : a; + default: + return []; + } + } + function oa(e, t, r, n) { + let i = xt(e), + o = ia(pt(e), r === "start", n); + return ( + i && + ((o = o.map((a) => a + "-" + i)), + t && (o = o.concat(o.map(vr)))), + o + ); + } + function mr(e) { + return e.replace(/left|right|bottom|top/g, (t) => ta[t]); + } + function aa(e) { + return { top: 0, right: 0, bottom: 0, left: 0, ...e }; + } + function ei(e) { + return typeof e != "number" + ? aa(e) + : { top: e, right: e, bottom: e, left: e }; + } + function Dn(e) { + return { + ...e, + top: e.y, + left: e.x, + right: e.x + e.width, + bottom: e.y + e.height, + }; + } + function Ri(e, t, r) { + let { reference: n, floating: i } = e, + o = Pn(t), + a = Zr(t), + c = Qr(a), + f = pt(t), + u = o === "y", + y = n.x + n.width / 2 - i.width / 2, + m = n.y + n.height / 2 - i.height / 2, + O = n[c] / 2 - i[c] / 2, + S; + switch (f) { + case "top": + S = { x: y, y: n.y - i.height }; + break; + case "bottom": + S = { x: y, y: n.y + n.height }; + break; + case "right": + S = { x: n.x + n.width, y: m }; + break; + case "left": + S = { x: n.x - i.width, y: m }; + break; + default: + S = { x: n.x, y: n.y }; + } + switch (xt(t)) { + case "start": + S[a] -= O * (r && u ? -1 : 1); + break; + case "end": + S[a] += O * (r && u ? -1 : 1); + break; + } + return S; + } + var sa = async (e, t, r) => { + let { + placement: n = "bottom", + strategy: i = "absolute", + middleware: o = [], + platform: a, + } = r, + c = o.filter(Boolean), + f = await (a.isRTL == null ? void 0 : a.isRTL(t)), + u = await a.getElementRects({ + reference: e, + floating: t, + strategy: i, + }), + { x: y, y: m } = Ri(u, n, f), + O = n, + S = {}, + x = 0; + for (let M = 0; M < c.length; M++) { + let { name: I, fn: $ } = c[M], + { + x: A, + y: N, + data: Y, + reset: ne, + } = await $({ + x: y, + y: m, + initialPlacement: n, + placement: O, + strategy: i, + middlewareData: S, + rects: u, + platform: a, + elements: { reference: e, floating: t }, + }); + ((y = A ?? y), + (m = N ?? m), + (S = { ...S, [I]: { ...S[I], ...Y } }), + ne && + x <= 50 && + (x++, + typeof ne == "object" && + (ne.placement && (O = ne.placement), + ne.rects && + (u = + ne.rects === !0 + ? await a.getElementRects({ + reference: e, + floating: t, + strategy: i, + }) + : ne.rects), + ({ x: y, y: m } = Ri(u, O, f))), + (M = -1))); + } + return { x: y, y: m, placement: O, strategy: i, middlewareData: S }; + }; + async function _n(e, t) { + var r; + t === void 0 && (t = {}); + let { x: n, y: i, platform: o, rects: a, elements: c, strategy: f } = e, + { + boundary: u = "clippingAncestors", + rootBoundary: y = "viewport", + elementContext: m = "floating", + altBoundary: O = !1, + padding: S = 0, + } = jt(t, e), + x = ei(S), + I = c[O ? (m === "floating" ? "reference" : "floating") : m], + $ = Dn( + await o.getClippingRect({ + element: + (r = await (o.isElement == null + ? void 0 + : o.isElement(I))) == null || r + ? I + : I.contextElement || + (await (o.getDocumentElement == null + ? void 0 + : o.getDocumentElement(c.floating))), + boundary: u, + rootBoundary: y, + strategy: f, + }), + ), + A = m === "floating" ? { ...a.floating, x: n, y: i } : a.reference, + N = await (o.getOffsetParent == null + ? void 0 + : o.getOffsetParent(c.floating)), + Y = (await (o.isElement == null ? void 0 : o.isElement(N))) + ? (await (o.getScale == null ? void 0 : o.getScale(N))) || { + x: 1, + y: 1, + } + : { x: 1, y: 1 }, + ne = Dn( + o.convertOffsetParentRelativeRectToViewportRelativeRect + ? await o.convertOffsetParentRelativeRectToViewportRelativeRect( + { + elements: c, + rect: A, + offsetParent: N, + strategy: f, + }, + ) + : A, + ); + return { + top: ($.top - ne.top + x.top) / Y.y, + bottom: (ne.bottom - $.bottom + x.bottom) / Y.y, + left: ($.left - ne.left + x.left) / Y.x, + right: (ne.right - $.right + x.right) / Y.x, + }; + } + var la = (e) => ({ + name: "arrow", + options: e, + async fn(t) { + let { + x: r, + y: n, + placement: i, + rects: o, + platform: a, + elements: c, + middlewareData: f, + } = t, + { element: u, padding: y = 0 } = jt(e, t) || {}; + if (u == null) return {}; + let m = ei(y), + O = { x: r, y: n }, + S = Zr(i), + x = Qr(S), + M = await a.getDimensions(u), + I = S === "y", + $ = I ? "top" : "left", + A = I ? "bottom" : "right", + N = I ? "clientHeight" : "clientWidth", + Y = o.reference[x] + o.reference[S] - O[S] - o.floating[x], + ne = O[S] - o.reference[S], + J = await (a.getOffsetParent == null + ? void 0 + : a.getOffsetParent(u)), + V = J ? J[N] : 0; + (!V || !(await (a.isElement == null ? void 0 : a.isElement(J)))) && + (V = c.floating[N] || o.floating[x]); + let de = Y / 2 - ne / 2, + X = V / 2 - M[x] / 2 - 1, + Q = Et(m[$], X), + me = Et(m[A], X), + l = Q, + h = V - M[x] - me, + v = V / 2 - M[x] / 2 + de, + p = Jr(l, v, h), + j = + !f.arrow && + xt(i) != null && + v !== p && + o.reference[x] / 2 - (v < l ? Q : me) - M[x] / 2 < 0, + P = j ? (v < l ? v - l : v - h) : 0; + return { + [S]: O[S] + P, + data: { + [S]: p, + centerOffset: v - p - P, + ...(j && { alignmentOffset: P }), + }, + reset: j, + }; + }, + }); + function ca(e, t, r) { + return ( + e + ? [ + ...r.filter((i) => xt(i) === e), + ...r.filter((i) => xt(i) !== e), + ] + : r.filter((i) => pt(i) === i) + ).filter((i) => (e ? xt(i) === e || (t ? vr(i) !== i : !1) : !0)); + } + var fa = function (e) { + return ( + e === void 0 && (e = {}), + { + name: "autoPlacement", + options: e, + async fn(t) { + var r, n, i; + let { + rects: o, + middlewareData: a, + placement: c, + platform: f, + elements: u, + } = t, + { + crossAxis: y = !1, + alignment: m, + allowedPlacements: O = Mi, + autoAlignment: S = !0, + ...x + } = jt(e, t), + M = + m !== void 0 || O === Mi + ? ca(m || null, S, O) + : O, + I = await _n(t, x), + $ = + ((r = a.autoPlacement) == null + ? void 0 + : r.index) || 0, + A = M[$]; + if (A == null) return {}; + let N = Wi( + A, + o, + await (f.isRTL == null + ? void 0 + : f.isRTL(u.floating)), + ); + if (c !== A) return { reset: { placement: M[0] } }; + let Y = [I[pt(A)], I[N[0]], I[N[1]]], + ne = [ + ...(((n = a.autoPlacement) == null + ? void 0 + : n.overflows) || []), + { placement: A, overflows: Y }, + ], + J = M[$ + 1]; + if (J) + return { + data: { index: $ + 1, overflows: ne }, + reset: { placement: J }, + }; + let V = ne + .map((Q) => { + let me = xt(Q.placement); + return [ + Q.placement, + me && y + ? Q.overflows + .slice(0, 2) + .reduce((l, h) => l + h, 0) + : Q.overflows[0], + Q.overflows, + ]; + }) + .sort((Q, me) => Q[1] - me[1]), + X = + ((i = V.filter((Q) => + Q[2] + .slice(0, xt(Q[0]) ? 2 : 3) + .every((me) => me <= 0), + )[0]) == null + ? void 0 + : i[0]) || V[0][0]; + return X !== c + ? { + data: { index: $ + 1, overflows: ne }, + reset: { placement: X }, + } + : {}; + }, + } + ); + }, + ua = function (e) { + return ( + e === void 0 && (e = {}), + { + name: "flip", + options: e, + async fn(t) { + var r, n; + let { + placement: i, + middlewareData: o, + rects: a, + initialPlacement: c, + platform: f, + elements: u, + } = t, + { + mainAxis: y = !0, + crossAxis: m = !0, + fallbackPlacements: O, + fallbackStrategy: S = "bestFit", + fallbackAxisSideDirection: x = "none", + flipAlignment: M = !0, + ...I + } = jt(e, t); + if ((r = o.arrow) != null && r.alignmentOffset) + return {}; + let $ = pt(i), + A = pt(c) === c, + N = await (f.isRTL == null + ? void 0 + : f.isRTL(u.floating)), + Y = O || (A || !M ? [mr(c)] : ra(c)); + !O && x !== "none" && Y.push(...oa(c, M, x, N)); + let ne = [c, ...Y], + J = await _n(t, I), + V = [], + de = + ((n = o.flip) == null ? void 0 : n.overflows) || + []; + if ((y && V.push(J[$]), m)) { + let l = Wi(i, a, N); + V.push(J[l[0]], J[l[1]]); + } + if ( + ((de = [...de, { placement: i, overflows: V }]), + !V.every((l) => l <= 0)) + ) { + var X, Q; + let l = + (((X = o.flip) == null + ? void 0 + : X.index) || 0) + 1, + h = ne[l]; + if (h) + return { + data: { index: l, overflows: de }, + reset: { placement: h }, + }; + let v = + (Q = de + .filter((p) => p.overflows[0] <= 0) + .sort( + (p, j) => + p.overflows[1] - j.overflows[1], + )[0]) == null + ? void 0 + : Q.placement; + if (!v) + switch (S) { + case "bestFit": { + var me; + let p = + (me = de + .map((j) => [ + j.placement, + j.overflows + .filter((P) => P > 0) + .reduce( + (P, R) => P + R, + 0, + ), + ]) + .sort( + (j, P) => j[1] - P[1], + )[0]) == null + ? void 0 + : me[0]; + p && (v = p); + break; + } + case "initialPlacement": + v = c; + break; + } + if (i !== v) return { reset: { placement: v } }; + } + return {}; + }, + } + ); + }; + function Ii(e, t) { + return { + top: e.top - t.height, + right: e.right - t.width, + bottom: e.bottom - t.height, + left: e.left - t.width, + }; + } + function Li(e) { + return Hi.some((t) => e[t] >= 0); + } + var da = function (e) { + return ( + e === void 0 && (e = {}), + { + name: "hide", + options: e, + async fn(t) { + let { rects: r } = t, + { strategy: n = "referenceHidden", ...i } = jt(e, t); + switch (n) { + case "referenceHidden": { + let o = await _n(t, { + ...i, + elementContext: "reference", + }), + a = Ii(o, r.reference); + return { + data: { + referenceHiddenOffsets: a, + referenceHidden: Li(a), + }, + }; + } + case "escaped": { + let o = await _n(t, { ...i, altBoundary: !0 }), + a = Ii(o, r.floating); + return { + data: { escapedOffsets: a, escaped: Li(a) }, + }; + } + default: + return {}; + } + }, + } + ); + }; + function Ui(e) { + let t = Et(...e.map((o) => o.left)), + r = Et(...e.map((o) => o.top)), + n = tt(...e.map((o) => o.right)), + i = tt(...e.map((o) => o.bottom)); + return { x: t, y: r, width: n - t, height: i - r }; + } + function pa(e) { + let t = e.slice().sort((i, o) => i.y - o.y), + r = [], + n = null; + for (let i = 0; i < t.length; i++) { + let o = t[i]; + (!n || o.y - n.y > n.height / 2 + ? r.push([o]) + : r[r.length - 1].push(o), + (n = o)); + } + return r.map((i) => Dn(Ui(i))); + } + var ha = function (e) { + return ( + e === void 0 && (e = {}), + { + name: "inline", + options: e, + async fn(t) { + let { + placement: r, + elements: n, + rects: i, + platform: o, + strategy: a, + } = t, + { padding: c = 2, x: f, y: u } = jt(e, t), + y = Array.from( + (await (o.getClientRects == null + ? void 0 + : o.getClientRects(n.reference))) || [], + ), + m = pa(y), + O = Dn(Ui(y)), + S = ei(c); + function x() { + if ( + m.length === 2 && + m[0].left > m[1].right && + f != null && + u != null + ) + return ( + m.find( + (I) => + f > I.left - S.left && + f < I.right + S.right && + u > I.top - S.top && + u < I.bottom + S.bottom, + ) || O + ); + if (m.length >= 2) { + if (Pn(r) === "y") { + let Q = m[0], + me = m[m.length - 1], + l = pt(r) === "top", + h = Q.top, + v = me.bottom, + p = l ? Q.left : me.left, + j = l ? Q.right : me.right, + P = j - p, + R = v - h; + return { + top: h, + bottom: v, + left: p, + right: j, + width: P, + height: R, + x: p, + y: h, + }; + } + let I = pt(r) === "left", + $ = tt(...m.map((Q) => Q.right)), + A = Et(...m.map((Q) => Q.left)), + N = m.filter((Q) => + I ? Q.left === A : Q.right === $, + ), + Y = N[0].top, + ne = N[N.length - 1].bottom, + J = A, + V = $, + de = V - J, + X = ne - Y; + return { + top: Y, + bottom: ne, + left: J, + right: V, + width: de, + height: X, + x: J, + y: Y, + }; + } + return O; + } + let M = await o.getElementRects({ + reference: { getBoundingClientRect: x }, + floating: n.floating, + strategy: a, + }); + return i.reference.x !== M.reference.x || + i.reference.y !== M.reference.y || + i.reference.width !== M.reference.width || + i.reference.height !== M.reference.height + ? { reset: { rects: M } } + : {}; + }, + } + ); + }; + async function va(e, t) { + let { placement: r, platform: n, elements: i } = e, + o = await (n.isRTL == null ? void 0 : n.isRTL(i.floating)), + a = pt(r), + c = xt(r), + f = Pn(r) === "y", + u = ["left", "top"].includes(a) ? -1 : 1, + y = o && f ? -1 : 1, + m = jt(t, e), + { + mainAxis: O, + crossAxis: S, + alignmentAxis: x, + } = typeof m == "number" + ? { mainAxis: m, crossAxis: 0, alignmentAxis: null } + : { mainAxis: 0, crossAxis: 0, alignmentAxis: null, ...m }; + return ( + c && typeof x == "number" && (S = c === "end" ? x * -1 : x), + f ? { x: S * y, y: O * u } : { x: O * u, y: S * y } + ); + } + var Vi = function (e) { + return ( + e === void 0 && (e = 0), + { + name: "offset", + options: e, + async fn(t) { + var r, n; + let { x: i, y: o, placement: a, middlewareData: c } = t, + f = await va(t, e); + return a === + ((r = c.offset) == null ? void 0 : r.placement) && + (n = c.arrow) != null && + n.alignmentOffset + ? {} + : { + x: i + f.x, + y: o + f.y, + data: { ...f, placement: a }, + }; + }, + } + ); + }, + ma = function (e) { + return ( + e === void 0 && (e = {}), + { + name: "shift", + options: e, + async fn(t) { + let { x: r, y: n, placement: i } = t, + { + mainAxis: o = !0, + crossAxis: a = !1, + limiter: c = { + fn: (I) => { + let { x: $, y: A } = I; + return { x: $, y: A }; + }, + }, + ...f + } = jt(e, t), + u = { x: r, y: n }, + y = await _n(t, f), + m = Pn(pt(i)), + O = $i(m), + S = u[O], + x = u[m]; + if (o) { + let I = O === "y" ? "top" : "left", + $ = O === "y" ? "bottom" : "right", + A = S + y[I], + N = S - y[$]; + S = Jr(A, S, N); + } + if (a) { + let I = m === "y" ? "top" : "left", + $ = m === "y" ? "bottom" : "right", + A = x + y[I], + N = x - y[$]; + x = Jr(A, x, N); + } + let M = c.fn({ ...t, [O]: S, [m]: x }); + return { ...M, data: { x: M.x - r, y: M.y - n } }; + }, + } + ); + }, + ga = function (e) { + return ( + e === void 0 && (e = {}), + { + name: "size", + options: e, + async fn(t) { + let { + placement: r, + rects: n, + platform: i, + elements: o, + } = t, + { apply: a = () => {}, ...c } = jt(e, t), + f = await _n(t, c), + u = pt(r), + y = xt(r), + m = Pn(r) === "y", + { width: O, height: S } = n.floating, + x, + M; + u === "top" || u === "bottom" + ? ((x = u), + (M = + y === + ((await (i.isRTL == null + ? void 0 + : i.isRTL(o.floating))) + ? "start" + : "end") + ? "left" + : "right")) + : ((M = u), (x = y === "end" ? "top" : "bottom")); + let I = S - f[x], + $ = O - f[M], + A = !t.middlewareData.shift, + N = I, + Y = $; + if (m) { + let J = O - f.left - f.right; + Y = y || A ? Et($, J) : J; + } else { + let J = S - f.top - f.bottom; + N = y || A ? Et(I, J) : J; + } + if (A && !y) { + let J = tt(f.left, 0), + V = tt(f.right, 0), + de = tt(f.top, 0), + X = tt(f.bottom, 0); + m + ? (Y = + O - + 2 * + (J !== 0 || V !== 0 + ? J + V + : tt(f.left, f.right))) + : (N = + S - + 2 * + (de !== 0 || X !== 0 + ? de + X + : tt(f.top, f.bottom))); + } + await a({ + ...t, + availableWidth: Y, + availableHeight: N, + }); + let ne = await i.getDimensions(o.floating); + return O !== ne.width || S !== ne.height + ? { reset: { rects: !0 } } + : {}; + }, + } + ); + }; + function rn(e) { + return zi(e) ? (e.nodeName || "").toLowerCase() : "#document"; + } + function ct(e) { + var t; + return ( + (e == null || (t = e.ownerDocument) == null + ? void 0 + : t.defaultView) || window + ); + } + function Bt(e) { + var t; + return (t = + (zi(e) ? e.ownerDocument : e.document) || window.document) == null + ? void 0 + : t.documentElement; + } + function zi(e) { + return e instanceof Node || e instanceof ct(e).Node; + } + function Nt(e) { + return e instanceof Element || e instanceof ct(e).Element; + } + function Tt(e) { + return e instanceof HTMLElement || e instanceof ct(e).HTMLElement; + } + function Fi(e) { + return typeof ShadowRoot > "u" + ? !1 + : e instanceof ShadowRoot || e instanceof ct(e).ShadowRoot; + } + function zn(e) { + let { overflow: t, overflowX: r, overflowY: n, display: i } = ht(e); + return ( + /auto|scroll|overlay|hidden|clip/.test(t + n + r) && + !["inline", "contents"].includes(i) + ); + } + function ba(e) { + return ["table", "td", "th"].includes(rn(e)); + } + function ti(e) { + let t = ni(), + r = ht(e); + return ( + r.transform !== "none" || + r.perspective !== "none" || + (r.containerType ? r.containerType !== "normal" : !1) || + (!t && (r.backdropFilter ? r.backdropFilter !== "none" : !1)) || + (!t && (r.filter ? r.filter !== "none" : !1)) || + ["transform", "perspective", "filter"].some((n) => + (r.willChange || "").includes(n), + ) || + ["paint", "layout", "strict", "content"].some((n) => + (r.contain || "").includes(n), + ) + ); + } + function ya(e) { + let t = Tn(e); + for (; Tt(t) && !gr(t); ) { + if (ti(t)) return t; + t = Tn(t); + } + return null; + } + function ni() { + return typeof CSS > "u" || !CSS.supports + ? !1 + : CSS.supports("-webkit-backdrop-filter", "none"); + } + function gr(e) { + return ["html", "body", "#document"].includes(rn(e)); + } + function ht(e) { + return ct(e).getComputedStyle(e); + } + function br(e) { + return Nt(e) + ? { scrollLeft: e.scrollLeft, scrollTop: e.scrollTop } + : { scrollLeft: e.pageXOffset, scrollTop: e.pageYOffset }; + } + function Tn(e) { + if (rn(e) === "html") return e; + let t = e.assignedSlot || e.parentNode || (Fi(e) && e.host) || Bt(e); + return Fi(t) ? t.host : t; + } + function Yi(e) { + let t = Tn(e); + return gr(t) + ? e.ownerDocument + ? e.ownerDocument.body + : e.body + : Tt(t) && zn(t) + ? t + : Yi(t); + } + function Vn(e, t, r) { + var n; + (t === void 0 && (t = []), r === void 0 && (r = !0)); + let i = Yi(e), + o = i === ((n = e.ownerDocument) == null ? void 0 : n.body), + a = ct(i); + return o + ? t.concat( + a, + a.visualViewport || [], + zn(i) ? i : [], + a.frameElement && r ? Vn(a.frameElement) : [], + ) + : t.concat(i, Vn(i, [], r)); + } + function Xi(e) { + let t = ht(e), + r = parseFloat(t.width) || 0, + n = parseFloat(t.height) || 0, + i = Tt(e), + o = i ? e.offsetWidth : r, + a = i ? e.offsetHeight : n, + c = hr(r) !== o || hr(n) !== a; + return (c && ((r = o), (n = a)), { width: r, height: n, $: c }); + } + function ri(e) { + return Nt(e) ? e : e.contextElement; + } + function Cn(e) { + let t = ri(e); + if (!Tt(t)) return nn(1); + let r = t.getBoundingClientRect(), + { width: n, height: i, $: o } = Xi(t), + a = (o ? hr(r.width) : r.width) / n, + c = (o ? hr(r.height) : r.height) / i; + return ( + (!a || !Number.isFinite(a)) && (a = 1), + (!c || !Number.isFinite(c)) && (c = 1), + { x: a, y: c } + ); + } + var wa = nn(0); + function qi(e) { + let t = ct(e); + return !ni() || !t.visualViewport + ? wa + : { x: t.visualViewport.offsetLeft, y: t.visualViewport.offsetTop }; + } + function xa(e, t, r) { + return (t === void 0 && (t = !1), !r || (t && r !== ct(e)) ? !1 : t); + } + function vn(e, t, r, n) { + (t === void 0 && (t = !1), r === void 0 && (r = !1)); + let i = e.getBoundingClientRect(), + o = ri(e), + a = nn(1); + t && (n ? Nt(n) && (a = Cn(n)) : (a = Cn(e))); + let c = xa(o, r, n) ? qi(o) : nn(0), + f = (i.left + c.x) / a.x, + u = (i.top + c.y) / a.y, + y = i.width / a.x, + m = i.height / a.y; + if (o) { + let O = ct(o), + S = n && Nt(n) ? ct(n) : n, + x = O, + M = x.frameElement; + for (; M && n && S !== x; ) { + let I = Cn(M), + $ = M.getBoundingClientRect(), + A = ht(M), + N = + $.left + + (M.clientLeft + parseFloat(A.paddingLeft)) * I.x, + Y = $.top + (M.clientTop + parseFloat(A.paddingTop)) * I.y; + ((f *= I.x), + (u *= I.y), + (y *= I.x), + (m *= I.y), + (f += N), + (u += Y), + (x = ct(M)), + (M = x.frameElement)); + } + } + return Dn({ width: y, height: m, x: f, y: u }); + } + var Ea = [":popover-open", ":modal"]; + function Gi(e) { + return Ea.some((t) => { + try { + return e.matches(t); + } catch { + return !1; + } + }); + } + function Oa(e) { + let { elements: t, rect: r, offsetParent: n, strategy: i } = e, + o = i === "fixed", + a = Bt(n), + c = t ? Gi(t.floating) : !1; + if (n === a || (c && o)) return r; + let f = { scrollLeft: 0, scrollTop: 0 }, + u = nn(1), + y = nn(0), + m = Tt(n); + if ( + (m || (!m && !o)) && + ((rn(n) !== "body" || zn(a)) && (f = br(n)), Tt(n)) + ) { + let O = vn(n); + ((u = Cn(n)), + (y.x = O.x + n.clientLeft), + (y.y = O.y + n.clientTop)); + } + return { + width: r.width * u.x, + height: r.height * u.y, + x: r.x * u.x - f.scrollLeft * u.x + y.x, + y: r.y * u.y - f.scrollTop * u.y + y.y, + }; + } + function Sa(e) { + return Array.from(e.getClientRects()); + } + function Ki(e) { + return vn(Bt(e)).left + br(e).scrollLeft; + } + function Aa(e) { + let t = Bt(e), + r = br(e), + n = e.ownerDocument.body, + i = tt(t.scrollWidth, t.clientWidth, n.scrollWidth, n.clientWidth), + o = tt( + t.scrollHeight, + t.clientHeight, + n.scrollHeight, + n.clientHeight, + ), + a = -r.scrollLeft + Ki(e), + c = -r.scrollTop; + return ( + ht(n).direction === "rtl" && + (a += tt(t.clientWidth, n.clientWidth) - i), + { width: i, height: o, x: a, y: c } + ); + } + function Ca(e, t) { + let r = ct(e), + n = Bt(e), + i = r.visualViewport, + o = n.clientWidth, + a = n.clientHeight, + c = 0, + f = 0; + if (i) { + ((o = i.width), (a = i.height)); + let u = ni(); + (!u || (u && t === "fixed")) && + ((c = i.offsetLeft), (f = i.offsetTop)); + } + return { width: o, height: a, x: c, y: f }; + } + function Da(e, t) { + let r = vn(e, !0, t === "fixed"), + n = r.top + e.clientTop, + i = r.left + e.clientLeft, + o = Tt(e) ? Cn(e) : nn(1), + a = e.clientWidth * o.x, + c = e.clientHeight * o.y, + f = i * o.x, + u = n * o.y; + return { width: a, height: c, x: f, y: u }; + } + function ki(e, t, r) { + let n; + if (t === "viewport") n = Ca(e, r); + else if (t === "document") n = Aa(Bt(e)); + else if (Nt(t)) n = Da(t, r); + else { + let i = qi(e); + n = { ...t, x: t.x - i.x, y: t.y - i.y }; + } + return Dn(n); + } + function Ji(e, t) { + let r = Tn(e); + return r === t || !Nt(r) || gr(r) + ? !1 + : ht(r).position === "fixed" || Ji(r, t); + } + function _a(e, t) { + let r = t.get(e); + if (r) return r; + let n = Vn(e, [], !1).filter((c) => Nt(c) && rn(c) !== "body"), + i = null, + o = ht(e).position === "fixed", + a = o ? Tn(e) : e; + for (; Nt(a) && !gr(a); ) { + let c = ht(a), + f = ti(a); + (!f && c.position === "fixed" && (i = null), + ( + o + ? !f && !i + : (!f && + c.position === "static" && + !!i && + ["absolute", "fixed"].includes(i.position)) || + (zn(a) && !f && Ji(e, a)) + ) + ? (n = n.filter((y) => y !== a)) + : (i = c), + (a = Tn(a))); + } + return (t.set(e, n), n); + } + function Ta(e) { + let { element: t, boundary: r, rootBoundary: n, strategy: i } = e, + a = [ + ...(r === "clippingAncestors" ? _a(t, this._c) : [].concat(r)), + n, + ], + c = a[0], + f = a.reduce( + (u, y) => { + let m = ki(t, y, i); + return ( + (u.top = tt(m.top, u.top)), + (u.right = Et(m.right, u.right)), + (u.bottom = Et(m.bottom, u.bottom)), + (u.left = tt(m.left, u.left)), + u + ); + }, + ki(t, c, i), + ); + return { + width: f.right - f.left, + height: f.bottom - f.top, + x: f.left, + y: f.top, + }; + } + function Pa(e) { + let { width: t, height: r } = Xi(e); + return { width: t, height: r }; + } + function Ma(e, t, r) { + let n = Tt(t), + i = Bt(t), + o = r === "fixed", + a = vn(e, !0, o, t), + c = { scrollLeft: 0, scrollTop: 0 }, + f = nn(0); + if (n || (!n && !o)) + if (((rn(t) !== "body" || zn(i)) && (c = br(t)), n)) { + let m = vn(t, !0, o, t); + ((f.x = m.x + t.clientLeft), (f.y = m.y + t.clientTop)); + } else i && (f.x = Ki(i)); + let u = a.left + c.scrollLeft - f.x, + y = a.top + c.scrollTop - f.y; + return { x: u, y, width: a.width, height: a.height }; + } + function Ni(e, t) { + return !Tt(e) || ht(e).position === "fixed" + ? null + : t + ? t(e) + : e.offsetParent; + } + function Qi(e, t) { + let r = ct(e); + if (!Tt(e) || Gi(e)) return r; + let n = Ni(e, t); + for (; n && ba(n) && ht(n).position === "static"; ) n = Ni(n, t); + return n && + (rn(n) === "html" || + (rn(n) === "body" && ht(n).position === "static" && !ti(n))) + ? r + : n || ya(e) || r; + } + var Ra = async function (e) { + let t = this.getOffsetParent || Qi, + r = this.getDimensions; + return { + reference: Ma(e.reference, await t(e.floating), e.strategy), + floating: { x: 0, y: 0, ...(await r(e.floating)) }, + }; + }; + function Ia(e) { + return ht(e).direction === "rtl"; + } + var La = { + convertOffsetParentRelativeRectToViewportRelativeRect: Oa, + getDocumentElement: Bt, + getClippingRect: Ta, + getOffsetParent: Qi, + getElementRects: Ra, + getClientRects: Sa, + getDimensions: Pa, + getScale: Cn, + isElement: Nt, + isRTL: Ia, + }; + function Fa(e, t) { + let r = null, + n, + i = Bt(e); + function o() { + var c; + (clearTimeout(n), (c = r) == null || c.disconnect(), (r = null)); + } + function a(c, f) { + (c === void 0 && (c = !1), f === void 0 && (f = 1), o()); + let { + left: u, + top: y, + width: m, + height: O, + } = e.getBoundingClientRect(); + if ((c || t(), !m || !O)) return; + let S = pr(y), + x = pr(i.clientWidth - (u + m)), + M = pr(i.clientHeight - (y + O)), + I = pr(u), + A = { + rootMargin: + -S + "px " + -x + "px " + -M + "px " + -I + "px", + threshold: tt(0, Et(1, f)) || 1, + }, + N = !0; + function Y(ne) { + let J = ne[0].intersectionRatio; + if (J !== f) { + if (!N) return a(); + J + ? a(!1, J) + : (n = setTimeout(() => { + a(!1, 1e-7); + }, 100)); + } + N = !1; + } + try { + r = new IntersectionObserver(Y, { + ...A, + root: i.ownerDocument, + }); + } catch { + r = new IntersectionObserver(Y, A); + } + r.observe(e); + } + return (a(!0), o); + } + function ji(e, t, r, n) { + n === void 0 && (n = {}); + let { + ancestorScroll: i = !0, + ancestorResize: o = !0, + elementResize: a = typeof ResizeObserver == "function", + layoutShift: c = typeof IntersectionObserver == "function", + animationFrame: f = !1, + } = n, + u = ri(e), + y = i || o ? [...(u ? Vn(u) : []), ...Vn(t)] : []; + y.forEach(($) => { + (i && $.addEventListener("scroll", r, { passive: !0 }), + o && $.addEventListener("resize", r)); + }); + let m = u && c ? Fa(u, r) : null, + O = -1, + S = null; + a && + ((S = new ResizeObserver(($) => { + let [A] = $; + (A && + A.target === u && + S && + (S.unobserve(t), + cancelAnimationFrame(O), + (O = requestAnimationFrame(() => { + var N; + (N = S) == null || N.observe(t); + }))), + r()); + })), + u && !f && S.observe(u), + S.observe(t)); + let x, + M = f ? vn(e) : null; + f && I(); + function I() { + let $ = vn(e); + (M && + ($.x !== M.x || + $.y !== M.y || + $.width !== M.width || + $.height !== M.height) && + r(), + (M = $), + (x = requestAnimationFrame(I))); + } + return ( + r(), + () => { + var $; + (y.forEach((A) => { + (i && A.removeEventListener("scroll", r), + o && A.removeEventListener("resize", r)); + }), + m?.(), + ($ = S) == null || $.disconnect(), + (S = null), + f && cancelAnimationFrame(x)); + } + ); + } + var ii = fa, + Zi = ma, + eo = ua, + to = ga, + no = da, + ro = la, + io = ha, + Bi = (e, t, r) => { + let n = new Map(), + i = { platform: La, ...r }, + o = { ...i.platform, _c: n }; + return sa(e, t, { ...i, platform: o }); + }, + ka = (e) => { + let t = { + placement: "bottom", + strategy: "absolute", + middleware: [], + }, + r = Object.keys(e), + n = (i) => e[i]; + return ( + r.includes("offset") && t.middleware.push(Vi(n("offset"))), + r.includes("teleport") && (t.strategy = "fixed"), + r.includes("placement") && (t.placement = n("placement")), + r.some((i) => /^auto-?placement$/i.test(i)) && + !r.includes("flip") && + t.middleware.push(ii(n("autoPlacement"))), + r.includes("flip") && t.middleware.push(eo(n("flip"))), + r.includes("shift") && t.middleware.push(Zi(n("shift"))), + r.includes("inline") && t.middleware.push(io(n("inline"))), + r.includes("arrow") && t.middleware.push(ro(n("arrow"))), + r.includes("hide") && t.middleware.push(no(n("hide"))), + r.includes("size") && t.middleware.push(to(n("size"))), + t + ); + }, + Na = (e, t) => { + let r = { + component: { trap: !1 }, + float: { + placement: "bottom", + strategy: "absolute", + middleware: [], + }, + }, + n = (i) => e[e.indexOf(i) + 1]; + if ( + (e.includes("trap") && (r.component.trap = !0), + e.includes("teleport") && (r.float.strategy = "fixed"), + e.includes("offset") && + r.float.middleware.push(Vi(t.offset || 10)), + e.includes("placement") && (r.float.placement = n("placement")), + e.some((i) => /^auto-?placement$/i.test(i)) && + !e.includes("flip") && + r.float.middleware.push(ii(t.autoPlacement)), + e.includes("flip") && r.float.middleware.push(eo(t.flip)), + e.includes("shift") && r.float.middleware.push(Zi(t.shift)), + e.includes("inline") && r.float.middleware.push(io(t.inline)), + e.includes("arrow") && r.float.middleware.push(ro(t.arrow)), + e.includes("hide") && r.float.middleware.push(no(t.hide)), + e.includes("size")) + ) { + let i = t.size?.availableWidth ?? null, + o = t.size?.availableHeight ?? null; + (i && delete t.size.availableWidth, + o && delete t.size.availableHeight, + r.float.middleware.push( + to({ + ...t.size, + apply({ + availableWidth: a, + availableHeight: c, + elements: f, + }) { + Object.assign(f.floating.style, { + maxWidth: `${i ?? a}px`, + maxHeight: `${o ?? c}px`, + }); + }, + }), + )); + } + return r; + }, + ja = (e) => { + var t = + "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz".split( + "", + ), + r = ""; + e || (e = Math.floor(Math.random() * t.length)); + for (var n = 0; n < e; n++) + r += t[Math.floor(Math.random() * t.length)]; + return r; + }; + function Ba(e, t = () => {}) { + let r = !1; + return function () { + r ? t.apply(this, arguments) : ((r = !0), e.apply(this, arguments)); + }; + } + function Ha(e) { + let t = { dismissable: !0, trap: !1 }; + function r(n, i = null) { + if (n) { + if ( + (n.hasAttribute("aria-expanded") || + n.setAttribute("aria-expanded", !1), + i.hasAttribute("id")) + ) + n.setAttribute("aria-controls", i.getAttribute("id")); + else { + let o = `panel-${ja(8)}`; + (n.setAttribute("aria-controls", o), + i.setAttribute("id", o)); + } + (i.setAttribute("aria-modal", !0), + i.setAttribute("role", "dialog")); + } + } + (e.magic("float", (n) => (i = {}, o = {}) => { + let a = { ...t, ...o }, + c = Object.keys(i).length > 0 ? ka(i) : { middleware: [ii()] }, + f = n, + u = n.parentElement.closest("[x-data]"), + y = u.querySelector('[x-ref="panel"]'); + r(f, y); + function m() { + return y.style.display == "block"; + } + function O() { + ((y.style.display = "none"), + f.setAttribute("aria-expanded", "false"), + a.trap && y.setAttribute("x-trap", "false"), + ji(n, y, M)); + } + function S() { + ((y.style.display = "block"), + f.setAttribute("aria-expanded", "true"), + a.trap && y.setAttribute("x-trap", "true"), + M()); + } + function x() { + m() ? O() : S(); + } + async function M() { + return await Bi(n, y, c).then( + ({ middlewareData: I, placement: $, x: A, y: N }) => { + if (I.arrow) { + let Y = I.arrow?.x, + ne = I.arrow?.y, + J = c.middleware.filter( + (de) => de.name == "arrow", + )[0].options.element, + V = { + top: "bottom", + right: "left", + bottom: "top", + left: "right", + }[$.split("-")[0]]; + Object.assign(J.style, { + left: Y != null ? `${Y}px` : "", + top: ne != null ? `${ne}px` : "", + right: "", + bottom: "", + [V]: "-4px", + }); + } + if (I.hide) { + let { referenceHidden: Y } = I.hide; + Object.assign(y.style, { + visibility: Y ? "hidden" : "visible", + }); + } + Object.assign(y.style, { + left: `${A}px`, + top: `${N}px`, + }); + }, + ); + } + (a.dismissable && + (window.addEventListener("click", (I) => { + !u.contains(I.target) && m() && x(); + }), + window.addEventListener( + "keydown", + (I) => { + I.key === "Escape" && m() && x(); + }, + !0, + )), + x()); + }), + e.directive( + "float", + ( + n, + { modifiers: i, expression: o }, + { evaluate: a, effect: c }, + ) => { + let f = o ? a(o) : {}, + u = i.length > 0 ? Na(i, f) : {}, + y = null; + u.float.strategy == "fixed" && (n.style.position = "fixed"); + let m = (V) => + n.parentElement && + !n.parentElement + .closest("[x-data]") + .contains(V.target) + ? n.close() + : null, + O = (V) => (V.key === "Escape" ? n.close() : null), + S = n.getAttribute("x-ref"), + x = n.parentElement.closest("[x-data]"), + M = x.querySelectorAll(`[\\@click^="$refs.${S}"]`), + I = x.querySelectorAll(`[x-on\\:click^="$refs.${S}"]`); + (n.style.setProperty("display", "none"), + r([...M, ...I][0], n), + (n._x_isShown = !1), + (n.trigger = null), + n._x_doHide || + (n._x_doHide = () => { + n.style.setProperty( + "display", + "none", + i.includes("important") + ? "important" + : void 0, + ); + }), + n._x_doShow || + (n._x_doShow = () => { + n.style.setProperty( + "display", + "block", + i.includes("important") + ? "important" + : void 0, + ); + })); + let $ = () => { + (n._x_doHide(), (n._x_isShown = !1)); + }, + A = () => { + (n._x_doShow(), (n._x_isShown = !0)); + }, + N = () => setTimeout(A), + Y = Ba( + (V) => (V ? A() : $()), + (V) => { + typeof n._x_toggleAndCascadeWithTransitions == + "function" + ? n._x_toggleAndCascadeWithTransitions( + n, + V, + A, + $, + ) + : V + ? N() + : $(); + }, + ), + ne, + J = !0; + (c(() => + a((V) => { + (!J && V === ne) || + (i.includes("immediate") && (V ? N() : $()), + Y(V), + (ne = V), + (J = !1)); + }), + ), + (n.open = async function (V) { + ((n.trigger = V.currentTarget + ? V.currentTarget + : V), + Y(!0), + n.trigger.setAttribute("aria-expanded", "true"), + u.component.trap && + n.setAttribute("x-trap", "true"), + (y = ji(n.trigger, n, () => { + Bi(n.trigger, n, u.float).then( + ({ + middlewareData: de, + placement: X, + x: Q, + y: me, + }) => { + if (de.arrow) { + let l = de.arrow?.x, + h = de.arrow?.y, + v = + u.float.middleware.filter( + (j) => + j.name == + "arrow", + )[0].options.element, + p = { + top: "bottom", + right: "left", + bottom: "top", + left: "right", + }[X.split("-")[0]]; + Object.assign(v.style, { + left: + l != null + ? `${l}px` + : "", + top: + h != null + ? `${h}px` + : "", + right: "", + bottom: "", + [p]: "-4px", + }); + } + if (de.hide) { + let { referenceHidden: l } = + de.hide; + Object.assign(n.style, { + visibility: l + ? "hidden" + : "visible", + }); + } + Object.assign(n.style, { + left: `${Q}px`, + top: `${me}px`, + }); + }, + ); + })), + window.addEventListener("click", m), + window.addEventListener("keydown", O, !0)); + }), + (n.close = function () { + if (!n._x_isShown) return !1; + (Y(!1), + n.trigger.setAttribute( + "aria-expanded", + "false", + ), + u.component.trap && + n.setAttribute("x-trap", "false"), + y(), + window.removeEventListener("click", m), + window.removeEventListener("keydown", O, !1)); + }), + (n.toggle = function (V) { + n._x_isShown ? n.close() : n.open(V); + })); + }, + )); + } + var oo = Ha; + function $a(e) { + e.store("lazyLoadedAssets", { + loaded: new Set(), + check(a) { + return Array.isArray(a) + ? a.every((c) => this.loaded.has(c)) + : this.loaded.has(a); + }, + markLoaded(a) { + Array.isArray(a) + ? a.forEach((c) => this.loaded.add(c)) + : this.loaded.add(a); + }, + }); + let t = (a) => + new CustomEvent(a, { + bubbles: !0, + composed: !0, + cancelable: !0, + }), + r = (a, c = {}, f, u) => { + let y = document.createElement(a); + return ( + Object.entries(c).forEach(([m, O]) => (y[m] = O)), + f && (u ? f.insertBefore(y, u) : f.appendChild(y)), + y + ); + }, + n = (a, c, f = {}, u = null, y = null) => { + let m = + a === "link" ? `link[href="${c}"]` : `script[src="${c}"]`; + if ( + document.querySelector(m) || + e.store("lazyLoadedAssets").check(c) + ) + return Promise.resolve(); + let O = a === "link" ? { ...f, href: c } : { ...f, src: c }, + S = r(a, O, u, y); + return new Promise((x, M) => { + ((S.onload = () => { + (e.store("lazyLoadedAssets").markLoaded(c), x()); + }), + (S.onerror = () => { + M(new Error(`Failed to load ${a}: ${c}`)); + })); + }); + }, + i = async (a, c, f = null, u = null) => { + let y = { type: "text/css", rel: "stylesheet" }; + c && (y.media = c); + let m = document.head, + O = null; + if (f && u) { + let S = document.querySelector(`link[href*="${u}"]`); + S + ? ((m = S.parentElement), + (O = f === "before" ? S : S.nextSibling)) + : (console.warn( + `Target (${u}) not found for ${a}. Appending to head.`, + ), + (m = document.head), + (O = null)); + } + await n("link", a, y, m, O); + }, + o = async (a, c, f = null, u = null, y = null) => { + let m = document.head, + O = null; + if (f && u) { + let x = document.querySelector(`script[src*="${u}"]`); + x + ? ((m = x.parentElement), + (O = f === "before" ? x : x.nextSibling)) + : (console.warn( + `Target (${u}) not found for ${a}. Falling back to head or body.`, + ), + (m = document.head), + (O = null)); + } else + (c.has("body-start") || c.has("body-end")) && + ((m = document.body), + c.has("body-start") && (O = document.body.firstChild)); + let S = {}; + (y && (S.type = "module"), await n("script", a, S, m, O)); + }; + (e.directive("load-css", (a, { expression: c }, { evaluate: f }) => { + let u = f(c), + y = a.media, + m = a.getAttribute("data-dispatch"), + O = a.getAttribute("data-css-before") + ? "before" + : a.getAttribute("data-css-after") + ? "after" + : null, + S = + a.getAttribute("data-css-before") || + a.getAttribute("data-css-after") || + null; + Promise.all(u.map((x) => i(x, y, O, S))) + .then(() => { + m && window.dispatchEvent(t(`${m}-css`)); + }) + .catch(console.error); + }), + e.directive( + "load-js", + (a, { expression: c, modifiers: f }, { evaluate: u }) => { + let y = u(c), + m = new Set(f), + O = a.getAttribute("data-js-before") + ? "before" + : a.getAttribute("data-js-after") + ? "after" + : null, + S = + a.getAttribute("data-js-before") || + a.getAttribute("data-js-after") || + null, + x = + a.getAttribute("data-js-as-module") || + a.getAttribute("data-as-module") || + !1, + M = a.getAttribute("data-dispatch"); + Promise.all(y.map((I) => o(I, m, O, S, x))) + .then(() => { + M && window.dispatchEvent(t(`${M}-js`)); + }) + .catch(console.error); + }, + )); + } + var ao = $a; + function Wa() { + return !0; + } + function Ua({ component: e, argument: t }) { + return new Promise((r) => { + if (t) window.addEventListener(t, () => r(), { once: !0 }); + else { + let n = (i) => { + i.detail.id === e.id && + (window.removeEventListener("async-alpine:load", n), + r()); + }; + window.addEventListener("async-alpine:load", n); + } + }); + } + function Va() { + return new Promise((e) => { + "requestIdleCallback" in window + ? window.requestIdleCallback(e) + : setTimeout(e, 200); + }); + } + function za({ argument: e }) { + return new Promise((t) => { + if (!e) + return ( + console.log( + "Async Alpine: media strategy requires a media query. Treating as 'eager'", + ), + t() + ); + let r = window.matchMedia(`(${e})`); + r.matches ? t() : r.addEventListener("change", t, { once: !0 }); + }); + } + function Ya({ component: e, argument: t }) { + return new Promise((r) => { + let n = t || "0px 0px 0px 0px", + i = new IntersectionObserver( + (o) => { + o[0].isIntersecting && (i.disconnect(), r()); + }, + { rootMargin: n }, + ); + i.observe(e.el); + }); + } + var so = { eager: Wa, event: Ua, idle: Va, media: za, visible: Ya }; + async function Xa(e) { + let t = qa(e.strategy); + await oi(e, t); + } + async function oi(e, t) { + if (t.type === "expression") { + if (t.operator === "&&") + return Promise.all(t.parameters.map((r) => oi(e, r))); + if (t.operator === "||") + return Promise.any(t.parameters.map((r) => oi(e, r))); + } + return so[t.method] + ? so[t.method]({ component: e, argument: t.argument }) + : !1; + } + function qa(e) { + let t = Ga(e), + r = co(t); + return r.type === "method" + ? { type: "expression", operator: "&&", parameters: [r] } + : r; + } + function Ga(e) { + let t = + /\s*([()])\s*|\s*(\|\||&&|\|)\s*|\s*((?:[^()&|]+\([^()]+\))|[^()&|]+)\s*/g, + r = [], + n; + for (; (n = t.exec(e)) !== null; ) { + let [i, o, a, c] = n; + if (o !== void 0) r.push({ type: "parenthesis", value: o }); + else if (a !== void 0) + r.push({ type: "operator", value: a === "|" ? "&&" : a }); + else { + let f = { type: "method", method: c.trim() }; + (c.includes("(") && + ((f.method = c.substring(0, c.indexOf("(")).trim()), + (f.argument = c.substring( + c.indexOf("(") + 1, + c.indexOf(")"), + ))), + c.method === "immediate" && (c.method = "eager"), + r.push(f)); + } + } + return r; + } + function co(e) { + let t = lo(e); + for ( + ; + e.length > 0 && + (e[0].value === "&&" || e[0].value === "|" || e[0].value === "||"); + ) { + let r = e.shift().value, + n = lo(e); + t.type === "expression" && t.operator === r + ? t.parameters.push(n) + : (t = { type: "expression", operator: r, parameters: [t, n] }); + } + return t; + } + function lo(e) { + if (e[0].value === "(") { + e.shift(); + let t = co(e); + return (e[0].value === ")" && e.shift(), t); + } else return e.shift(); + } + function fo(e) { + let t = "load", + r = e.prefixed("load-src"), + n = e.prefixed("ignore"), + i = { defaultStrategy: "eager", keepRelativeURLs: !1 }, + o = !1, + a = {}, + c = 0; + function f() { + return c++; + } + ((e.asyncOptions = (A) => { + i = { ...i, ...A }; + }), + (e.asyncData = (A, N = !1) => { + a[A] = { loaded: !1, download: N }; + }), + (e.asyncUrl = (A, N) => { + !A || + !N || + a[A] || + (a[A] = { loaded: !1, download: () => import($(N)) }); + }), + (e.asyncAlias = (A) => { + o = A; + })); + let u = (A) => { + e.skipDuringClone(() => { + A._x_async || + ((A._x_async = "init"), + (A._x_ignore = !0), + A.setAttribute(n, "")); + })(); + }, + y = async (A) => { + e.skipDuringClone(async () => { + if (A._x_async !== "init") return; + A._x_async = "await"; + let { name: N, strategy: Y } = m(A); + (await Xa({ name: N, strategy: Y, el: A, id: A.id || f() }), + A.isConnected && + (await O(N), + A.isConnected && (x(A), (A._x_async = "loaded")))); + })(); + }; + ((y.inline = u), e.directive(t, y).before("ignore")); + function m(A) { + let N = I(A.getAttribute(e.prefixed("data"))), + Y = A.getAttribute(e.prefixed(t)) || i.defaultStrategy, + ne = A.getAttribute(r); + return (ne && e.asyncUrl(N, ne), { name: N, strategy: Y }); + } + async function O(A) { + if (A.startsWith("_x_async_") || (M(A), !a[A] || a[A].loaded)) + return; + let N = await S(A); + (e.data(A, N), (a[A].loaded = !0)); + } + async function S(A) { + if (!a[A]) return; + let N = await a[A].download(A); + return typeof N == "function" + ? N + : N[A] || N.default || Object.values(N)[0] || !1; + } + function x(A) { + (e.destroyTree(A), + (A._x_ignore = !1), + A.removeAttribute(n), + !A.closest(`[${n}]`) && e.initTree(A)); + } + function M(A) { + if (!(!o || a[A])) { + if (typeof o == "function") { + e.asyncData(A, o); + return; + } + e.asyncUrl(A, o.replaceAll("[name]", A)); + } + } + function I(A) { + return (A || "").trim().split(/[({]/g)[0] || `_x_async_${f()}`; + } + function $(A) { + return i.keepRelativeURLs || + new RegExp("^(?:[a-z+]+:)?//", "i").test(A) + ? A + : new URL(A, document.baseURI).href; + } + } + var Xo = ea(ho(), 1); + function vo(e, t) { + var r = Object.keys(e); + if (Object.getOwnPropertySymbols) { + var n = Object.getOwnPropertySymbols(e); + (t && + (n = n.filter(function (i) { + return Object.getOwnPropertyDescriptor(e, i).enumerable; + })), + r.push.apply(r, n)); + } + return r; + } + function Mt(e) { + for (var t = 1; t < arguments.length; t++) { + var r = arguments[t] != null ? arguments[t] : {}; + t % 2 + ? vo(Object(r), !0).forEach(function (n) { + Ka(e, n, r[n]); + }) + : Object.getOwnPropertyDescriptors + ? Object.defineProperties( + e, + Object.getOwnPropertyDescriptors(r), + ) + : vo(Object(r)).forEach(function (n) { + Object.defineProperty( + e, + n, + Object.getOwnPropertyDescriptor(r, n), + ); + }); + } + return e; + } + function Sr(e) { + "@babel/helpers - typeof"; + return ( + typeof Symbol == "function" && typeof Symbol.iterator == "symbol" + ? (Sr = function (t) { + return typeof t; + }) + : (Sr = function (t) { + return t && + typeof Symbol == "function" && + t.constructor === Symbol && + t !== Symbol.prototype + ? "symbol" + : typeof t; + }), + Sr(e) + ); + } + function Ka(e, t, r) { + return ( + t in e + ? Object.defineProperty(e, t, { + value: r, + enumerable: !0, + configurable: !0, + writable: !0, + }) + : (e[t] = r), + e + ); + } + function $t() { + return ( + ($t = + Object.assign || + function (e) { + for (var t = 1; t < arguments.length; t++) { + var r = arguments[t]; + for (var n in r) + Object.prototype.hasOwnProperty.call(r, n) && + (e[n] = r[n]); + } + return e; + }), + $t.apply(this, arguments) + ); + } + function Ja(e, t) { + if (e == null) return {}; + var r = {}, + n = Object.keys(e), + i, + o; + for (o = 0; o < n.length; o++) + ((i = n[o]), !(t.indexOf(i) >= 0) && (r[i] = e[i])); + return r; + } + function Qa(e, t) { + if (e == null) return {}; + var r = Ja(e, t), + n, + i; + if (Object.getOwnPropertySymbols) { + var o = Object.getOwnPropertySymbols(e); + for (i = 0; i < o.length; i++) + ((n = o[i]), + !(t.indexOf(n) >= 0) && + Object.prototype.propertyIsEnumerable.call(e, n) && + (r[n] = e[n])); + } + return r; + } + var Za = "1.15.6"; + function Ht(e) { + if (typeof window < "u" && window.navigator) + return !!navigator.userAgent.match(e); + } + var Wt = Ht(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i), + er = Ht(/Edge/i), + mo = Ht(/firefox/i), + Gn = Ht(/safari/i) && !Ht(/chrome/i) && !Ht(/android/i), + yi = Ht(/iP(ad|od|hone)/i), + So = Ht(/chrome/i) && Ht(/android/i), + Ao = { capture: !1, passive: !1 }; + function Oe(e, t, r) { + e.addEventListener(t, r, !Wt && Ao); + } + function Ee(e, t, r) { + e.removeEventListener(t, r, !Wt && Ao); + } + function Tr(e, t) { + if (t) { + if ((t[0] === ">" && (t = t.substring(1)), e)) + try { + if (e.matches) return e.matches(t); + if (e.msMatchesSelector) return e.msMatchesSelector(t); + if (e.webkitMatchesSelector) + return e.webkitMatchesSelector(t); + } catch { + return !1; + } + return !1; + } + } + function Co(e) { + return e.host && e !== document && e.host.nodeType + ? e.host + : e.parentNode; + } + function St(e, t, r, n) { + if (e) { + r = r || document; + do { + if ( + (t != null && + (t[0] === ">" + ? e.parentNode === r && Tr(e, t) + : Tr(e, t))) || + (n && e === r) + ) + return e; + if (e === r) break; + } while ((e = Co(e))); + } + return null; + } + var go = /\s+/g; + function ft(e, t, r) { + if (e && t) + if (e.classList) e.classList[r ? "add" : "remove"](t); + else { + var n = (" " + e.className + " ") + .replace(go, " ") + .replace(" " + t + " ", " "); + e.className = (n + (r ? " " + t : "")).replace(go, " "); + } + } + function ae(e, t, r) { + var n = e && e.style; + if (n) { + if (r === void 0) + return ( + document.defaultView && + document.defaultView.getComputedStyle + ? (r = document.defaultView.getComputedStyle(e, "")) + : e.currentStyle && (r = e.currentStyle), + t === void 0 ? r : r[t] + ); + (!(t in n) && t.indexOf("webkit") === -1 && (t = "-webkit-" + t), + (n[t] = r + (typeof r == "string" ? "" : "px"))); + } + } + function Fn(e, t) { + var r = ""; + if (typeof e == "string") r = e; + else + do { + var n = ae(e, "transform"); + n && n !== "none" && (r = n + " " + r); + } while (!t && (e = e.parentNode)); + var i = + window.DOMMatrix || + window.WebKitCSSMatrix || + window.CSSMatrix || + window.MSCSSMatrix; + return i && new i(r); + } + function Do(e, t, r) { + if (e) { + var n = e.getElementsByTagName(t), + i = 0, + o = n.length; + if (r) for (; i < o; i++) r(n[i], i); + return n; + } + return []; + } + function Pt() { + var e = document.scrollingElement; + return e || document.documentElement; + } + function qe(e, t, r, n, i) { + if (!(!e.getBoundingClientRect && e !== window)) { + var o, a, c, f, u, y, m; + if ( + (e !== window && e.parentNode && e !== Pt() + ? ((o = e.getBoundingClientRect()), + (a = o.top), + (c = o.left), + (f = o.bottom), + (u = o.right), + (y = o.height), + (m = o.width)) + : ((a = 0), + (c = 0), + (f = window.innerHeight), + (u = window.innerWidth), + (y = window.innerHeight), + (m = window.innerWidth)), + (t || r) && e !== window && ((i = i || e.parentNode), !Wt)) + ) + do + if ( + i && + i.getBoundingClientRect && + (ae(i, "transform") !== "none" || + (r && ae(i, "position") !== "static")) + ) { + var O = i.getBoundingClientRect(); + ((a -= O.top + parseInt(ae(i, "border-top-width"))), + (c -= + O.left + parseInt(ae(i, "border-left-width"))), + (f = a + o.height), + (u = c + o.width)); + break; + } + while ((i = i.parentNode)); + if (n && e !== window) { + var S = Fn(i || e), + x = S && S.a, + M = S && S.d; + S && + ((a /= M), + (c /= x), + (m /= x), + (y /= M), + (f = a + y), + (u = c + m)); + } + return { + top: a, + left: c, + bottom: f, + right: u, + width: m, + height: y, + }; + } + } + function bo(e, t, r) { + for (var n = sn(e, !0), i = qe(e)[t]; n; ) { + var o = qe(n)[r], + a = void 0; + if ((r === "top" || r === "left" ? (a = i >= o) : (a = i <= o), !a)) + return n; + if (n === Pt()) break; + n = sn(n, !1); + } + return !1; + } + function kn(e, t, r, n) { + for (var i = 0, o = 0, a = e.children; o < a.length; ) { + if ( + a[o].style.display !== "none" && + a[o] !== se.ghost && + (n || a[o] !== se.dragged) && + St(a[o], r.draggable, e, !1) + ) { + if (i === t) return a[o]; + i++; + } + o++; + } + return null; + } + function wi(e, t) { + for ( + var r = e.lastElementChild; + r && + (r === se.ghost || ae(r, "display") === "none" || (t && !Tr(r, t))); + ) + r = r.previousElementSibling; + return r || null; + } + function vt(e, t) { + var r = 0; + if (!e || !e.parentNode) return -1; + for (; (e = e.previousElementSibling); ) + e.nodeName.toUpperCase() !== "TEMPLATE" && + e !== se.clone && + (!t || Tr(e, t)) && + r++; + return r; + } + function yo(e) { + var t = 0, + r = 0, + n = Pt(); + if (e) + do { + var i = Fn(e), + o = i.a, + a = i.d; + ((t += e.scrollLeft * o), (r += e.scrollTop * a)); + } while (e !== n && (e = e.parentNode)); + return [t, r]; + } + function es(e, t) { + for (var r in e) + if (e.hasOwnProperty(r)) { + for (var n in t) + if (t.hasOwnProperty(n) && t[n] === e[r][n]) + return Number(r); + } + return -1; + } + function sn(e, t) { + if (!e || !e.getBoundingClientRect) return Pt(); + var r = e, + n = !1; + do + if ( + r.clientWidth < r.scrollWidth || + r.clientHeight < r.scrollHeight + ) { + var i = ae(r); + if ( + (r.clientWidth < r.scrollWidth && + (i.overflowX == "auto" || i.overflowX == "scroll")) || + (r.clientHeight < r.scrollHeight && + (i.overflowY == "auto" || i.overflowY == "scroll")) + ) { + if (!r.getBoundingClientRect || r === document.body) + return Pt(); + if (n || t) return r; + n = !0; + } + } + while ((r = r.parentNode)); + return Pt(); + } + function ts(e, t) { + if (e && t) for (var r in t) t.hasOwnProperty(r) && (e[r] = t[r]); + return e; + } + function ai(e, t) { + return ( + Math.round(e.top) === Math.round(t.top) && + Math.round(e.left) === Math.round(t.left) && + Math.round(e.height) === Math.round(t.height) && + Math.round(e.width) === Math.round(t.width) + ); + } + var Kn; + function _o(e, t) { + return function () { + if (!Kn) { + var r = arguments, + n = this; + (r.length === 1 ? e.call(n, r[0]) : e.apply(n, r), + (Kn = setTimeout(function () { + Kn = void 0; + }, t))); + } + }; + } + function ns() { + (clearTimeout(Kn), (Kn = void 0)); + } + function To(e, t, r) { + ((e.scrollLeft += t), (e.scrollTop += r)); + } + function Po(e) { + var t = window.Polymer, + r = window.jQuery || window.Zepto; + return t && t.dom + ? t.dom(e).cloneNode(!0) + : r + ? r(e).clone(!0)[0] + : e.cloneNode(!0); + } + function Mo(e, t, r) { + var n = {}; + return ( + Array.from(e.children).forEach(function (i) { + var o, a, c, f; + if (!(!St(i, t.draggable, e, !1) || i.animated || i === r)) { + var u = qe(i); + ((n.left = Math.min( + (o = n.left) !== null && o !== void 0 ? o : 1 / 0, + u.left, + )), + (n.top = Math.min( + (a = n.top) !== null && a !== void 0 ? a : 1 / 0, + u.top, + )), + (n.right = Math.max( + (c = n.right) !== null && c !== void 0 ? c : -1 / 0, + u.right, + )), + (n.bottom = Math.max( + (f = n.bottom) !== null && f !== void 0 + ? f + : -1 / 0, + u.bottom, + ))); + } + }), + (n.width = n.right - n.left), + (n.height = n.bottom - n.top), + (n.x = n.left), + (n.y = n.top), + n + ); + } + var st = "Sortable" + new Date().getTime(); + function rs() { + var e = [], + t; + return { + captureAnimationState: function () { + if (((e = []), !!this.options.animation)) { + var n = [].slice.call(this.el.children); + n.forEach(function (i) { + if (!(ae(i, "display") === "none" || i === se.ghost)) { + e.push({ target: i, rect: qe(i) }); + var o = Mt({}, e[e.length - 1].rect); + if (i.thisAnimationDuration) { + var a = Fn(i, !0); + a && ((o.top -= a.f), (o.left -= a.e)); + } + i.fromRect = o; + } + }); + } + }, + addAnimationState: function (n) { + e.push(n); + }, + removeAnimationState: function (n) { + e.splice(es(e, { target: n }), 1); + }, + animateAll: function (n) { + var i = this; + if (!this.options.animation) { + (clearTimeout(t), typeof n == "function" && n()); + return; + } + var o = !1, + a = 0; + (e.forEach(function (c) { + var f = 0, + u = c.target, + y = u.fromRect, + m = qe(u), + O = u.prevFromRect, + S = u.prevToRect, + x = c.rect, + M = Fn(u, !0); + (M && ((m.top -= M.f), (m.left -= M.e)), + (u.toRect = m), + u.thisAnimationDuration && + ai(O, m) && + !ai(y, m) && + (x.top - m.top) / (x.left - m.left) === + (y.top - m.top) / (y.left - m.left) && + (f = os(x, O, S, i.options)), + ai(m, y) || + ((u.prevFromRect = y), + (u.prevToRect = m), + f || (f = i.options.animation), + i.animate(u, x, m, f)), + f && + ((o = !0), + (a = Math.max(a, f)), + clearTimeout(u.animationResetTimer), + (u.animationResetTimer = setTimeout(function () { + ((u.animationTime = 0), + (u.prevFromRect = null), + (u.fromRect = null), + (u.prevToRect = null), + (u.thisAnimationDuration = null)); + }, f)), + (u.thisAnimationDuration = f))); + }), + clearTimeout(t), + o + ? (t = setTimeout(function () { + typeof n == "function" && n(); + }, a)) + : typeof n == "function" && n(), + (e = [])); + }, + animate: function (n, i, o, a) { + if (a) { + (ae(n, "transition", ""), ae(n, "transform", "")); + var c = Fn(this.el), + f = c && c.a, + u = c && c.d, + y = (i.left - o.left) / (f || 1), + m = (i.top - o.top) / (u || 1); + ((n.animatingX = !!y), + (n.animatingY = !!m), + ae( + n, + "transform", + "translate3d(" + y + "px," + m + "px,0)", + ), + (this.forRepaintDummy = is(n)), + ae( + n, + "transition", + "transform " + + a + + "ms" + + (this.options.easing + ? " " + this.options.easing + : ""), + ), + ae(n, "transform", "translate3d(0,0,0)"), + typeof n.animated == "number" && + clearTimeout(n.animated), + (n.animated = setTimeout(function () { + (ae(n, "transition", ""), + ae(n, "transform", ""), + (n.animated = !1), + (n.animatingX = !1), + (n.animatingY = !1)); + }, a))); + } + }, + }; + } + function is(e) { + return e.offsetWidth; + } + function os(e, t, r, n) { + return ( + (Math.sqrt( + Math.pow(t.top - e.top, 2) + Math.pow(t.left - e.left, 2), + ) / + Math.sqrt( + Math.pow(t.top - r.top, 2) + Math.pow(t.left - r.left, 2), + )) * + n.animation + ); + } + var Mn = [], + si = { initializeByDefault: !0 }, + tr = { + mount: function (t) { + for (var r in si) + si.hasOwnProperty(r) && !(r in t) && (t[r] = si[r]); + (Mn.forEach(function (n) { + if (n.pluginName === t.pluginName) + throw "Sortable: Cannot mount plugin ".concat( + t.pluginName, + " more than once", + ); + }), + Mn.push(t)); + }, + pluginEvent: function (t, r, n) { + var i = this; + ((this.eventCanceled = !1), + (n.cancel = function () { + i.eventCanceled = !0; + })); + var o = t + "Global"; + Mn.forEach(function (a) { + r[a.pluginName] && + (r[a.pluginName][o] && + r[a.pluginName][o](Mt({ sortable: r }, n)), + r.options[a.pluginName] && + r[a.pluginName][t] && + r[a.pluginName][t](Mt({ sortable: r }, n))); + }); + }, + initializePlugins: function (t, r, n, i) { + Mn.forEach(function (c) { + var f = c.pluginName; + if (!(!t.options[f] && !c.initializeByDefault)) { + var u = new c(t, r, t.options); + ((u.sortable = t), + (u.options = t.options), + (t[f] = u), + $t(n, u.defaults)); + } + }); + for (var o in t.options) + if (t.options.hasOwnProperty(o)) { + var a = this.modifyOption(t, o, t.options[o]); + typeof a < "u" && (t.options[o] = a); + } + }, + getEventProperties: function (t, r) { + var n = {}; + return ( + Mn.forEach(function (i) { + typeof i.eventProperties == "function" && + $t(n, i.eventProperties.call(r[i.pluginName], t)); + }), + n + ); + }, + modifyOption: function (t, r, n) { + var i; + return ( + Mn.forEach(function (o) { + t[o.pluginName] && + o.optionListeners && + typeof o.optionListeners[r] == "function" && + (i = o.optionListeners[r].call(t[o.pluginName], n)); + }), + i + ); + }, + }; + function as(e) { + var t = e.sortable, + r = e.rootEl, + n = e.name, + i = e.targetEl, + o = e.cloneEl, + a = e.toEl, + c = e.fromEl, + f = e.oldIndex, + u = e.newIndex, + y = e.oldDraggableIndex, + m = e.newDraggableIndex, + O = e.originalEvent, + S = e.putSortable, + x = e.extraEventProperties; + if (((t = t || (r && r[st])), !!t)) { + var M, + I = t.options, + $ = "on" + n.charAt(0).toUpperCase() + n.substr(1); + (window.CustomEvent && !Wt && !er + ? (M = new CustomEvent(n, { bubbles: !0, cancelable: !0 })) + : ((M = document.createEvent("Event")), M.initEvent(n, !0, !0)), + (M.to = a || r), + (M.from = c || r), + (M.item = i || r), + (M.clone = o), + (M.oldIndex = f), + (M.newIndex = u), + (M.oldDraggableIndex = y), + (M.newDraggableIndex = m), + (M.originalEvent = O), + (M.pullMode = S ? S.lastPutMode : void 0)); + var A = Mt(Mt({}, x), tr.getEventProperties(n, t)); + for (var N in A) M[N] = A[N]; + (r && r.dispatchEvent(M), I[$] && I[$].call(t, M)); + } + } + var ss = ["evt"], + at = function (t, r) { + var n = + arguments.length > 2 && arguments[2] !== void 0 + ? arguments[2] + : {}, + i = n.evt, + o = Qa(n, ss); + tr.pluginEvent.bind(se)( + t, + r, + Mt( + { + dragEl: k, + parentEl: Ve, + ghostEl: ue, + rootEl: Ne, + nextEl: bn, + lastDownEl: Ar, + cloneEl: We, + cloneHidden: an, + dragStarted: Yn, + putSortable: Qe, + activeSortable: se.active, + originalEvent: i, + oldIndex: Ln, + oldDraggableIndex: Jn, + newIndex: ut, + newDraggableIndex: on, + hideGhostForTarget: Fo, + unhideGhostForTarget: ko, + cloneNowHidden: function () { + an = !0; + }, + cloneNowShown: function () { + an = !1; + }, + dispatchSortableEvent: function (c) { + it({ sortable: r, name: c, originalEvent: i }); + }, + }, + o, + ), + ); + }; + function it(e) { + as( + Mt( + { + putSortable: Qe, + cloneEl: We, + targetEl: k, + rootEl: Ne, + oldIndex: Ln, + oldDraggableIndex: Jn, + newIndex: ut, + newDraggableIndex: on, + }, + e, + ), + ); + } + var k, + Ve, + ue, + Ne, + bn, + Ar, + We, + an, + Ln, + ut, + Jn, + on, + wr, + Qe, + In = !1, + Pr = !1, + Mr = [], + mn, + Ot, + li, + ci, + wo, + xo, + Yn, + Rn, + Qn, + Zn = !1, + xr = !1, + Cr, + nt, + fi = [], + vi = !1, + Rr = [], + Lr = typeof document < "u", + Er = yi, + Eo = er || Wt ? "cssFloat" : "float", + ls = Lr && !So && !yi && "draggable" in document.createElement("div"), + Ro = (function () { + if (Lr) { + if (Wt) return !1; + var e = document.createElement("x"); + return ( + (e.style.cssText = "pointer-events:auto"), + e.style.pointerEvents === "auto" + ); + } + })(), + Io = function (t, r) { + var n = ae(t), + i = + parseInt(n.width) - + parseInt(n.paddingLeft) - + parseInt(n.paddingRight) - + parseInt(n.borderLeftWidth) - + parseInt(n.borderRightWidth), + o = kn(t, 0, r), + a = kn(t, 1, r), + c = o && ae(o), + f = a && ae(a), + u = + c && + parseInt(c.marginLeft) + + parseInt(c.marginRight) + + qe(o).width, + y = + f && + parseInt(f.marginLeft) + + parseInt(f.marginRight) + + qe(a).width; + if (n.display === "flex") + return n.flexDirection === "column" || + n.flexDirection === "column-reverse" + ? "vertical" + : "horizontal"; + if (n.display === "grid") + return n.gridTemplateColumns.split(" ").length <= 1 + ? "vertical" + : "horizontal"; + if (o && c.float && c.float !== "none") { + var m = c.float === "left" ? "left" : "right"; + return a && (f.clear === "both" || f.clear === m) + ? "vertical" + : "horizontal"; + } + return o && + (c.display === "block" || + c.display === "flex" || + c.display === "table" || + c.display === "grid" || + (u >= i && n[Eo] === "none") || + (a && n[Eo] === "none" && u + y > i)) + ? "vertical" + : "horizontal"; + }, + cs = function (t, r, n) { + var i = n ? t.left : t.top, + o = n ? t.right : t.bottom, + a = n ? t.width : t.height, + c = n ? r.left : r.top, + f = n ? r.right : r.bottom, + u = n ? r.width : r.height; + return i === c || o === f || i + a / 2 === c + u / 2; + }, + fs = function (t, r) { + var n; + return ( + Mr.some(function (i) { + var o = i[st].options.emptyInsertThreshold; + if (!(!o || wi(i))) { + var a = qe(i), + c = t >= a.left - o && t <= a.right + o, + f = r >= a.top - o && r <= a.bottom + o; + if (c && f) return (n = i); + } + }), + n + ); + }, + Lo = function (t) { + function r(o, a) { + return function (c, f, u, y) { + var m = + c.options.group.name && + f.options.group.name && + c.options.group.name === f.options.group.name; + if (o == null && (a || m)) return !0; + if (o == null || o === !1) return !1; + if (a && o === "clone") return o; + if (typeof o == "function") + return r(o(c, f, u, y), a)(c, f, u, y); + var O = (a ? c : f).options.group.name; + return ( + o === !0 || + (typeof o == "string" && o === O) || + (o.join && o.indexOf(O) > -1) + ); + }; + } + var n = {}, + i = t.group; + ((!i || Sr(i) != "object") && (i = { name: i }), + (n.name = i.name), + (n.checkPull = r(i.pull, !0)), + (n.checkPut = r(i.put)), + (n.revertClone = i.revertClone), + (t.group = n)); + }, + Fo = function () { + !Ro && ue && ae(ue, "display", "none"); + }, + ko = function () { + !Ro && ue && ae(ue, "display", ""); + }; + Lr && + !So && + document.addEventListener( + "click", + function (e) { + if (Pr) + return ( + e.preventDefault(), + e.stopPropagation && e.stopPropagation(), + e.stopImmediatePropagation && + e.stopImmediatePropagation(), + (Pr = !1), + !1 + ); + }, + !0, + ); + var gn = function (t) { + if (k) { + t = t.touches ? t.touches[0] : t; + var r = fs(t.clientX, t.clientY); + if (r) { + var n = {}; + for (var i in t) t.hasOwnProperty(i) && (n[i] = t[i]); + ((n.target = n.rootEl = r), + (n.preventDefault = void 0), + (n.stopPropagation = void 0), + r[st]._onDragOver(n)); + } + } + }, + us = function (t) { + k && k.parentNode[st]._isOutsideThisEl(t.target); + }; + function se(e, t) { + if (!(e && e.nodeType && e.nodeType === 1)) + throw "Sortable: `el` must be an HTMLElement, not ".concat( + {}.toString.call(e), + ); + ((this.el = e), (this.options = t = $t({}, t)), (e[st] = this)); + var r = { + group: null, + sort: !0, + disabled: !1, + store: null, + handle: null, + draggable: /^[uo]l$/i.test(e.nodeName) ? ">li" : ">*", + swapThreshold: 1, + invertSwap: !1, + invertedSwapThreshold: null, + removeCloneOnHide: !0, + direction: function () { + return Io(e, this.options); + }, + ghostClass: "sortable-ghost", + chosenClass: "sortable-chosen", + dragClass: "sortable-drag", + ignore: "a, img", + filter: null, + preventOnFilter: !0, + animation: 0, + easing: null, + setData: function (a, c) { + a.setData("Text", c.textContent); + }, + dropBubble: !1, + dragoverBubble: !1, + dataIdAttr: "data-id", + delay: 0, + delayOnTouchOnly: !1, + touchStartThreshold: + (Number.parseInt ? Number : window).parseInt( + window.devicePixelRatio, + 10, + ) || 1, + forceFallback: !1, + fallbackClass: "sortable-fallback", + fallbackOnBody: !1, + fallbackTolerance: 0, + fallbackOffset: { x: 0, y: 0 }, + supportPointer: + se.supportPointer !== !1 && + "PointerEvent" in window && + (!Gn || yi), + emptyInsertThreshold: 5, + }; + tr.initializePlugins(this, e, r); + for (var n in r) !(n in t) && (t[n] = r[n]); + Lo(t); + for (var i in this) + i.charAt(0) === "_" && + typeof this[i] == "function" && + (this[i] = this[i].bind(this)); + ((this.nativeDraggable = t.forceFallback ? !1 : ls), + this.nativeDraggable && (this.options.touchStartThreshold = 1), + t.supportPointer + ? Oe(e, "pointerdown", this._onTapStart) + : (Oe(e, "mousedown", this._onTapStart), + Oe(e, "touchstart", this._onTapStart)), + this.nativeDraggable && + (Oe(e, "dragover", this), Oe(e, "dragenter", this)), + Mr.push(this.el), + t.store && t.store.get && this.sort(t.store.get(this) || []), + $t(this, rs())); + } + se.prototype = { + constructor: se, + _isOutsideThisEl: function (t) { + !this.el.contains(t) && t !== this.el && (Rn = null); + }, + _getDirection: function (t, r) { + return typeof this.options.direction == "function" + ? this.options.direction.call(this, t, r, k) + : this.options.direction; + }, + _onTapStart: function (t) { + if (t.cancelable) { + var r = this, + n = this.el, + i = this.options, + o = i.preventOnFilter, + a = t.type, + c = + (t.touches && t.touches[0]) || + (t.pointerType && t.pointerType === "touch" && t), + f = (c || t).target, + u = + (t.target.shadowRoot && + ((t.path && t.path[0]) || + (t.composedPath && t.composedPath()[0]))) || + f, + y = i.filter; + if ( + (ys(n), + !k && + !( + (/mousedown|pointerdown/.test(a) && + t.button !== 0) || + i.disabled + ) && + !u.isContentEditable && + !( + !this.nativeDraggable && + Gn && + f && + f.tagName.toUpperCase() === "SELECT" + ) && + ((f = St(f, i.draggable, n, !1)), + !(f && f.animated) && Ar !== f)) + ) { + if ( + ((Ln = vt(f)), + (Jn = vt(f, i.draggable)), + typeof y == "function") + ) { + if (y.call(this, t, f, this)) { + (it({ + sortable: r, + rootEl: u, + name: "filter", + targetEl: f, + toEl: n, + fromEl: n, + }), + at("filter", r, { evt: t }), + o && t.preventDefault()); + return; + } + } else if ( + y && + ((y = y.split(",").some(function (m) { + if (((m = St(u, m.trim(), n, !1)), m)) + return ( + it({ + sortable: r, + rootEl: m, + name: "filter", + targetEl: f, + fromEl: n, + toEl: n, + }), + at("filter", r, { evt: t }), + !0 + ); + })), + y) + ) { + o && t.preventDefault(); + return; + } + (i.handle && !St(u, i.handle, n, !1)) || + this._prepareDragStart(t, c, f); + } + } + }, + _prepareDragStart: function (t, r, n) { + var i = this, + o = i.el, + a = i.options, + c = o.ownerDocument, + f; + if (n && !k && n.parentNode === o) { + var u = qe(n); + if ( + ((Ne = o), + (k = n), + (Ve = k.parentNode), + (bn = k.nextSibling), + (Ar = n), + (wr = a.group), + (se.dragged = k), + (mn = { + target: k, + clientX: (r || t).clientX, + clientY: (r || t).clientY, + }), + (wo = mn.clientX - u.left), + (xo = mn.clientY - u.top), + (this._lastX = (r || t).clientX), + (this._lastY = (r || t).clientY), + (k.style["will-change"] = "all"), + (f = function () { + if ( + (at("delayEnded", i, { evt: t }), se.eventCanceled) + ) { + i._onDrop(); + return; + } + (i._disableDelayedDragEvents(), + !mo && i.nativeDraggable && (k.draggable = !0), + i._triggerDragStart(t, r), + it({ + sortable: i, + name: "choose", + originalEvent: t, + }), + ft(k, a.chosenClass, !0)); + }), + a.ignore.split(",").forEach(function (y) { + Do(k, y.trim(), ui); + }), + Oe(c, "dragover", gn), + Oe(c, "mousemove", gn), + Oe(c, "touchmove", gn), + a.supportPointer + ? (Oe(c, "pointerup", i._onDrop), + !this.nativeDraggable && + Oe(c, "pointercancel", i._onDrop)) + : (Oe(c, "mouseup", i._onDrop), + Oe(c, "touchend", i._onDrop), + Oe(c, "touchcancel", i._onDrop)), + mo && + this.nativeDraggable && + ((this.options.touchStartThreshold = 4), + (k.draggable = !0)), + at("delayStart", this, { evt: t }), + a.delay && + (!a.delayOnTouchOnly || r) && + (!this.nativeDraggable || !(er || Wt))) + ) { + if (se.eventCanceled) { + this._onDrop(); + return; + } + (a.supportPointer + ? (Oe(c, "pointerup", i._disableDelayedDrag), + Oe(c, "pointercancel", i._disableDelayedDrag)) + : (Oe(c, "mouseup", i._disableDelayedDrag), + Oe(c, "touchend", i._disableDelayedDrag), + Oe(c, "touchcancel", i._disableDelayedDrag)), + Oe(c, "mousemove", i._delayedDragTouchMoveHandler), + Oe(c, "touchmove", i._delayedDragTouchMoveHandler), + a.supportPointer && + Oe( + c, + "pointermove", + i._delayedDragTouchMoveHandler, + ), + (i._dragStartTimer = setTimeout(f, a.delay))); + } else f(); + } + }, + _delayedDragTouchMoveHandler: function (t) { + var r = t.touches ? t.touches[0] : t; + Math.max( + Math.abs(r.clientX - this._lastX), + Math.abs(r.clientY - this._lastY), + ) >= + Math.floor( + this.options.touchStartThreshold / + ((this.nativeDraggable && window.devicePixelRatio) || + 1), + ) && this._disableDelayedDrag(); + }, + _disableDelayedDrag: function () { + (k && ui(k), + clearTimeout(this._dragStartTimer), + this._disableDelayedDragEvents()); + }, + _disableDelayedDragEvents: function () { + var t = this.el.ownerDocument; + (Ee(t, "mouseup", this._disableDelayedDrag), + Ee(t, "touchend", this._disableDelayedDrag), + Ee(t, "touchcancel", this._disableDelayedDrag), + Ee(t, "pointerup", this._disableDelayedDrag), + Ee(t, "pointercancel", this._disableDelayedDrag), + Ee(t, "mousemove", this._delayedDragTouchMoveHandler), + Ee(t, "touchmove", this._delayedDragTouchMoveHandler), + Ee(t, "pointermove", this._delayedDragTouchMoveHandler)); + }, + _triggerDragStart: function (t, r) { + ((r = r || (t.pointerType == "touch" && t)), + !this.nativeDraggable || r + ? this.options.supportPointer + ? Oe(document, "pointermove", this._onTouchMove) + : r + ? Oe(document, "touchmove", this._onTouchMove) + : Oe(document, "mousemove", this._onTouchMove) + : (Oe(k, "dragend", this), + Oe(Ne, "dragstart", this._onDragStart))); + try { + document.selection + ? Dr(function () { + document.selection.empty(); + }) + : window.getSelection().removeAllRanges(); + } catch {} + }, + _dragStarted: function (t, r) { + if (((In = !1), Ne && k)) { + (at("dragStarted", this, { evt: r }), + this.nativeDraggable && Oe(document, "dragover", us)); + var n = this.options; + (!t && ft(k, n.dragClass, !1), + ft(k, n.ghostClass, !0), + (se.active = this), + t && this._appendGhost(), + it({ sortable: this, name: "start", originalEvent: r })); + } else this._nulling(); + }, + _emulateDragOver: function () { + if (Ot) { + ((this._lastX = Ot.clientX), (this._lastY = Ot.clientY), Fo()); + for ( + var t = document.elementFromPoint(Ot.clientX, Ot.clientY), + r = t; + t && + t.shadowRoot && + ((t = t.shadowRoot.elementFromPoint( + Ot.clientX, + Ot.clientY, + )), + t !== r); + ) + r = t; + if ((k.parentNode[st]._isOutsideThisEl(t), r)) + do { + if (r[st]) { + var n = void 0; + if ( + ((n = r[st]._onDragOver({ + clientX: Ot.clientX, + clientY: Ot.clientY, + target: t, + rootEl: r, + })), + n && !this.options.dragoverBubble) + ) + break; + } + t = r; + } while ((r = Co(r))); + ko(); + } + }, + _onTouchMove: function (t) { + if (mn) { + var r = this.options, + n = r.fallbackTolerance, + i = r.fallbackOffset, + o = t.touches ? t.touches[0] : t, + a = ue && Fn(ue, !0), + c = ue && a && a.a, + f = ue && a && a.d, + u = Er && nt && yo(nt), + y = + (o.clientX - mn.clientX + i.x) / (c || 1) + + (u ? u[0] - fi[0] : 0) / (c || 1), + m = + (o.clientY - mn.clientY + i.y) / (f || 1) + + (u ? u[1] - fi[1] : 0) / (f || 1); + if (!se.active && !In) { + if ( + n && + Math.max( + Math.abs(o.clientX - this._lastX), + Math.abs(o.clientY - this._lastY), + ) < n + ) + return; + this._onDragStart(t, !0); + } + if (ue) { + a + ? ((a.e += y - (li || 0)), (a.f += m - (ci || 0))) + : (a = { a: 1, b: 0, c: 0, d: 1, e: y, f: m }); + var O = "matrix(" + .concat(a.a, ",") + .concat(a.b, ",") + .concat(a.c, ",") + .concat(a.d, ",") + .concat(a.e, ",") + .concat(a.f, ")"); + (ae(ue, "webkitTransform", O), + ae(ue, "mozTransform", O), + ae(ue, "msTransform", O), + ae(ue, "transform", O), + (li = y), + (ci = m), + (Ot = o)); + } + t.cancelable && t.preventDefault(); + } + }, + _appendGhost: function () { + if (!ue) { + var t = this.options.fallbackOnBody ? document.body : Ne, + r = qe(k, !0, Er, !0, t), + n = this.options; + if (Er) { + for ( + nt = t; + ae(nt, "position") === "static" && + ae(nt, "transform") === "none" && + nt !== document; + ) + nt = nt.parentNode; + (nt !== document.body && nt !== document.documentElement + ? (nt === document && (nt = Pt()), + (r.top += nt.scrollTop), + (r.left += nt.scrollLeft)) + : (nt = Pt()), + (fi = yo(nt))); + } + ((ue = k.cloneNode(!0)), + ft(ue, n.ghostClass, !1), + ft(ue, n.fallbackClass, !0), + ft(ue, n.dragClass, !0), + ae(ue, "transition", ""), + ae(ue, "transform", ""), + ae(ue, "box-sizing", "border-box"), + ae(ue, "margin", 0), + ae(ue, "top", r.top), + ae(ue, "left", r.left), + ae(ue, "width", r.width), + ae(ue, "height", r.height), + ae(ue, "opacity", "0.8"), + ae(ue, "position", Er ? "absolute" : "fixed"), + ae(ue, "zIndex", "100000"), + ae(ue, "pointerEvents", "none"), + (se.ghost = ue), + t.appendChild(ue), + ae( + ue, + "transform-origin", + (wo / parseInt(ue.style.width)) * 100 + + "% " + + (xo / parseInt(ue.style.height)) * 100 + + "%", + )); + } + }, + _onDragStart: function (t, r) { + var n = this, + i = t.dataTransfer, + o = n.options; + if ((at("dragStart", this, { evt: t }), se.eventCanceled)) { + this._onDrop(); + return; + } + (at("setupClone", this), + se.eventCanceled || + ((We = Po(k)), + We.removeAttribute("id"), + (We.draggable = !1), + (We.style["will-change"] = ""), + this._hideClone(), + ft(We, this.options.chosenClass, !1), + (se.clone = We)), + (n.cloneId = Dr(function () { + (at("clone", n), + !se.eventCanceled && + (n.options.removeCloneOnHide || + Ne.insertBefore(We, k), + n._hideClone(), + it({ sortable: n, name: "clone" }))); + })), + !r && ft(k, o.dragClass, !0), + r + ? ((Pr = !0), + (n._loopId = setInterval(n._emulateDragOver, 50))) + : (Ee(document, "mouseup", n._onDrop), + Ee(document, "touchend", n._onDrop), + Ee(document, "touchcancel", n._onDrop), + i && + ((i.effectAllowed = "move"), + o.setData && o.setData.call(n, i, k)), + Oe(document, "drop", n), + ae(k, "transform", "translateZ(0)")), + (In = !0), + (n._dragStartId = Dr(n._dragStarted.bind(n, r, t))), + Oe(document, "selectstart", n), + (Yn = !0), + window.getSelection().removeAllRanges(), + Gn && ae(document.body, "user-select", "none")); + }, + _onDragOver: function (t) { + var r = this.el, + n = t.target, + i, + o, + a, + c = this.options, + f = c.group, + u = se.active, + y = wr === f, + m = c.sort, + O = Qe || u, + S, + x = this, + M = !1; + if (vi) return; + function I(R, Z) { + at( + R, + x, + Mt( + { + evt: t, + isOwner: y, + axis: S ? "vertical" : "horizontal", + revert: a, + dragRect: i, + targetRect: o, + canSort: m, + fromSortable: O, + target: n, + completed: A, + onMove: function (Rt, Ut) { + return Or(Ne, r, k, i, Rt, qe(Rt), t, Ut); + }, + changed: N, + }, + Z, + ), + ); + } + function $() { + (I("dragOverAnimationCapture"), + x.captureAnimationState(), + x !== O && O.captureAnimationState()); + } + function A(R) { + return ( + I("dragOverCompleted", { insertion: R }), + R && + (y ? u._hideClone() : u._showClone(x), + x !== O && + (ft( + k, + Qe + ? Qe.options.ghostClass + : u.options.ghostClass, + !1, + ), + ft(k, c.ghostClass, !0)), + Qe !== x && x !== se.active + ? (Qe = x) + : x === se.active && Qe && (Qe = null), + O === x && (x._ignoreWhileAnimating = n), + x.animateAll(function () { + (I("dragOverAnimationComplete"), + (x._ignoreWhileAnimating = null)); + }), + x !== O && + (O.animateAll(), (O._ignoreWhileAnimating = null))), + ((n === k && !k.animated) || (n === r && !n.animated)) && + (Rn = null), + !c.dragoverBubble && + !t.rootEl && + n !== document && + (k.parentNode[st]._isOutsideThisEl(t.target), + !R && gn(t)), + !c.dragoverBubble && + t.stopPropagation && + t.stopPropagation(), + (M = !0) + ); + } + function N() { + ((ut = vt(k)), + (on = vt(k, c.draggable)), + it({ + sortable: x, + name: "change", + toEl: r, + newIndex: ut, + newDraggableIndex: on, + originalEvent: t, + })); + } + if ( + (t.preventDefault !== void 0 && + t.cancelable && + t.preventDefault(), + (n = St(n, c.draggable, r, !0)), + I("dragOver"), + se.eventCanceled) + ) + return M; + if ( + k.contains(t.target) || + (n.animated && n.animatingX && n.animatingY) || + x._ignoreWhileAnimating === n + ) + return A(!1); + if ( + ((Pr = !1), + u && + !c.disabled && + (y + ? m || (a = Ve !== Ne) + : Qe === this || + ((this.lastPutMode = wr.checkPull(this, u, k, t)) && + f.checkPut(this, u, k, t)))) + ) { + if ( + ((S = this._getDirection(t, n) === "vertical"), + (i = qe(k)), + I("dragOverValid"), + se.eventCanceled) + ) + return M; + if (a) + return ( + (Ve = Ne), + $(), + this._hideClone(), + I("revert"), + se.eventCanceled || + (bn ? Ne.insertBefore(k, bn) : Ne.appendChild(k)), + A(!0) + ); + var Y = wi(r, c.draggable); + if (!Y || (vs(t, S, this) && !Y.animated)) { + if (Y === k) return A(!1); + if ( + (Y && r === t.target && (n = Y), + n && (o = qe(n)), + Or(Ne, r, k, i, n, o, t, !!n) !== !1) + ) + return ( + $(), + Y && Y.nextSibling + ? r.insertBefore(k, Y.nextSibling) + : r.appendChild(k), + (Ve = r), + N(), + A(!0) + ); + } else if (Y && hs(t, S, this)) { + var ne = kn(r, 0, c, !0); + if (ne === k) return A(!1); + if ( + ((n = ne), + (o = qe(n)), + Or(Ne, r, k, i, n, o, t, !1) !== !1) + ) + return ( + $(), + r.insertBefore(k, ne), + (Ve = r), + N(), + A(!0) + ); + } else if (n.parentNode === r) { + o = qe(n); + var J = 0, + V, + de = k.parentNode !== r, + X = !cs( + (k.animated && k.toRect) || i, + (n.animated && n.toRect) || o, + S, + ), + Q = S ? "top" : "left", + me = bo(n, "top", "top") || bo(k, "top", "top"), + l = me ? me.scrollTop : void 0; + (Rn !== n && + ((V = o[Q]), + (Zn = !1), + (xr = (!X && c.invertSwap) || de)), + (J = ms( + t, + n, + o, + S, + X ? 1 : c.swapThreshold, + c.invertedSwapThreshold == null + ? c.swapThreshold + : c.invertedSwapThreshold, + xr, + Rn === n, + ))); + var h; + if (J !== 0) { + var v = vt(k); + do ((v -= J), (h = Ve.children[v])); + while (h && (ae(h, "display") === "none" || h === ue)); + } + if (J === 0 || h === n) return A(!1); + ((Rn = n), (Qn = J)); + var p = n.nextElementSibling, + j = !1; + j = J === 1; + var P = Or(Ne, r, k, i, n, o, t, j); + if (P !== !1) + return ( + (P === 1 || P === -1) && (j = P === 1), + (vi = !0), + setTimeout(ps, 30), + $(), + j && !p + ? r.appendChild(k) + : n.parentNode.insertBefore(k, j ? p : n), + me && To(me, 0, l - me.scrollTop), + (Ve = k.parentNode), + V !== void 0 && + !xr && + (Cr = Math.abs(V - qe(n)[Q])), + N(), + A(!0) + ); + } + if (r.contains(k)) return A(!1); + } + return !1; + }, + _ignoreWhileAnimating: null, + _offMoveEvents: function () { + (Ee(document, "mousemove", this._onTouchMove), + Ee(document, "touchmove", this._onTouchMove), + Ee(document, "pointermove", this._onTouchMove), + Ee(document, "dragover", gn), + Ee(document, "mousemove", gn), + Ee(document, "touchmove", gn)); + }, + _offUbEvents: function () { + var t = this.el.ownerDocument; + (Ee(t, "mouseup", this._onDrop), + Ee(t, "touchend", this._onDrop), + Ee(t, "pointerup", this._onDrop), + Ee(t, "pointercancel", this._onDrop), + Ee(t, "touchcancel", this._onDrop), + Ee(document, "selectstart", this)); + }, + _onDrop: function (t) { + var r = this.el, + n = this.options; + if ( + ((ut = vt(k)), + (on = vt(k, n.draggable)), + at("drop", this, { evt: t }), + (Ve = k && k.parentNode), + (ut = vt(k)), + (on = vt(k, n.draggable)), + se.eventCanceled) + ) { + this._nulling(); + return; + } + ((In = !1), + (xr = !1), + (Zn = !1), + clearInterval(this._loopId), + clearTimeout(this._dragStartTimer), + mi(this.cloneId), + mi(this._dragStartId), + this.nativeDraggable && + (Ee(document, "drop", this), + Ee(r, "dragstart", this._onDragStart)), + this._offMoveEvents(), + this._offUbEvents(), + Gn && ae(document.body, "user-select", ""), + ae(k, "transform", ""), + t && + (Yn && + (t.cancelable && t.preventDefault(), + !n.dropBubble && t.stopPropagation()), + ue && ue.parentNode && ue.parentNode.removeChild(ue), + (Ne === Ve || (Qe && Qe.lastPutMode !== "clone")) && + We && + We.parentNode && + We.parentNode.removeChild(We), + k && + (this.nativeDraggable && Ee(k, "dragend", this), + ui(k), + (k.style["will-change"] = ""), + Yn && + !In && + ft( + k, + Qe + ? Qe.options.ghostClass + : this.options.ghostClass, + !1, + ), + ft(k, this.options.chosenClass, !1), + it({ + sortable: this, + name: "unchoose", + toEl: Ve, + newIndex: null, + newDraggableIndex: null, + originalEvent: t, + }), + Ne !== Ve + ? (ut >= 0 && + (it({ + rootEl: Ve, + name: "add", + toEl: Ve, + fromEl: Ne, + originalEvent: t, + }), + it({ + sortable: this, + name: "remove", + toEl: Ve, + originalEvent: t, + }), + it({ + rootEl: Ve, + name: "sort", + toEl: Ve, + fromEl: Ne, + originalEvent: t, + }), + it({ + sortable: this, + name: "sort", + toEl: Ve, + originalEvent: t, + })), + Qe && Qe.save()) + : ut !== Ln && + ut >= 0 && + (it({ + sortable: this, + name: "update", + toEl: Ve, + originalEvent: t, + }), + it({ + sortable: this, + name: "sort", + toEl: Ve, + originalEvent: t, + })), + se.active && + ((ut == null || ut === -1) && + ((ut = Ln), (on = Jn)), + it({ + sortable: this, + name: "end", + toEl: Ve, + originalEvent: t, + }), + this.save()))), + this._nulling()); + }, + _nulling: function () { + (at("nulling", this), + (Ne = + k = + Ve = + ue = + bn = + We = + Ar = + an = + mn = + Ot = + Yn = + ut = + on = + Ln = + Jn = + Rn = + Qn = + Qe = + wr = + se.dragged = + se.ghost = + se.clone = + se.active = + null), + Rr.forEach(function (t) { + t.checked = !0; + }), + (Rr.length = li = ci = 0)); + }, + handleEvent: function (t) { + switch (t.type) { + case "drop": + case "dragend": + this._onDrop(t); + break; + case "dragenter": + case "dragover": + k && (this._onDragOver(t), ds(t)); + break; + case "selectstart": + t.preventDefault(); + break; + } + }, + toArray: function () { + for ( + var t = [], + r, + n = this.el.children, + i = 0, + o = n.length, + a = this.options; + i < o; + i++ + ) + ((r = n[i]), + St(r, a.draggable, this.el, !1) && + t.push(r.getAttribute(a.dataIdAttr) || bs(r))); + return t; + }, + sort: function (t, r) { + var n = {}, + i = this.el; + (this.toArray().forEach(function (o, a) { + var c = i.children[a]; + St(c, this.options.draggable, i, !1) && (n[o] = c); + }, this), + r && this.captureAnimationState(), + t.forEach(function (o) { + n[o] && (i.removeChild(n[o]), i.appendChild(n[o])); + }), + r && this.animateAll()); + }, + save: function () { + var t = this.options.store; + t && t.set && t.set(this); + }, + closest: function (t, r) { + return St(t, r || this.options.draggable, this.el, !1); + }, + option: function (t, r) { + var n = this.options; + if (r === void 0) return n[t]; + var i = tr.modifyOption(this, t, r); + (typeof i < "u" ? (n[t] = i) : (n[t] = r), t === "group" && Lo(n)); + }, + destroy: function () { + at("destroy", this); + var t = this.el; + ((t[st] = null), + Ee(t, "mousedown", this._onTapStart), + Ee(t, "touchstart", this._onTapStart), + Ee(t, "pointerdown", this._onTapStart), + this.nativeDraggable && + (Ee(t, "dragover", this), Ee(t, "dragenter", this)), + Array.prototype.forEach.call( + t.querySelectorAll("[draggable]"), + function (r) { + r.removeAttribute("draggable"); + }, + ), + this._onDrop(), + this._disableDelayedDragEvents(), + Mr.splice(Mr.indexOf(this.el), 1), + (this.el = t = null)); + }, + _hideClone: function () { + if (!an) { + if ((at("hideClone", this), se.eventCanceled)) return; + (ae(We, "display", "none"), + this.options.removeCloneOnHide && + We.parentNode && + We.parentNode.removeChild(We), + (an = !0)); + } + }, + _showClone: function (t) { + if (t.lastPutMode !== "clone") { + this._hideClone(); + return; + } + if (an) { + if ((at("showClone", this), se.eventCanceled)) return; + (k.parentNode == Ne && !this.options.group.revertClone + ? Ne.insertBefore(We, k) + : bn + ? Ne.insertBefore(We, bn) + : Ne.appendChild(We), + this.options.group.revertClone && this.animate(k, We), + ae(We, "display", ""), + (an = !1)); + } + }, + }; + function ds(e) { + (e.dataTransfer && (e.dataTransfer.dropEffect = "move"), + e.cancelable && e.preventDefault()); + } + function Or(e, t, r, n, i, o, a, c) { + var f, + u = e[st], + y = u.options.onMove, + m; + return ( + window.CustomEvent && !Wt && !er + ? (f = new CustomEvent("move", { bubbles: !0, cancelable: !0 })) + : ((f = document.createEvent("Event")), + f.initEvent("move", !0, !0)), + (f.to = t), + (f.from = e), + (f.dragged = r), + (f.draggedRect = n), + (f.related = i || t), + (f.relatedRect = o || qe(t)), + (f.willInsertAfter = c), + (f.originalEvent = a), + e.dispatchEvent(f), + y && (m = y.call(u, f, a)), + m + ); + } + function ui(e) { + e.draggable = !1; + } + function ps() { + vi = !1; + } + function hs(e, t, r) { + var n = qe(kn(r.el, 0, r.options, !0)), + i = Mo(r.el, r.options, ue), + o = 10; + return t + ? e.clientX < i.left - o || + (e.clientY < n.top && e.clientX < n.right) + : e.clientY < i.top - o || + (e.clientY < n.bottom && e.clientX < n.left); + } + function vs(e, t, r) { + var n = qe(wi(r.el, r.options.draggable)), + i = Mo(r.el, r.options, ue), + o = 10; + return t + ? e.clientX > i.right + o || + (e.clientY > n.bottom && e.clientX > n.left) + : e.clientY > i.bottom + o || + (e.clientX > n.right && e.clientY > n.top); + } + function ms(e, t, r, n, i, o, a, c) { + var f = n ? e.clientY : e.clientX, + u = n ? r.height : r.width, + y = n ? r.top : r.left, + m = n ? r.bottom : r.right, + O = !1; + if (!a) { + if (c && Cr < u * i) { + if ( + (!Zn && + (Qn === 1 + ? f > y + (u * o) / 2 + : f < m - (u * o) / 2) && + (Zn = !0), + Zn) + ) + O = !0; + else if (Qn === 1 ? f < y + Cr : f > m - Cr) return -Qn; + } else if (f > y + (u * (1 - i)) / 2 && f < m - (u * (1 - i)) / 2) + return gs(t); + } + return ( + (O = O || a), + O && (f < y + (u * o) / 2 || f > m - (u * o) / 2) + ? f > y + u / 2 + ? 1 + : -1 + : 0 + ); + } + function gs(e) { + return vt(k) < vt(e) ? 1 : -1; + } + function bs(e) { + for ( + var t = e.tagName + e.className + e.src + e.href + e.textContent, + r = t.length, + n = 0; + r--; + ) + n += t.charCodeAt(r); + return n.toString(36); + } + function ys(e) { + Rr.length = 0; + for (var t = e.getElementsByTagName("input"), r = t.length; r--; ) { + var n = t[r]; + n.checked && Rr.push(n); + } + } + function Dr(e) { + return setTimeout(e, 0); + } + function mi(e) { + return clearTimeout(e); + } + Lr && + Oe(document, "touchmove", function (e) { + (se.active || In) && e.cancelable && e.preventDefault(); + }); + se.utils = { + on: Oe, + off: Ee, + css: ae, + find: Do, + is: function (t, r) { + return !!St(t, r, t, !1); + }, + extend: ts, + throttle: _o, + closest: St, + toggleClass: ft, + clone: Po, + index: vt, + nextTick: Dr, + cancelNextTick: mi, + detectDirection: Io, + getChild: kn, + expando: st, + }; + se.get = function (e) { + return e[st]; + }; + se.mount = function () { + for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++) + t[r] = arguments[r]; + (t[0].constructor === Array && (t = t[0]), + t.forEach(function (n) { + if (!n.prototype || !n.prototype.constructor) + throw "Sortable: Mounted plugin must be a constructor function, not ".concat( + {}.toString.call(n), + ); + (n.utils && (se.utils = Mt(Mt({}, se.utils), n.utils)), + tr.mount(n)); + })); + }; + se.create = function (e, t) { + return new se(e, t); + }; + se.version = Za; + var Xe = [], + Xn, + gi, + bi = !1, + di, + pi, + Ir, + qn; + function ws() { + function e() { + this.defaults = { + scroll: !0, + forceAutoScrollFallback: !1, + scrollSensitivity: 30, + scrollSpeed: 10, + bubbleScroll: !0, + }; + for (var t in this) + t.charAt(0) === "_" && + typeof this[t] == "function" && + (this[t] = this[t].bind(this)); + } + return ( + (e.prototype = { + dragStarted: function (r) { + var n = r.originalEvent; + this.sortable.nativeDraggable + ? Oe(document, "dragover", this._handleAutoScroll) + : this.options.supportPointer + ? Oe( + document, + "pointermove", + this._handleFallbackAutoScroll, + ) + : n.touches + ? Oe( + document, + "touchmove", + this._handleFallbackAutoScroll, + ) + : Oe( + document, + "mousemove", + this._handleFallbackAutoScroll, + ); + }, + dragOverCompleted: function (r) { + var n = r.originalEvent; + !this.options.dragOverBubble && + !n.rootEl && + this._handleAutoScroll(n); + }, + drop: function () { + (this.sortable.nativeDraggable + ? Ee(document, "dragover", this._handleAutoScroll) + : (Ee( + document, + "pointermove", + this._handleFallbackAutoScroll, + ), + Ee( + document, + "touchmove", + this._handleFallbackAutoScroll, + ), + Ee( + document, + "mousemove", + this._handleFallbackAutoScroll, + )), + Oo(), + _r(), + ns()); + }, + nulling: function () { + ((Ir = gi = Xn = bi = qn = di = pi = null), + (Xe.length = 0)); + }, + _handleFallbackAutoScroll: function (r) { + this._handleAutoScroll(r, !0); + }, + _handleAutoScroll: function (r, n) { + var i = this, + o = (r.touches ? r.touches[0] : r).clientX, + a = (r.touches ? r.touches[0] : r).clientY, + c = document.elementFromPoint(o, a); + if ( + ((Ir = r), + n || + this.options.forceAutoScrollFallback || + er || + Wt || + Gn) + ) { + hi(r, this.options, c, n); + var f = sn(c, !0); + bi && + (!qn || o !== di || a !== pi) && + (qn && Oo(), + (qn = setInterval(function () { + var u = sn(document.elementFromPoint(o, a), !0); + (u !== f && ((f = u), _r()), + hi(r, i.options, u, n)); + }, 10)), + (di = o), + (pi = a)); + } else { + if (!this.options.bubbleScroll || sn(c, !0) === Pt()) { + _r(); + return; + } + hi(r, this.options, sn(c, !1), !1); + } + }, + }), + $t(e, { pluginName: "scroll", initializeByDefault: !0 }) + ); + } + function _r() { + (Xe.forEach(function (e) { + clearInterval(e.pid); + }), + (Xe = [])); + } + function Oo() { + clearInterval(qn); + } + var hi = _o(function (e, t, r, n) { + if (t.scroll) { + var i = (e.touches ? e.touches[0] : e).clientX, + o = (e.touches ? e.touches[0] : e).clientY, + a = t.scrollSensitivity, + c = t.scrollSpeed, + f = Pt(), + u = !1, + y; + gi !== r && + ((gi = r), + _r(), + (Xn = t.scroll), + (y = t.scrollFn), + Xn === !0 && (Xn = sn(r, !0))); + var m = 0, + O = Xn; + do { + var S = O, + x = qe(S), + M = x.top, + I = x.bottom, + $ = x.left, + A = x.right, + N = x.width, + Y = x.height, + ne = void 0, + J = void 0, + V = S.scrollWidth, + de = S.scrollHeight, + X = ae(S), + Q = S.scrollLeft, + me = S.scrollTop; + S === f + ? ((ne = + N < V && + (X.overflowX === "auto" || + X.overflowX === "scroll" || + X.overflowX === "visible")), + (J = + Y < de && + (X.overflowY === "auto" || + X.overflowY === "scroll" || + X.overflowY === "visible"))) + : ((ne = + N < V && + (X.overflowX === "auto" || + X.overflowX === "scroll")), + (J = + Y < de && + (X.overflowY === "auto" || + X.overflowY === "scroll"))); + var l = + ne && + (Math.abs(A - i) <= a && Q + N < V) - + (Math.abs($ - i) <= a && !!Q), + h = + J && + (Math.abs(I - o) <= a && me + Y < de) - + (Math.abs(M - o) <= a && !!me); + if (!Xe[m]) + for (var v = 0; v <= m; v++) Xe[v] || (Xe[v] = {}); + ((Xe[m].vx != l || Xe[m].vy != h || Xe[m].el !== S) && + ((Xe[m].el = S), + (Xe[m].vx = l), + (Xe[m].vy = h), + clearInterval(Xe[m].pid), + (l != 0 || h != 0) && + ((u = !0), + (Xe[m].pid = setInterval( + function () { + n && + this.layer === 0 && + se.active._onTouchMove(Ir); + var p = Xe[this.layer].vy + ? Xe[this.layer].vy * c + : 0, + j = Xe[this.layer].vx + ? Xe[this.layer].vx * c + : 0; + (typeof y == "function" && + y.call( + se.dragged.parentNode[st], + j, + p, + e, + Ir, + Xe[this.layer].el, + ) !== "continue") || + To(Xe[this.layer].el, j, p); + }.bind({ layer: m }), + 24, + )))), + m++); + } while (t.bubbleScroll && O !== f && (O = sn(O, !1))); + bi = u; + } + }, 30), + No = function (t) { + var r = t.originalEvent, + n = t.putSortable, + i = t.dragEl, + o = t.activeSortable, + a = t.dispatchSortableEvent, + c = t.hideGhostForTarget, + f = t.unhideGhostForTarget; + if (r) { + var u = n || o; + c(); + var y = + r.changedTouches && r.changedTouches.length + ? r.changedTouches[0] + : r, + m = document.elementFromPoint(y.clientX, y.clientY); + (f(), + u && + !u.el.contains(m) && + (a("spill"), + this.onSpill({ dragEl: i, putSortable: n }))); + } + }; + function xi() {} + xi.prototype = { + startIndex: null, + dragStart: function (t) { + var r = t.oldDraggableIndex; + this.startIndex = r; + }, + onSpill: function (t) { + var r = t.dragEl, + n = t.putSortable; + (this.sortable.captureAnimationState(), + n && n.captureAnimationState()); + var i = kn(this.sortable.el, this.startIndex, this.options); + (i + ? this.sortable.el.insertBefore(r, i) + : this.sortable.el.appendChild(r), + this.sortable.animateAll(), + n && n.animateAll()); + }, + drop: No, + }; + $t(xi, { pluginName: "revertOnSpill" }); + function Ei() {} + Ei.prototype = { + onSpill: function (t) { + var r = t.dragEl, + n = t.putSortable, + i = n || this.sortable; + (i.captureAnimationState(), + r.parentNode && r.parentNode.removeChild(r), + i.animateAll()); + }, + drop: No, + }; + $t(Ei, { pluginName: "removeOnSpill" }); + se.mount(new ws()); + se.mount(Ei, xi); + var Oi = se; + window.Sortable = Oi; + var jo = (e) => { + e.directive("sortable", (t) => { + let r = parseInt(t.dataset?.sortableAnimationDuration); + (r !== 0 && !r && (r = 300), + (t.sortable = Oi.create(t, { + group: t.getAttribute("x-sortable-group"), + draggable: "[x-sortable-item]", + handle: "[x-sortable-handle]", + dataIdAttr: "x-sortable-item", + animation: r, + ghostClass: "fi-sortable-ghost", + onEnd(n) { + let { + item: i, + to: o, + oldDraggableIndex: a, + newDraggableIndex: c, + } = n; + if (a === c) return; + let f = this.options.draggable, + u = o.querySelectorAll(`:scope > ${f}`)[c - 1]; + u && o.insertBefore(i, u.nextSibling); + }, + }))); + }); + }; + var xs = Object.create, + Ci = Object.defineProperty, + Es = Object.getPrototypeOf, + Os = Object.prototype.hasOwnProperty, + Ss = Object.getOwnPropertyNames, + As = Object.getOwnPropertyDescriptor, + Cs = (e) => Ci(e, "__esModule", { value: !0 }), + Bo = (e, t) => () => ( + t || ((t = { exports: {} }), e(t.exports, t)), + t.exports + ), + Ds = (e, t, r) => { + if ((t && typeof t == "object") || typeof t == "function") + for (let n of Ss(t)) + !Os.call(e, n) && + n !== "default" && + Ci(e, n, { + get: () => t[n], + enumerable: !(r = As(t, n)) || r.enumerable, + }); + return e; + }, + Ho = (e) => + Ds( + Cs( + Ci( + e != null ? xs(Es(e)) : {}, + "default", + e && e.__esModule && "default" in e + ? { get: () => e.default, enumerable: !0 } + : { value: e, enumerable: !0 }, + ), + ), + e, + ), + _s = Bo((e) => { + "use strict"; + Object.defineProperty(e, "__esModule", { value: !0 }); + function t(d) { + var s = d.getBoundingClientRect(); + return { + width: s.width, + height: s.height, + top: s.top, + right: s.right, + bottom: s.bottom, + left: s.left, + x: s.left, + y: s.top, + }; + } + function r(d) { + if (d == null) return window; + if (d.toString() !== "[object Window]") { + var s = d.ownerDocument; + return (s && s.defaultView) || window; + } + return d; + } + function n(d) { + var s = r(d), + b = s.pageXOffset, + _ = s.pageYOffset; + return { scrollLeft: b, scrollTop: _ }; + } + function i(d) { + var s = r(d).Element; + return d instanceof s || d instanceof Element; + } + function o(d) { + var s = r(d).HTMLElement; + return d instanceof s || d instanceof HTMLElement; + } + function a(d) { + if (typeof ShadowRoot > "u") return !1; + var s = r(d).ShadowRoot; + return d instanceof s || d instanceof ShadowRoot; + } + function c(d) { + return { scrollLeft: d.scrollLeft, scrollTop: d.scrollTop }; + } + function f(d) { + return d === r(d) || !o(d) ? n(d) : c(d); + } + function u(d) { + return d ? (d.nodeName || "").toLowerCase() : null; + } + function y(d) { + return ( + (i(d) ? d.ownerDocument : d.document) || window.document + ).documentElement; + } + function m(d) { + return t(y(d)).left + n(d).scrollLeft; + } + function O(d) { + return r(d).getComputedStyle(d); + } + function S(d) { + var s = O(d), + b = s.overflow, + _ = s.overflowX, + T = s.overflowY; + return /auto|scroll|overlay|hidden/.test(b + T + _); + } + function x(d, s, b) { + b === void 0 && (b = !1); + var _ = y(s), + T = t(d), + F = o(s), + U = { scrollLeft: 0, scrollTop: 0 }, + H = { x: 0, y: 0 }; + return ( + (F || (!F && !b)) && + ((u(s) !== "body" || S(_)) && (U = f(s)), + o(s) + ? ((H = t(s)), + (H.x += s.clientLeft), + (H.y += s.clientTop)) + : _ && (H.x = m(_))), + { + x: T.left + U.scrollLeft - H.x, + y: T.top + U.scrollTop - H.y, + width: T.width, + height: T.height, + } + ); + } + function M(d) { + var s = t(d), + b = d.offsetWidth, + _ = d.offsetHeight; + return ( + Math.abs(s.width - b) <= 1 && (b = s.width), + Math.abs(s.height - _) <= 1 && (_ = s.height), + { x: d.offsetLeft, y: d.offsetTop, width: b, height: _ } + ); + } + function I(d) { + return u(d) === "html" + ? d + : d.assignedSlot || + d.parentNode || + (a(d) ? d.host : null) || + y(d); + } + function $(d) { + return ["html", "body", "#document"].indexOf(u(d)) >= 0 + ? d.ownerDocument.body + : o(d) && S(d) + ? d + : $(I(d)); + } + function A(d, s) { + var b; + s === void 0 && (s = []); + var _ = $(d), + T = _ === ((b = d.ownerDocument) == null ? void 0 : b.body), + F = r(_), + U = T + ? [F].concat(F.visualViewport || [], S(_) ? _ : []) + : _, + H = s.concat(U); + return T ? H : H.concat(A(I(U))); + } + function N(d) { + return ["table", "td", "th"].indexOf(u(d)) >= 0; + } + function Y(d) { + return !o(d) || O(d).position === "fixed" + ? null + : d.offsetParent; + } + function ne(d) { + var s = + navigator.userAgent.toLowerCase().indexOf("firefox") !== + -1, + b = navigator.userAgent.indexOf("Trident") !== -1; + if (b && o(d)) { + var _ = O(d); + if (_.position === "fixed") return null; + } + for ( + var T = I(d); + o(T) && ["html", "body"].indexOf(u(T)) < 0; + ) { + var F = O(T); + if ( + F.transform !== "none" || + F.perspective !== "none" || + F.contain === "paint" || + ["transform", "perspective"].indexOf(F.willChange) !== + -1 || + (s && F.willChange === "filter") || + (s && F.filter && F.filter !== "none") + ) + return T; + T = T.parentNode; + } + return null; + } + function J(d) { + for ( + var s = r(d), b = Y(d); + b && N(b) && O(b).position === "static"; + ) + b = Y(b); + return b && + (u(b) === "html" || + (u(b) === "body" && O(b).position === "static")) + ? s + : b || ne(d) || s; + } + var V = "top", + de = "bottom", + X = "right", + Q = "left", + me = "auto", + l = [V, de, X, Q], + h = "start", + v = "end", + p = "clippingParents", + j = "viewport", + P = "popper", + R = "reference", + Z = l.reduce(function (d, s) { + return d.concat([s + "-" + h, s + "-" + v]); + }, []), + ze = [].concat(l, [me]).reduce(function (d, s) { + return d.concat([s, s + "-" + h, s + "-" + v]); + }, []), + Rt = "beforeRead", + Ut = "read", + Fr = "afterRead", + kr = "beforeMain", + Nr = "main", + Vt = "afterMain", + nr = "beforeWrite", + jr = "write", + rr = "afterWrite", + It = [Rt, Ut, Fr, kr, Nr, Vt, nr, jr, rr]; + function Br(d) { + var s = new Map(), + b = new Set(), + _ = []; + d.forEach(function (F) { + s.set(F.name, F); + }); + function T(F) { + b.add(F.name); + var U = [].concat( + F.requires || [], + F.requiresIfExists || [], + ); + (U.forEach(function (H) { + if (!b.has(H)) { + var G = s.get(H); + G && T(G); + } + }), + _.push(F)); + } + return ( + d.forEach(function (F) { + b.has(F.name) || T(F); + }), + _ + ); + } + function mt(d) { + var s = Br(d); + return It.reduce(function (b, _) { + return b.concat( + s.filter(function (T) { + return T.phase === _; + }), + ); + }, []); + } + function zt(d) { + var s; + return function () { + return ( + s || + (s = new Promise(function (b) { + Promise.resolve().then(function () { + ((s = void 0), b(d())); + }); + })), + s + ); + }; + } + function At(d) { + for ( + var s = arguments.length, + b = new Array(s > 1 ? s - 1 : 0), + _ = 1; + _ < s; + _++ + ) + b[_ - 1] = arguments[_]; + return [].concat(b).reduce(function (T, F) { + return T.replace(/%s/, F); + }, d); + } + var Ct = + 'Popper: modifier "%s" provided an invalid %s property, expected %s but got %s', + Hr = + 'Popper: modifier "%s" requires "%s", but "%s" modifier is not available', + Ze = [ + "name", + "enabled", + "phase", + "fn", + "effect", + "requires", + "options", + ]; + function $r(d) { + d.forEach(function (s) { + Object.keys(s).forEach(function (b) { + switch (b) { + case "name": + typeof s.name != "string" && + console.error( + At( + Ct, + String(s.name), + '"name"', + '"string"', + '"' + String(s.name) + '"', + ), + ); + break; + case "enabled": + typeof s.enabled != "boolean" && + console.error( + At( + Ct, + s.name, + '"enabled"', + '"boolean"', + '"' + String(s.enabled) + '"', + ), + ); + case "phase": + It.indexOf(s.phase) < 0 && + console.error( + At( + Ct, + s.name, + '"phase"', + "either " + It.join(", "), + '"' + String(s.phase) + '"', + ), + ); + break; + case "fn": + typeof s.fn != "function" && + console.error( + At( + Ct, + s.name, + '"fn"', + '"function"', + '"' + String(s.fn) + '"', + ), + ); + break; + case "effect": + typeof s.effect != "function" && + console.error( + At( + Ct, + s.name, + '"effect"', + '"function"', + '"' + String(s.fn) + '"', + ), + ); + break; + case "requires": + Array.isArray(s.requires) || + console.error( + At( + Ct, + s.name, + '"requires"', + '"array"', + '"' + String(s.requires) + '"', + ), + ); + break; + case "requiresIfExists": + Array.isArray(s.requiresIfExists) || + console.error( + At( + Ct, + s.name, + '"requiresIfExists"', + '"array"', + '"' + + String(s.requiresIfExists) + + '"', + ), + ); + break; + case "options": + case "data": + break; + default: + console.error( + 'PopperJS: an invalid property has been provided to the "' + + s.name + + '" modifier, valid properties are ' + + Ze.map(function (_) { + return '"' + _ + '"'; + }).join(", ") + + '; but "' + + b + + '" was provided.', + ); + } + s.requires && + s.requires.forEach(function (_) { + d.find(function (T) { + return T.name === _; + }) == null && + console.error(At(Hr, String(s.name), _, _)); + }); + }); + }); + } + function Wr(d, s) { + var b = new Set(); + return d.filter(function (_) { + var T = s(_); + if (!b.has(T)) return (b.add(T), !0); + }); + } + function ot(d) { + return d.split("-")[0]; + } + function Ur(d) { + var s = d.reduce(function (b, _) { + var T = b[_.name]; + return ( + (b[_.name] = T + ? Object.assign({}, T, _, { + options: Object.assign( + {}, + T.options, + _.options, + ), + data: Object.assign({}, T.data, _.data), + }) + : _), + b + ); + }, {}); + return Object.keys(s).map(function (b) { + return s[b]; + }); + } + function ir(d) { + var s = r(d), + b = y(d), + _ = s.visualViewport, + T = b.clientWidth, + F = b.clientHeight, + U = 0, + H = 0; + return ( + _ && + ((T = _.width), + (F = _.height), + /^((?!chrome|android).)*safari/i.test( + navigator.userAgent, + ) || ((U = _.offsetLeft), (H = _.offsetTop))), + { width: T, height: F, x: U + m(d), y: H } + ); + } + var gt = Math.max, + ln = Math.min, + Yt = Math.round; + function or(d) { + var s, + b = y(d), + _ = n(d), + T = (s = d.ownerDocument) == null ? void 0 : s.body, + F = gt( + b.scrollWidth, + b.clientWidth, + T ? T.scrollWidth : 0, + T ? T.clientWidth : 0, + ), + U = gt( + b.scrollHeight, + b.clientHeight, + T ? T.scrollHeight : 0, + T ? T.clientHeight : 0, + ), + H = -_.scrollLeft + m(d), + G = -_.scrollTop; + return ( + O(T || b).direction === "rtl" && + (H += gt(b.clientWidth, T ? T.clientWidth : 0) - F), + { width: F, height: U, x: H, y: G } + ); + } + function Nn(d, s) { + var b = s.getRootNode && s.getRootNode(); + if (d.contains(s)) return !0; + if (b && a(b)) { + var _ = s; + do { + if (_ && d.isSameNode(_)) return !0; + _ = _.parentNode || _.host; + } while (_); + } + return !1; + } + function Xt(d) { + return Object.assign({}, d, { + left: d.x, + top: d.y, + right: d.x + d.width, + bottom: d.y + d.height, + }); + } + function ar(d) { + var s = t(d); + return ( + (s.top = s.top + d.clientTop), + (s.left = s.left + d.clientLeft), + (s.bottom = s.top + d.clientHeight), + (s.right = s.left + d.clientWidth), + (s.width = d.clientWidth), + (s.height = d.clientHeight), + (s.x = s.left), + (s.y = s.top), + s + ); + } + function sr(d, s) { + return s === j ? Xt(ir(d)) : o(s) ? ar(s) : Xt(or(y(d))); + } + function yn(d) { + var s = A(I(d)), + b = ["absolute", "fixed"].indexOf(O(d).position) >= 0, + _ = b && o(d) ? J(d) : d; + return i(_) + ? s.filter(function (T) { + return i(T) && Nn(T, _) && u(T) !== "body"; + }) + : []; + } + function wn(d, s, b) { + var _ = s === "clippingParents" ? yn(d) : [].concat(s), + T = [].concat(_, [b]), + F = T[0], + U = T.reduce( + function (H, G) { + var oe = sr(d, G); + return ( + (H.top = gt(oe.top, H.top)), + (H.right = ln(oe.right, H.right)), + (H.bottom = ln(oe.bottom, H.bottom)), + (H.left = gt(oe.left, H.left)), + H + ); + }, + sr(d, F), + ); + return ( + (U.width = U.right - U.left), + (U.height = U.bottom - U.top), + (U.x = U.left), + (U.y = U.top), + U + ); + } + function cn(d) { + return d.split("-")[1]; + } + function dt(d) { + return ["top", "bottom"].indexOf(d) >= 0 ? "x" : "y"; + } + function lr(d) { + var s = d.reference, + b = d.element, + _ = d.placement, + T = _ ? ot(_) : null, + F = _ ? cn(_) : null, + U = s.x + s.width / 2 - b.width / 2, + H = s.y + s.height / 2 - b.height / 2, + G; + switch (T) { + case V: + G = { x: U, y: s.y - b.height }; + break; + case de: + G = { x: U, y: s.y + s.height }; + break; + case X: + G = { x: s.x + s.width, y: H }; + break; + case Q: + G = { x: s.x - b.width, y: H }; + break; + default: + G = { x: s.x, y: s.y }; + } + var oe = T ? dt(T) : null; + if (oe != null) { + var z = oe === "y" ? "height" : "width"; + switch (F) { + case h: + G[oe] = G[oe] - (s[z] / 2 - b[z] / 2); + break; + case v: + G[oe] = G[oe] + (s[z] / 2 - b[z] / 2); + break; + } + } + return G; + } + function cr() { + return { top: 0, right: 0, bottom: 0, left: 0 }; + } + function fr(d) { + return Object.assign({}, cr(), d); + } + function ur(d, s) { + return s.reduce(function (b, _) { + return ((b[_] = d), b); + }, {}); + } + function qt(d, s) { + s === void 0 && (s = {}); + var b = s, + _ = b.placement, + T = _ === void 0 ? d.placement : _, + F = b.boundary, + U = F === void 0 ? p : F, + H = b.rootBoundary, + G = H === void 0 ? j : H, + oe = b.elementContext, + z = oe === void 0 ? P : oe, + De = b.altBoundary, + Fe = De === void 0 ? !1 : De, + Ce = b.padding, + xe = Ce === void 0 ? 0 : Ce, + Me = fr(typeof xe != "number" ? xe : ur(xe, l)), + Se = z === P ? R : P, + Be = d.elements.reference, + Re = d.rects.popper, + He = d.elements[Fe ? Se : z], + ce = wn( + i(He) ? He : He.contextElement || y(d.elements.popper), + U, + G, + ), + Pe = t(Be), + _e = lr({ + reference: Pe, + element: Re, + strategy: "absolute", + placement: T, + }), + ke = Xt(Object.assign({}, Re, _e)), + Le = z === P ? ke : Pe, + Ye = { + top: ce.top - Le.top + Me.top, + bottom: Le.bottom - ce.bottom + Me.bottom, + left: ce.left - Le.left + Me.left, + right: Le.right - ce.right + Me.right, + }, + $e = d.modifiersData.offset; + if (z === P && $e) { + var Ue = $e[T]; + Object.keys(Ye).forEach(function (wt) { + var et = [X, de].indexOf(wt) >= 0 ? 1 : -1, + Ft = [V, de].indexOf(wt) >= 0 ? "y" : "x"; + Ye[wt] += Ue[Ft] * et; + }); + } + return Ye; + } + var dr = + "Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.", + Vr = + "Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.", + xn = { + placement: "bottom", + modifiers: [], + strategy: "absolute", + }; + function fn() { + for ( + var d = arguments.length, s = new Array(d), b = 0; + b < d; + b++ + ) + s[b] = arguments[b]; + return !s.some(function (_) { + return !(_ && typeof _.getBoundingClientRect == "function"); + }); + } + function En(d) { + d === void 0 && (d = {}); + var s = d, + b = s.defaultModifiers, + _ = b === void 0 ? [] : b, + T = s.defaultOptions, + F = T === void 0 ? xn : T; + return function (H, G, oe) { + oe === void 0 && (oe = F); + var z = { + placement: "bottom", + orderedModifiers: [], + options: Object.assign({}, xn, F), + modifiersData: {}, + elements: { reference: H, popper: G }, + attributes: {}, + styles: {}, + }, + De = [], + Fe = !1, + Ce = { + state: z, + setOptions: function (Be) { + (Me(), + (z.options = Object.assign( + {}, + F, + z.options, + Be, + )), + (z.scrollParents = { + reference: i(H) + ? A(H) + : H.contextElement + ? A(H.contextElement) + : [], + popper: A(G), + })); + var Re = mt( + Ur([].concat(_, z.options.modifiers)), + ); + z.orderedModifiers = Re.filter(function ($e) { + return $e.enabled; + }); + var He = Wr( + [].concat(Re, z.options.modifiers), + function ($e) { + var Ue = $e.name; + return Ue; + }, + ); + if (($r(He), ot(z.options.placement) === me)) { + var ce = z.orderedModifiers.find( + function ($e) { + var Ue = $e.name; + return Ue === "flip"; + }, + ); + ce || + console.error( + [ + 'Popper: "auto" placements require the "flip" modifier be', + "present and enabled to work.", + ].join(" "), + ); + } + var Pe = O(G), + _e = Pe.marginTop, + ke = Pe.marginRight, + Le = Pe.marginBottom, + Ye = Pe.marginLeft; + return ( + [_e, ke, Le, Ye].some(function ($e) { + return parseFloat($e); + }) && + console.warn( + [ + 'Popper: CSS "margin" styles cannot be used to apply padding', + "between the popper and its reference element or boundary.", + "To replicate margin, use the `offset` modifier, as well as", + "the `padding` option in the `preventOverflow` and `flip`", + "modifiers.", + ].join(" "), + ), + xe(), + Ce.update() + ); + }, + forceUpdate: function () { + if (!Fe) { + var Be = z.elements, + Re = Be.reference, + He = Be.popper; + if (!fn(Re, He)) { + console.error(dr); + return; + } + ((z.rects = { + reference: x( + Re, + J(He), + z.options.strategy === "fixed", + ), + popper: M(He), + }), + (z.reset = !1), + (z.placement = z.options.placement), + z.orderedModifiers.forEach( + function (Ue) { + return (z.modifiersData[ + Ue.name + ] = Object.assign({}, Ue.data)); + }, + )); + for ( + var ce = 0, Pe = 0; + Pe < z.orderedModifiers.length; + Pe++ + ) { + if (((ce += 1), ce > 100)) { + console.error(Vr); + break; + } + if (z.reset === !0) { + ((z.reset = !1), (Pe = -1)); + continue; + } + var _e = z.orderedModifiers[Pe], + ke = _e.fn, + Le = _e.options, + Ye = Le === void 0 ? {} : Le, + $e = _e.name; + typeof ke == "function" && + (z = + ke({ + state: z, + options: Ye, + name: $e, + instance: Ce, + }) || z); + } + } + }, + update: zt(function () { + return new Promise(function (Se) { + (Ce.forceUpdate(), Se(z)); + }); + }), + destroy: function () { + (Me(), (Fe = !0)); + }, + }; + if (!fn(H, G)) return (console.error(dr), Ce); + Ce.setOptions(oe).then(function (Se) { + !Fe && oe.onFirstUpdate && oe.onFirstUpdate(Se); + }); + function xe() { + z.orderedModifiers.forEach(function (Se) { + var Be = Se.name, + Re = Se.options, + He = Re === void 0 ? {} : Re, + ce = Se.effect; + if (typeof ce == "function") { + var Pe = ce({ + state: z, + name: Be, + instance: Ce, + options: He, + }), + _e = function () {}; + De.push(Pe || _e); + } + }); + } + function Me() { + (De.forEach(function (Se) { + return Se(); + }), + (De = [])); + } + return Ce; + }; + } + var On = { passive: !0 }; + function zr(d) { + var s = d.state, + b = d.instance, + _ = d.options, + T = _.scroll, + F = T === void 0 ? !0 : T, + U = _.resize, + H = U === void 0 ? !0 : U, + G = r(s.elements.popper), + oe = [].concat( + s.scrollParents.reference, + s.scrollParents.popper, + ); + return ( + F && + oe.forEach(function (z) { + z.addEventListener("scroll", b.update, On); + }), + H && G.addEventListener("resize", b.update, On), + function () { + (F && + oe.forEach(function (z) { + z.removeEventListener("scroll", b.update, On); + }), + H && G.removeEventListener("resize", b.update, On)); + } + ); + } + var jn = { + name: "eventListeners", + enabled: !0, + phase: "write", + fn: function () {}, + effect: zr, + data: {}, + }; + function Yr(d) { + var s = d.state, + b = d.name; + s.modifiersData[b] = lr({ + reference: s.rects.reference, + element: s.rects.popper, + strategy: "absolute", + placement: s.placement, + }); + } + var Bn = { + name: "popperOffsets", + enabled: !0, + phase: "read", + fn: Yr, + data: {}, + }, + Xr = { + top: "auto", + right: "auto", + bottom: "auto", + left: "auto", + }; + function qr(d) { + var s = d.x, + b = d.y, + _ = window, + T = _.devicePixelRatio || 1; + return { x: Yt(Yt(s * T) / T) || 0, y: Yt(Yt(b * T) / T) || 0 }; + } + function Hn(d) { + var s, + b = d.popper, + _ = d.popperRect, + T = d.placement, + F = d.offsets, + U = d.position, + H = d.gpuAcceleration, + G = d.adaptive, + oe = d.roundOffsets, + z = oe === !0 ? qr(F) : typeof oe == "function" ? oe(F) : F, + De = z.x, + Fe = De === void 0 ? 0 : De, + Ce = z.y, + xe = Ce === void 0 ? 0 : Ce, + Me = F.hasOwnProperty("x"), + Se = F.hasOwnProperty("y"), + Be = Q, + Re = V, + He = window; + if (G) { + var ce = J(b), + Pe = "clientHeight", + _e = "clientWidth"; + (ce === r(b) && + ((ce = y(b)), + O(ce).position !== "static" && + ((Pe = "scrollHeight"), (_e = "scrollWidth"))), + (ce = ce), + T === V && + ((Re = de), + (xe -= ce[Pe] - _.height), + (xe *= H ? 1 : -1)), + T === Q && + ((Be = X), + (Fe -= ce[_e] - _.width), + (Fe *= H ? 1 : -1))); + } + var ke = Object.assign({ position: U }, G && Xr); + if (H) { + var Le; + return Object.assign( + {}, + ke, + ((Le = {}), + (Le[Re] = Se ? "0" : ""), + (Le[Be] = Me ? "0" : ""), + (Le.transform = + (He.devicePixelRatio || 1) < 2 + ? "translate(" + Fe + "px, " + xe + "px)" + : "translate3d(" + Fe + "px, " + xe + "px, 0)"), + Le), + ); + } + return Object.assign( + {}, + ke, + ((s = {}), + (s[Re] = Se ? xe + "px" : ""), + (s[Be] = Me ? Fe + "px" : ""), + (s.transform = ""), + s), + ); + } + function g(d) { + var s = d.state, + b = d.options, + _ = b.gpuAcceleration, + T = _ === void 0 ? !0 : _, + F = b.adaptive, + U = F === void 0 ? !0 : F, + H = b.roundOffsets, + G = H === void 0 ? !0 : H, + oe = O(s.elements.popper).transitionProperty || ""; + U && + ["transform", "top", "right", "bottom", "left"].some( + function (De) { + return oe.indexOf(De) >= 0; + }, + ) && + console.warn( + [ + "Popper: Detected CSS transitions on at least one of the following", + 'CSS properties: "transform", "top", "right", "bottom", "left".', + ` -`,'Disable the "computeStyles" modifier\'s `adaptive` option to allow',"for smooth transitions, or remove these properties from the CSS","transition declaration on the popper element if only transitioning","opacity or background-color for example.",` +`, + 'Disable the "computeStyles" modifier\'s `adaptive` option to allow', + "for smooth transitions, or remove these properties from the CSS", + "transition declaration on the popper element if only transitioning", + "opacity or background-color for example.", + ` -`,"We recommend using the popper element as a wrapper around an inner","element that can have any CSS property transitioned for animations."].join(" "));var z={placement:ot(s.placement),popper:s.elements.popper,popperRect:s.rects.popper,gpuAcceleration:T};s.modifiersData.popperOffsets!=null&&(s.styles.popper=Object.assign({},s.styles.popper,Hn(Object.assign({},z,{offsets:s.modifiersData.popperOffsets,position:s.options.strategy,adaptive:U,roundOffsets:G})))),s.modifiersData.arrow!=null&&(s.styles.arrow=Object.assign({},s.styles.arrow,Hn(Object.assign({},z,{offsets:s.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:G})))),s.attributes.popper=Object.assign({},s.attributes.popper,{"data-popper-placement":s.placement})}var w={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:g,data:{}};function C(d){var s=d.state;Object.keys(s.elements).forEach(function(b){var _=s.styles[b]||{},T=s.attributes[b]||{},F=s.elements[b];!o(F)||!u(F)||(Object.assign(F.style,_),Object.keys(T).forEach(function(U){var H=T[U];H===!1?F.removeAttribute(U):F.setAttribute(U,H===!0?"":H)}))})}function L(d){var s=d.state,b={popper:{position:s.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(s.elements.popper.style,b.popper),s.styles=b,s.elements.arrow&&Object.assign(s.elements.arrow.style,b.arrow),function(){Object.keys(s.elements).forEach(function(_){var T=s.elements[_],F=s.attributes[_]||{},U=Object.keys(s.styles.hasOwnProperty(_)?s.styles[_]:b[_]),H=U.reduce(function(G,oe){return G[oe]="",G},{});!o(T)||!u(T)||(Object.assign(T.style,H),Object.keys(F).forEach(function(G){T.removeAttribute(G)}))})}}var q={name:"applyStyles",enabled:!0,phase:"write",fn:C,effect:L,requires:["computeStyles"]};function W(d,s,b){var _=ot(d),T=[Q,V].indexOf(_)>=0?-1:1,F=typeof b=="function"?b(Object.assign({},s,{placement:d})):b,U=F[0],H=F[1];return U=U||0,H=(H||0)*T,[Q,X].indexOf(_)>=0?{x:H,y:U}:{x:U,y:H}}function B(d){var s=d.state,b=d.options,_=d.name,T=b.offset,F=T===void 0?[0,0]:T,U=ze.reduce(function(z,De){return z[De]=W(De,s.rects,F),z},{}),H=U[s.placement],G=H.x,oe=H.y;s.modifiersData.popperOffsets!=null&&(s.modifiersData.popperOffsets.x+=G,s.modifiersData.popperOffsets.y+=oe),s.modifiersData[_]=U}var be={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:B},le={left:"right",right:"left",bottom:"top",top:"bottom"};function pe(d){return d.replace(/left|right|bottom|top/g,function(s){return le[s]})}var ye={start:"end",end:"start"};function Te(d){return d.replace(/start|end/g,function(s){return ye[s]})}function je(d,s){s===void 0&&(s={});var b=s,_=b.placement,T=b.boundary,F=b.rootBoundary,U=b.padding,H=b.flipVariations,G=b.allowedAutoPlacements,oe=G===void 0?ze:G,z=cn(_),De=z?H?Z:Z.filter(function(xe){return cn(xe)===z}):l,Fe=De.filter(function(xe){return oe.indexOf(xe)>=0});Fe.length===0&&(Fe=De,console.error(["Popper: The `allowedAutoPlacements` option did not allow any","placements. Ensure the `placement` option matches the variation","of the allowed placements.",'For example, "auto" cannot be used to allow "bottom-start".','Use "auto-start" instead.'].join(" ")));var Ce=Fe.reduce(function(xe,Me){return xe[Me]=qt(d,{placement:Me,boundary:T,rootBoundary:F,padding:U})[ot(Me)],xe},{});return Object.keys(Ce).sort(function(xe,Me){return Ce[xe]-Ce[Me]})}function Ae(d){if(ot(d)===me)return[];var s=pe(d);return[Te(d),s,Te(s)]}function Ie(d){var s=d.state,b=d.options,_=d.name;if(!s.modifiersData[_]._skip){for(var T=b.mainAxis,F=T===void 0?!0:T,U=b.altAxis,H=U===void 0?!0:U,G=b.fallbackPlacements,oe=b.padding,z=b.boundary,De=b.rootBoundary,Fe=b.altBoundary,Ce=b.flipVariations,xe=Ce===void 0?!0:Ce,Me=b.allowedAutoPlacements,Se=s.options.placement,Be=ot(Se),Re=Be===Se,He=G||(Re||!xe?[pe(Se)]:Ae(Se)),ce=[Se].concat(He).reduce(function(te,ge){return te.concat(ot(ge)===me?je(s,{placement:ge,boundary:z,rootBoundary:De,padding:oe,flipVariations:xe,allowedAutoPlacements:Me}):ge)},[]),Pe=s.rects.reference,_e=s.rects.popper,ke=new Map,Le=!0,Ye=ce[0],$e=0;$e=0,dn=Ft?"width":"height",Qt=qt(s,{placement:Ue,boundary:z,rootBoundary:De,altBoundary:Fe,padding:oe}),kt=Ft?et?X:Q:et?de:V;Pe[dn]>_e[dn]&&(kt=pe(kt));var $n=pe(kt),Zt=[];if(F&&Zt.push(Qt[wt]<=0),H&&Zt.push(Qt[kt]<=0,Qt[$n]<=0),Zt.every(function(te){return te})){Ye=Ue,Le=!1;break}ke.set(Ue,Zt)}if(Le)for(var Sn=xe?3:1,Wn=function(ge){var we=ce.find(function(Ke){var Je=ke.get(Ke);if(Je)return Je.slice(0,ge).every(function(Dt){return Dt})});if(we)return Ye=we,"break"},D=Sn;D>0;D--){var K=Wn(D);if(K==="break")break}s.placement!==Ye&&(s.modifiersData[_]._skip=!0,s.placement=Ye,s.reset=!0)}}var re={name:"flip",enabled:!0,phase:"main",fn:Ie,requiresIfExists:["offset"],data:{_skip:!1}};function he(d){return d==="x"?"y":"x"}function ve(d,s,b){return gt(d,ln(s,b))}function ee(d){var s=d.state,b=d.options,_=d.name,T=b.mainAxis,F=T===void 0?!0:T,U=b.altAxis,H=U===void 0?!1:U,G=b.boundary,oe=b.rootBoundary,z=b.altBoundary,De=b.padding,Fe=b.tether,Ce=Fe===void 0?!0:Fe,xe=b.tetherOffset,Me=xe===void 0?0:xe,Se=qt(s,{boundary:G,rootBoundary:oe,padding:De,altBoundary:z}),Be=ot(s.placement),Re=cn(s.placement),He=!Re,ce=dt(Be),Pe=he(ce),_e=s.modifiersData.popperOffsets,ke=s.rects.reference,Le=s.rects.popper,Ye=typeof Me=="function"?Me(Object.assign({},s.rects,{placement:s.placement})):Me,$e={x:0,y:0};if(_e){if(F||H){var Ue=ce==="y"?V:Q,wt=ce==="y"?de:X,et=ce==="y"?"height":"width",Ft=_e[ce],dn=_e[ce]+Se[Ue],Qt=_e[ce]-Se[wt],kt=Ce?-Le[et]/2:0,$n=Re===h?ke[et]:Le[et],Zt=Re===h?-Le[et]:-ke[et],Sn=s.elements.arrow,Wn=Ce&&Sn?M(Sn):{width:0,height:0},D=s.modifiersData["arrow#persistent"]?s.modifiersData["arrow#persistent"].padding:cr(),K=D[Ue],te=D[wt],ge=ve(0,ke[et],Wn[et]),we=He?ke[et]/2-kt-ge-K-Ye:$n-ge-K-Ye,Ke=He?-ke[et]/2+kt+ge+te+Ye:Zt+ge+te+Ye,Je=s.elements.arrow&&J(s.elements.arrow),Dt=Je?ce==="y"?Je.clientTop||0:Je.clientLeft||0:0,Un=s.modifiersData.offset?s.modifiersData.offset[s.placement][ce]:0,_t=_e[ce]+we-Un-Dt,An=_e[ce]+Ke-Un;if(F){var pn=ve(Ce?ln(dn,_t):dn,Ft,Ce?gt(Qt,An):Qt);_e[ce]=pn,$e[ce]=pn-Ft}if(H){var en=ce==="x"?V:Q,Gr=ce==="x"?de:X,tn=_e[Pe],hn=tn+Se[en],Di=tn-Se[Gr],_i=ve(Ce?ln(hn,_t):hn,tn,Ce?gt(Di,An):Di);_e[Pe]=_i,$e[Pe]=_i-tn}}s.modifiersData[_]=$e}}var ie={name:"preventOverflow",enabled:!0,phase:"main",fn:ee,requiresIfExists:["offset"]},E=function(s,b){return s=typeof s=="function"?s(Object.assign({},b.rects,{placement:b.placement})):s,fr(typeof s!="number"?s:ur(s,l))};function Ge(d){var s,b=d.state,_=d.name,T=d.options,F=b.elements.arrow,U=b.modifiersData.popperOffsets,H=ot(b.placement),G=dt(H),oe=[Q,X].indexOf(H)>=0,z=oe?"height":"width";if(!(!F||!U)){var De=E(T.padding,b),Fe=M(F),Ce=G==="y"?V:Q,xe=G==="y"?de:X,Me=b.rects.reference[z]+b.rects.reference[G]-U[G]-b.rects.popper[z],Se=U[G]-b.rects.reference[G],Be=J(F),Re=Be?G==="y"?Be.clientHeight||0:Be.clientWidth||0:0,He=Me/2-Se/2,ce=De[Ce],Pe=Re-Fe[z]-De[xe],_e=Re/2-Fe[z]/2+He,ke=ve(ce,_e,Pe),Le=G;b.modifiersData[_]=(s={},s[Le]=ke,s.centerOffset=ke-_e,s)}}function fe(d){var s=d.state,b=d.options,_=b.element,T=_===void 0?"[data-popper-arrow]":_;if(T!=null&&!(typeof T=="string"&&(T=s.elements.popper.querySelector(T),!T))){if(o(T)||console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).',"To use an SVG arrow, wrap it in an HTMLElement that will be used as","the arrow."].join(" ")),!Nn(s.elements.popper,T)){console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper',"element."].join(" "));return}s.elements.arrow=T}}var Lt={name:"arrow",enabled:!0,phase:"main",fn:Ge,effect:fe,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function bt(d,s,b){return b===void 0&&(b={x:0,y:0}),{top:d.top-s.height-b.y,right:d.right-s.width+b.x,bottom:d.bottom-s.height+b.y,left:d.left-s.width-b.x}}function Gt(d){return[V,X,de,Q].some(function(s){return d[s]>=0})}function Kt(d){var s=d.state,b=d.name,_=s.rects.reference,T=s.rects.popper,F=s.modifiersData.preventOverflow,U=qt(s,{elementContext:"reference"}),H=qt(s,{altBoundary:!0}),G=bt(U,_),oe=bt(H,T,F),z=Gt(G),De=Gt(oe);s.modifiersData[b]={referenceClippingOffsets:G,popperEscapeOffsets:oe,isReferenceHidden:z,hasPopperEscaped:De},s.attributes.popper=Object.assign({},s.attributes.popper,{"data-popper-reference-hidden":z,"data-popper-escaped":De})}var Jt={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Kt},rt=[jn,Bn,w,q],lt=En({defaultModifiers:rt}),yt=[jn,Bn,w,q,be,re,ie,Lt,Jt],un=En({defaultModifiers:yt});e.applyStyles=q,e.arrow=Lt,e.computeStyles=w,e.createPopper=un,e.createPopperLite=lt,e.defaultModifiers=yt,e.detectOverflow=qt,e.eventListeners=jn,e.flip=re,e.hide=Jt,e.offset=be,e.popperGenerator=En,e.popperOffsets=Bn,e.preventOverflow=ie}),$o=Bo(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t=_s(),r='',n="tippy-box",i="tippy-content",o="tippy-backdrop",a="tippy-arrow",c="tippy-svg-arrow",f={passive:!0,capture:!0};function u(g,w){return{}.hasOwnProperty.call(g,w)}function y(g,w,C){if(Array.isArray(g)){var L=g[w];return L??(Array.isArray(C)?C[w]:C)}return g}function m(g,w){var C={}.toString.call(g);return C.indexOf("[object")===0&&C.indexOf(w+"]")>-1}function O(g,w){return typeof g=="function"?g.apply(void 0,w):g}function S(g,w){if(w===0)return g;var C;return function(L){clearTimeout(C),C=setTimeout(function(){g(L)},w)}}function x(g,w){var C=Object.assign({},g);return w.forEach(function(L){delete C[L]}),C}function M(g){return g.split(/\s+/).filter(Boolean)}function I(g){return[].concat(g)}function $(g,w){g.indexOf(w)===-1&&g.push(w)}function A(g){return g.filter(function(w,C){return g.indexOf(w)===C})}function N(g){return g.split("-")[0]}function Y(g){return[].slice.call(g)}function ne(g){return Object.keys(g).reduce(function(w,C){return g[C]!==void 0&&(w[C]=g[C]),w},{})}function J(){return document.createElement("div")}function V(g){return["Element","Fragment"].some(function(w){return m(g,w)})}function de(g){return m(g,"NodeList")}function X(g){return m(g,"MouseEvent")}function Q(g){return!!(g&&g._tippy&&g._tippy.reference===g)}function me(g){return V(g)?[g]:de(g)?Y(g):Array.isArray(g)?g:Y(document.querySelectorAll(g))}function l(g,w){g.forEach(function(C){C&&(C.style.transitionDuration=w+"ms")})}function h(g,w){g.forEach(function(C){C&&C.setAttribute("data-state",w)})}function v(g){var w,C=I(g),L=C[0];return!(L==null||(w=L.ownerDocument)==null)&&w.body?L.ownerDocument:document}function p(g,w){var C=w.clientX,L=w.clientY;return g.every(function(q){var W=q.popperRect,B=q.popperState,be=q.props,le=be.interactiveBorder,pe=N(B.placement),ye=B.modifiersData.offset;if(!ye)return!0;var Te=pe==="bottom"?ye.top.y:0,je=pe==="top"?ye.bottom.y:0,Ae=pe==="right"?ye.left.x:0,Ie=pe==="left"?ye.right.x:0,re=W.top-L+Te>le,he=L-W.bottom-je>le,ve=W.left-C+Ae>le,ee=C-W.right-Ie>le;return re||he||ve||ee})}function j(g,w,C){var L=w+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(q){g[L](q,C)})}var P={isTouch:!1},R=0;function Z(){P.isTouch||(P.isTouch=!0,window.performance&&document.addEventListener("mousemove",ze))}function ze(){var g=performance.now();g-R<20&&(P.isTouch=!1,document.removeEventListener("mousemove",ze)),R=g}function Rt(){var g=document.activeElement;if(Q(g)){var w=g._tippy;g.blur&&!w.state.isVisible&&g.blur()}}function Ut(){document.addEventListener("touchstart",Z,f),window.addEventListener("blur",Rt)}var Fr=typeof window<"u"&&typeof document<"u",kr=Fr?navigator.userAgent:"",Nr=/MSIE |Trident\//.test(kr);function Vt(g){var w=g==="destroy"?"n already-":" ";return[g+"() was called on a"+w+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function nr(g){var w=/[ \t]{2,}/g,C=/^[ \t]*/gm;return g.replace(w," ").replace(C,"").trim()}function jr(g){return nr(` +`, + "We recommend using the popper element as a wrapper around an inner", + "element that can have any CSS property transitioned for animations.", + ].join(" "), + ); + var z = { + placement: ot(s.placement), + popper: s.elements.popper, + popperRect: s.rects.popper, + gpuAcceleration: T, + }; + (s.modifiersData.popperOffsets != null && + (s.styles.popper = Object.assign( + {}, + s.styles.popper, + Hn( + Object.assign({}, z, { + offsets: s.modifiersData.popperOffsets, + position: s.options.strategy, + adaptive: U, + roundOffsets: G, + }), + ), + )), + s.modifiersData.arrow != null && + (s.styles.arrow = Object.assign( + {}, + s.styles.arrow, + Hn( + Object.assign({}, z, { + offsets: s.modifiersData.arrow, + position: "absolute", + adaptive: !1, + roundOffsets: G, + }), + ), + )), + (s.attributes.popper = Object.assign( + {}, + s.attributes.popper, + { "data-popper-placement": s.placement }, + ))); + } + var w = { + name: "computeStyles", + enabled: !0, + phase: "beforeWrite", + fn: g, + data: {}, + }; + function C(d) { + var s = d.state; + Object.keys(s.elements).forEach(function (b) { + var _ = s.styles[b] || {}, + T = s.attributes[b] || {}, + F = s.elements[b]; + !o(F) || + !u(F) || + (Object.assign(F.style, _), + Object.keys(T).forEach(function (U) { + var H = T[U]; + H === !1 + ? F.removeAttribute(U) + : F.setAttribute(U, H === !0 ? "" : H); + })); + }); + } + function L(d) { + var s = d.state, + b = { + popper: { + position: s.options.strategy, + left: "0", + top: "0", + margin: "0", + }, + arrow: { position: "absolute" }, + reference: {}, + }; + return ( + Object.assign(s.elements.popper.style, b.popper), + (s.styles = b), + s.elements.arrow && + Object.assign(s.elements.arrow.style, b.arrow), + function () { + Object.keys(s.elements).forEach(function (_) { + var T = s.elements[_], + F = s.attributes[_] || {}, + U = Object.keys( + s.styles.hasOwnProperty(_) + ? s.styles[_] + : b[_], + ), + H = U.reduce(function (G, oe) { + return ((G[oe] = ""), G); + }, {}); + !o(T) || + !u(T) || + (Object.assign(T.style, H), + Object.keys(F).forEach(function (G) { + T.removeAttribute(G); + })); + }); + } + ); + } + var q = { + name: "applyStyles", + enabled: !0, + phase: "write", + fn: C, + effect: L, + requires: ["computeStyles"], + }; + function W(d, s, b) { + var _ = ot(d), + T = [Q, V].indexOf(_) >= 0 ? -1 : 1, + F = + typeof b == "function" + ? b(Object.assign({}, s, { placement: d })) + : b, + U = F[0], + H = F[1]; + return ( + (U = U || 0), + (H = (H || 0) * T), + [Q, X].indexOf(_) >= 0 ? { x: H, y: U } : { x: U, y: H } + ); + } + function B(d) { + var s = d.state, + b = d.options, + _ = d.name, + T = b.offset, + F = T === void 0 ? [0, 0] : T, + U = ze.reduce(function (z, De) { + return ((z[De] = W(De, s.rects, F)), z); + }, {}), + H = U[s.placement], + G = H.x, + oe = H.y; + (s.modifiersData.popperOffsets != null && + ((s.modifiersData.popperOffsets.x += G), + (s.modifiersData.popperOffsets.y += oe)), + (s.modifiersData[_] = U)); + } + var be = { + name: "offset", + enabled: !0, + phase: "main", + requires: ["popperOffsets"], + fn: B, + }, + le = { + left: "right", + right: "left", + bottom: "top", + top: "bottom", + }; + function pe(d) { + return d.replace(/left|right|bottom|top/g, function (s) { + return le[s]; + }); + } + var ye = { start: "end", end: "start" }; + function Te(d) { + return d.replace(/start|end/g, function (s) { + return ye[s]; + }); + } + function je(d, s) { + s === void 0 && (s = {}); + var b = s, + _ = b.placement, + T = b.boundary, + F = b.rootBoundary, + U = b.padding, + H = b.flipVariations, + G = b.allowedAutoPlacements, + oe = G === void 0 ? ze : G, + z = cn(_), + De = z + ? H + ? Z + : Z.filter(function (xe) { + return cn(xe) === z; + }) + : l, + Fe = De.filter(function (xe) { + return oe.indexOf(xe) >= 0; + }); + Fe.length === 0 && + ((Fe = De), + console.error( + [ + "Popper: The `allowedAutoPlacements` option did not allow any", + "placements. Ensure the `placement` option matches the variation", + "of the allowed placements.", + 'For example, "auto" cannot be used to allow "bottom-start".', + 'Use "auto-start" instead.', + ].join(" "), + )); + var Ce = Fe.reduce(function (xe, Me) { + return ( + (xe[Me] = qt(d, { + placement: Me, + boundary: T, + rootBoundary: F, + padding: U, + })[ot(Me)]), + xe + ); + }, {}); + return Object.keys(Ce).sort(function (xe, Me) { + return Ce[xe] - Ce[Me]; + }); + } + function Ae(d) { + if (ot(d) === me) return []; + var s = pe(d); + return [Te(d), s, Te(s)]; + } + function Ie(d) { + var s = d.state, + b = d.options, + _ = d.name; + if (!s.modifiersData[_]._skip) { + for ( + var T = b.mainAxis, + F = T === void 0 ? !0 : T, + U = b.altAxis, + H = U === void 0 ? !0 : U, + G = b.fallbackPlacements, + oe = b.padding, + z = b.boundary, + De = b.rootBoundary, + Fe = b.altBoundary, + Ce = b.flipVariations, + xe = Ce === void 0 ? !0 : Ce, + Me = b.allowedAutoPlacements, + Se = s.options.placement, + Be = ot(Se), + Re = Be === Se, + He = G || (Re || !xe ? [pe(Se)] : Ae(Se)), + ce = [Se].concat(He).reduce(function (te, ge) { + return te.concat( + ot(ge) === me + ? je(s, { + placement: ge, + boundary: z, + rootBoundary: De, + padding: oe, + flipVariations: xe, + allowedAutoPlacements: Me, + }) + : ge, + ); + }, []), + Pe = s.rects.reference, + _e = s.rects.popper, + ke = new Map(), + Le = !0, + Ye = ce[0], + $e = 0; + $e < ce.length; + $e++ + ) { + var Ue = ce[$e], + wt = ot(Ue), + et = cn(Ue) === h, + Ft = [V, de].indexOf(wt) >= 0, + dn = Ft ? "width" : "height", + Qt = qt(s, { + placement: Ue, + boundary: z, + rootBoundary: De, + altBoundary: Fe, + padding: oe, + }), + kt = Ft ? (et ? X : Q) : et ? de : V; + Pe[dn] > _e[dn] && (kt = pe(kt)); + var $n = pe(kt), + Zt = []; + if ( + (F && Zt.push(Qt[wt] <= 0), + H && Zt.push(Qt[kt] <= 0, Qt[$n] <= 0), + Zt.every(function (te) { + return te; + })) + ) { + ((Ye = Ue), (Le = !1)); + break; + } + ke.set(Ue, Zt); + } + if (Le) + for ( + var Sn = xe ? 3 : 1, + Wn = function (ge) { + var we = ce.find(function (Ke) { + var Je = ke.get(Ke); + if (Je) + return Je.slice(0, ge).every( + function (Dt) { + return Dt; + }, + ); + }); + if (we) return ((Ye = we), "break"); + }, + D = Sn; + D > 0; + D-- + ) { + var K = Wn(D); + if (K === "break") break; + } + s.placement !== Ye && + ((s.modifiersData[_]._skip = !0), + (s.placement = Ye), + (s.reset = !0)); + } + } + var re = { + name: "flip", + enabled: !0, + phase: "main", + fn: Ie, + requiresIfExists: ["offset"], + data: { _skip: !1 }, + }; + function he(d) { + return d === "x" ? "y" : "x"; + } + function ve(d, s, b) { + return gt(d, ln(s, b)); + } + function ee(d) { + var s = d.state, + b = d.options, + _ = d.name, + T = b.mainAxis, + F = T === void 0 ? !0 : T, + U = b.altAxis, + H = U === void 0 ? !1 : U, + G = b.boundary, + oe = b.rootBoundary, + z = b.altBoundary, + De = b.padding, + Fe = b.tether, + Ce = Fe === void 0 ? !0 : Fe, + xe = b.tetherOffset, + Me = xe === void 0 ? 0 : xe, + Se = qt(s, { + boundary: G, + rootBoundary: oe, + padding: De, + altBoundary: z, + }), + Be = ot(s.placement), + Re = cn(s.placement), + He = !Re, + ce = dt(Be), + Pe = he(ce), + _e = s.modifiersData.popperOffsets, + ke = s.rects.reference, + Le = s.rects.popper, + Ye = + typeof Me == "function" + ? Me( + Object.assign({}, s.rects, { + placement: s.placement, + }), + ) + : Me, + $e = { x: 0, y: 0 }; + if (_e) { + if (F || H) { + var Ue = ce === "y" ? V : Q, + wt = ce === "y" ? de : X, + et = ce === "y" ? "height" : "width", + Ft = _e[ce], + dn = _e[ce] + Se[Ue], + Qt = _e[ce] - Se[wt], + kt = Ce ? -Le[et] / 2 : 0, + $n = Re === h ? ke[et] : Le[et], + Zt = Re === h ? -Le[et] : -ke[et], + Sn = s.elements.arrow, + Wn = Ce && Sn ? M(Sn) : { width: 0, height: 0 }, + D = s.modifiersData["arrow#persistent"] + ? s.modifiersData["arrow#persistent"].padding + : cr(), + K = D[Ue], + te = D[wt], + ge = ve(0, ke[et], Wn[et]), + we = He + ? ke[et] / 2 - kt - ge - K - Ye + : $n - ge - K - Ye, + Ke = He + ? -ke[et] / 2 + kt + ge + te + Ye + : Zt + ge + te + Ye, + Je = s.elements.arrow && J(s.elements.arrow), + Dt = Je + ? ce === "y" + ? Je.clientTop || 0 + : Je.clientLeft || 0 + : 0, + Un = s.modifiersData.offset + ? s.modifiersData.offset[s.placement][ce] + : 0, + _t = _e[ce] + we - Un - Dt, + An = _e[ce] + Ke - Un; + if (F) { + var pn = ve( + Ce ? ln(dn, _t) : dn, + Ft, + Ce ? gt(Qt, An) : Qt, + ); + ((_e[ce] = pn), ($e[ce] = pn - Ft)); + } + if (H) { + var en = ce === "x" ? V : Q, + Gr = ce === "x" ? de : X, + tn = _e[Pe], + hn = tn + Se[en], + Di = tn - Se[Gr], + _i = ve( + Ce ? ln(hn, _t) : hn, + tn, + Ce ? gt(Di, An) : Di, + ); + ((_e[Pe] = _i), ($e[Pe] = _i - tn)); + } + } + s.modifiersData[_] = $e; + } + } + var ie = { + name: "preventOverflow", + enabled: !0, + phase: "main", + fn: ee, + requiresIfExists: ["offset"], + }, + E = function (s, b) { + return ( + (s = + typeof s == "function" + ? s( + Object.assign({}, b.rects, { + placement: b.placement, + }), + ) + : s), + fr(typeof s != "number" ? s : ur(s, l)) + ); + }; + function Ge(d) { + var s, + b = d.state, + _ = d.name, + T = d.options, + F = b.elements.arrow, + U = b.modifiersData.popperOffsets, + H = ot(b.placement), + G = dt(H), + oe = [Q, X].indexOf(H) >= 0, + z = oe ? "height" : "width"; + if (!(!F || !U)) { + var De = E(T.padding, b), + Fe = M(F), + Ce = G === "y" ? V : Q, + xe = G === "y" ? de : X, + Me = + b.rects.reference[z] + + b.rects.reference[G] - + U[G] - + b.rects.popper[z], + Se = U[G] - b.rects.reference[G], + Be = J(F), + Re = Be + ? G === "y" + ? Be.clientHeight || 0 + : Be.clientWidth || 0 + : 0, + He = Me / 2 - Se / 2, + ce = De[Ce], + Pe = Re - Fe[z] - De[xe], + _e = Re / 2 - Fe[z] / 2 + He, + ke = ve(ce, _e, Pe), + Le = G; + b.modifiersData[_] = + ((s = {}), (s[Le] = ke), (s.centerOffset = ke - _e), s); + } + } + function fe(d) { + var s = d.state, + b = d.options, + _ = b.element, + T = _ === void 0 ? "[data-popper-arrow]" : _; + if ( + T != null && + !( + typeof T == "string" && + ((T = s.elements.popper.querySelector(T)), !T) + ) + ) { + if ( + (o(T) || + console.error( + [ + 'Popper: "arrow" element must be an HTMLElement (not an SVGElement).', + "To use an SVG arrow, wrap it in an HTMLElement that will be used as", + "the arrow.", + ].join(" "), + ), + !Nn(s.elements.popper, T)) + ) { + console.error( + [ + 'Popper: "arrow" modifier\'s `element` must be a child of the popper', + "element.", + ].join(" "), + ); + return; + } + s.elements.arrow = T; + } + } + var Lt = { + name: "arrow", + enabled: !0, + phase: "main", + fn: Ge, + effect: fe, + requires: ["popperOffsets"], + requiresIfExists: ["preventOverflow"], + }; + function bt(d, s, b) { + return ( + b === void 0 && (b = { x: 0, y: 0 }), + { + top: d.top - s.height - b.y, + right: d.right - s.width + b.x, + bottom: d.bottom - s.height + b.y, + left: d.left - s.width - b.x, + } + ); + } + function Gt(d) { + return [V, X, de, Q].some(function (s) { + return d[s] >= 0; + }); + } + function Kt(d) { + var s = d.state, + b = d.name, + _ = s.rects.reference, + T = s.rects.popper, + F = s.modifiersData.preventOverflow, + U = qt(s, { elementContext: "reference" }), + H = qt(s, { altBoundary: !0 }), + G = bt(U, _), + oe = bt(H, T, F), + z = Gt(G), + De = Gt(oe); + ((s.modifiersData[b] = { + referenceClippingOffsets: G, + popperEscapeOffsets: oe, + isReferenceHidden: z, + hasPopperEscaped: De, + }), + (s.attributes.popper = Object.assign( + {}, + s.attributes.popper, + { + "data-popper-reference-hidden": z, + "data-popper-escaped": De, + }, + ))); + } + var Jt = { + name: "hide", + enabled: !0, + phase: "main", + requiresIfExists: ["preventOverflow"], + fn: Kt, + }, + rt = [jn, Bn, w, q], + lt = En({ defaultModifiers: rt }), + yt = [jn, Bn, w, q, be, re, ie, Lt, Jt], + un = En({ defaultModifiers: yt }); + ((e.applyStyles = q), + (e.arrow = Lt), + (e.computeStyles = w), + (e.createPopper = un), + (e.createPopperLite = lt), + (e.defaultModifiers = yt), + (e.detectOverflow = qt), + (e.eventListeners = jn), + (e.flip = re), + (e.hide = Jt), + (e.offset = be), + (e.popperGenerator = En), + (e.popperOffsets = Bn), + (e.preventOverflow = ie)); + }), + $o = Bo((e) => { + "use strict"; + Object.defineProperty(e, "__esModule", { value: !0 }); + var t = _s(), + r = + '', + n = "tippy-box", + i = "tippy-content", + o = "tippy-backdrop", + a = "tippy-arrow", + c = "tippy-svg-arrow", + f = { passive: !0, capture: !0 }; + function u(g, w) { + return {}.hasOwnProperty.call(g, w); + } + function y(g, w, C) { + if (Array.isArray(g)) { + var L = g[w]; + return L ?? (Array.isArray(C) ? C[w] : C); + } + return g; + } + function m(g, w) { + var C = {}.toString.call(g); + return C.indexOf("[object") === 0 && C.indexOf(w + "]") > -1; + } + function O(g, w) { + return typeof g == "function" ? g.apply(void 0, w) : g; + } + function S(g, w) { + if (w === 0) return g; + var C; + return function (L) { + (clearTimeout(C), + (C = setTimeout(function () { + g(L); + }, w))); + }; + } + function x(g, w) { + var C = Object.assign({}, g); + return ( + w.forEach(function (L) { + delete C[L]; + }), + C + ); + } + function M(g) { + return g.split(/\s+/).filter(Boolean); + } + function I(g) { + return [].concat(g); + } + function $(g, w) { + g.indexOf(w) === -1 && g.push(w); + } + function A(g) { + return g.filter(function (w, C) { + return g.indexOf(w) === C; + }); + } + function N(g) { + return g.split("-")[0]; + } + function Y(g) { + return [].slice.call(g); + } + function ne(g) { + return Object.keys(g).reduce(function (w, C) { + return (g[C] !== void 0 && (w[C] = g[C]), w); + }, {}); + } + function J() { + return document.createElement("div"); + } + function V(g) { + return ["Element", "Fragment"].some(function (w) { + return m(g, w); + }); + } + function de(g) { + return m(g, "NodeList"); + } + function X(g) { + return m(g, "MouseEvent"); + } + function Q(g) { + return !!(g && g._tippy && g._tippy.reference === g); + } + function me(g) { + return V(g) + ? [g] + : de(g) + ? Y(g) + : Array.isArray(g) + ? g + : Y(document.querySelectorAll(g)); + } + function l(g, w) { + g.forEach(function (C) { + C && (C.style.transitionDuration = w + "ms"); + }); + } + function h(g, w) { + g.forEach(function (C) { + C && C.setAttribute("data-state", w); + }); + } + function v(g) { + var w, + C = I(g), + L = C[0]; + return !(L == null || (w = L.ownerDocument) == null) && w.body + ? L.ownerDocument + : document; + } + function p(g, w) { + var C = w.clientX, + L = w.clientY; + return g.every(function (q) { + var W = q.popperRect, + B = q.popperState, + be = q.props, + le = be.interactiveBorder, + pe = N(B.placement), + ye = B.modifiersData.offset; + if (!ye) return !0; + var Te = pe === "bottom" ? ye.top.y : 0, + je = pe === "top" ? ye.bottom.y : 0, + Ae = pe === "right" ? ye.left.x : 0, + Ie = pe === "left" ? ye.right.x : 0, + re = W.top - L + Te > le, + he = L - W.bottom - je > le, + ve = W.left - C + Ae > le, + ee = C - W.right - Ie > le; + return re || he || ve || ee; + }); + } + function j(g, w, C) { + var L = w + "EventListener"; + ["transitionend", "webkitTransitionEnd"].forEach(function (q) { + g[L](q, C); + }); + } + var P = { isTouch: !1 }, + R = 0; + function Z() { + P.isTouch || + ((P.isTouch = !0), + window.performance && + document.addEventListener("mousemove", ze)); + } + function ze() { + var g = performance.now(); + (g - R < 20 && + ((P.isTouch = !1), + document.removeEventListener("mousemove", ze)), + (R = g)); + } + function Rt() { + var g = document.activeElement; + if (Q(g)) { + var w = g._tippy; + g.blur && !w.state.isVisible && g.blur(); + } + } + function Ut() { + (document.addEventListener("touchstart", Z, f), + window.addEventListener("blur", Rt)); + } + var Fr = typeof window < "u" && typeof document < "u", + kr = Fr ? navigator.userAgent : "", + Nr = /MSIE |Trident\//.test(kr); + function Vt(g) { + var w = g === "destroy" ? "n already-" : " "; + return [ + g + + "() was called on a" + + w + + "destroyed instance. This is a no-op but", + "indicates a potential memory leak.", + ].join(" "); + } + function nr(g) { + var w = /[ \t]{2,}/g, + C = /^[ \t]*/gm; + return g.replace(w, " ").replace(C, "").trim(); + } + function jr(g) { + return nr( + ` %ctippy.js - %c`+nr(g)+` + %c` + + nr(g) + + ` %c\u{1F477}\u200D This is a development-only message. It will be removed in production. - `)}function rr(g){return[jr(g),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var It;Br();function Br(){It=new Set}function mt(g,w){if(g&&!It.has(w)){var C;It.add(w),(C=console).warn.apply(C,rr(w))}}function zt(g,w){if(g&&!It.has(w)){var C;It.add(w),(C=console).error.apply(C,rr(w))}}function At(g){var w=!g,C=Object.prototype.toString.call(g)==="[object Object]"&&!g.addEventListener;zt(w,["tippy() was passed","`"+String(g)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),zt(C,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var Ct={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Hr={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Ze=Object.assign({appendTo:function(){return document.body},aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Ct,{},Hr),$r=Object.keys(Ze),Wr=function(w){gt(w,[]);var C=Object.keys(w);C.forEach(function(L){Ze[L]=w[L]})};function ot(g){var w=g.plugins||[],C=w.reduce(function(L,q){var W=q.name,B=q.defaultValue;return W&&(L[W]=g[W]!==void 0?g[W]:B),L},{});return Object.assign({},g,{},C)}function Ur(g,w){var C=w?Object.keys(ot(Object.assign({},Ze,{plugins:w}))):$r,L=C.reduce(function(q,W){var B=(g.getAttribute("data-tippy-"+W)||"").trim();if(!B)return q;if(W==="content")q[W]=B;else try{q[W]=JSON.parse(B)}catch{q[W]=B}return q},{});return L}function ir(g,w){var C=Object.assign({},w,{content:O(w.content,[g])},w.ignoreAttributes?{}:Ur(g,w.plugins));return C.aria=Object.assign({},Ze.aria,{},C.aria),C.aria={expanded:C.aria.expanded==="auto"?w.interactive:C.aria.expanded,content:C.aria.content==="auto"?w.interactive?null:"describedby":C.aria.content},C}function gt(g,w){g===void 0&&(g={}),w===void 0&&(w=[]);var C=Object.keys(g);C.forEach(function(L){var q=x(Ze,Object.keys(Ct)),W=!u(q,L);W&&(W=w.filter(function(B){return B.name===L}).length===0),mt(W,["`"+L+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.",` + `, + ); + } + function rr(g) { + return [ + jr(g), + "color: #00C584; font-size: 1.3em; font-weight: bold;", + "line-height: 1.5", + "color: #a6a095;", + ]; + } + var It; + Br(); + function Br() { + It = new Set(); + } + function mt(g, w) { + if (g && !It.has(w)) { + var C; + (It.add(w), (C = console).warn.apply(C, rr(w))); + } + } + function zt(g, w) { + if (g && !It.has(w)) { + var C; + (It.add(w), (C = console).error.apply(C, rr(w))); + } + } + function At(g) { + var w = !g, + C = + Object.prototype.toString.call(g) === + "[object Object]" && !g.addEventListener; + (zt( + w, + [ + "tippy() was passed", + "`" + String(g) + "`", + "as its targets (first) argument. Valid types are: String, Element,", + "Element[], or NodeList.", + ].join(" "), + ), + zt( + C, + [ + "tippy() was passed a plain object which is not supported as an argument", + "for virtual positioning. Use props.getReferenceClientRect instead.", + ].join(" "), + )); + } + var Ct = { + animateFill: !1, + followCursor: !1, + inlinePositioning: !1, + sticky: !1, + }, + Hr = { + allowHTML: !1, + animation: "fade", + arrow: !0, + content: "", + inertia: !1, + maxWidth: 350, + role: "tooltip", + theme: "", + zIndex: 9999, + }, + Ze = Object.assign( + { + appendTo: function () { + return document.body; + }, + aria: { content: "auto", expanded: "auto" }, + delay: 0, + duration: [300, 250], + getReferenceClientRect: null, + hideOnClick: !0, + ignoreAttributes: !1, + interactive: !1, + interactiveBorder: 2, + interactiveDebounce: 0, + moveTransition: "", + offset: [0, 10], + onAfterUpdate: function () {}, + onBeforeUpdate: function () {}, + onCreate: function () {}, + onDestroy: function () {}, + onHidden: function () {}, + onHide: function () {}, + onMount: function () {}, + onShow: function () {}, + onShown: function () {}, + onTrigger: function () {}, + onUntrigger: function () {}, + onClickOutside: function () {}, + placement: "top", + plugins: [], + popperOptions: {}, + render: null, + showOnCreate: !1, + touch: !0, + trigger: "mouseenter focus", + triggerTarget: null, + }, + Ct, + {}, + Hr, + ), + $r = Object.keys(Ze), + Wr = function (w) { + gt(w, []); + var C = Object.keys(w); + C.forEach(function (L) { + Ze[L] = w[L]; + }); + }; + function ot(g) { + var w = g.plugins || [], + C = w.reduce(function (L, q) { + var W = q.name, + B = q.defaultValue; + return (W && (L[W] = g[W] !== void 0 ? g[W] : B), L); + }, {}); + return Object.assign({}, g, {}, C); + } + function Ur(g, w) { + var C = w + ? Object.keys(ot(Object.assign({}, Ze, { plugins: w }))) + : $r, + L = C.reduce(function (q, W) { + var B = ( + g.getAttribute("data-tippy-" + W) || "" + ).trim(); + if (!B) return q; + if (W === "content") q[W] = B; + else + try { + q[W] = JSON.parse(B); + } catch { + q[W] = B; + } + return q; + }, {}); + return L; + } + function ir(g, w) { + var C = Object.assign( + {}, + w, + { content: O(w.content, [g]) }, + w.ignoreAttributes ? {} : Ur(g, w.plugins), + ); + return ( + (C.aria = Object.assign({}, Ze.aria, {}, C.aria)), + (C.aria = { + expanded: + C.aria.expanded === "auto" + ? w.interactive + : C.aria.expanded, + content: + C.aria.content === "auto" + ? w.interactive + ? null + : "describedby" + : C.aria.content, + }), + C + ); + } + function gt(g, w) { + (g === void 0 && (g = {}), w === void 0 && (w = [])); + var C = Object.keys(g); + C.forEach(function (L) { + var q = x(Ze, Object.keys(Ct)), + W = !u(q, L); + (W && + (W = + w.filter(function (B) { + return B.name === L; + }).length === 0), + mt( + W, + [ + "`" + L + "`", + "is not a valid prop. You may have spelled it incorrectly, or if it's", + "a plugin, forgot to pass it in an array as props.plugins.", + ` -`,`All props: https://atomiks.github.io/tippyjs/v6/all-props/ -`,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var ln=function(){return"innerHTML"};function Yt(g,w){g[ln()]=w}function or(g){var w=J();return g===!0?w.className=a:(w.className=c,V(g)?w.appendChild(g):Yt(w,g)),w}function Nn(g,w){V(w.content)?(Yt(g,""),g.appendChild(w.content)):typeof w.content!="function"&&(w.allowHTML?Yt(g,w.content):g.textContent=w.content)}function Xt(g){var w=g.firstElementChild,C=Y(w.children);return{box:w,content:C.find(function(L){return L.classList.contains(i)}),arrow:C.find(function(L){return L.classList.contains(a)||L.classList.contains(c)}),backdrop:C.find(function(L){return L.classList.contains(o)})}}function ar(g){var w=J(),C=J();C.className=n,C.setAttribute("data-state","hidden"),C.setAttribute("tabindex","-1");var L=J();L.className=i,L.setAttribute("data-state","hidden"),Nn(L,g.props),w.appendChild(C),C.appendChild(L),q(g.props,g.props);function q(W,B){var be=Xt(w),le=be.box,pe=be.content,ye=be.arrow;B.theme?le.setAttribute("data-theme",B.theme):le.removeAttribute("data-theme"),typeof B.animation=="string"?le.setAttribute("data-animation",B.animation):le.removeAttribute("data-animation"),B.inertia?le.setAttribute("data-inertia",""):le.removeAttribute("data-inertia"),le.style.maxWidth=typeof B.maxWidth=="number"?B.maxWidth+"px":B.maxWidth,B.role?le.setAttribute("role",B.role):le.removeAttribute("role"),(W.content!==B.content||W.allowHTML!==B.allowHTML)&&Nn(pe,g.props),B.arrow?ye?W.arrow!==B.arrow&&(le.removeChild(ye),le.appendChild(or(B.arrow))):le.appendChild(or(B.arrow)):ye&&le.removeChild(ye)}return{popper:w,onUpdate:q}}ar.$$tippy=!0;var sr=1,yn=[],wn=[];function cn(g,w){var C=ir(g,Object.assign({},Ze,{},ot(ne(w)))),L,q,W,B=!1,be=!1,le=!1,pe=!1,ye,Te,je,Ae=[],Ie=S(Re,C.interactiveDebounce),re,he=sr++,ve=null,ee=A(C.plugins),ie={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},E={id:he,reference:g,popper:J(),popperInstance:ve,props:C,state:ie,plugins:ee,clearDelayTimeouts:Ft,setProps:dn,setContent:Qt,show:kt,hide:$n,hideWithInteractivity:Zt,enable:wt,disable:et,unmount:Sn,destroy:Wn};if(!C.render)return zt(!0,"render() function has not been supplied."),E;var Ge=C.render(E),fe=Ge.popper,Lt=Ge.onUpdate;fe.setAttribute("data-tippy-root",""),fe.id="tippy-"+E.id,E.popper=fe,g._tippy=E,fe._tippy=E;var bt=ee.map(function(D){return D.fn(E)}),Gt=g.hasAttribute("aria-expanded");return Me(),T(),s(),b("onCreate",[E]),C.showOnCreate&&$e(),fe.addEventListener("mouseenter",function(){E.props.interactive&&E.state.isVisible&&E.clearDelayTimeouts()}),fe.addEventListener("mouseleave",function(D){E.props.interactive&&E.props.trigger.indexOf("mouseenter")>=0&&(yt().addEventListener("mousemove",Ie),Ie(D))}),E;function Kt(){var D=E.props.touch;return Array.isArray(D)?D:[D,0]}function Jt(){return Kt()[0]==="hold"}function rt(){var D;return!!((D=E.props.render)!=null&&D.$$tippy)}function lt(){return re||g}function yt(){var D=lt().parentNode;return D?v(D):document}function un(){return Xt(fe)}function d(D){return E.state.isMounted&&!E.state.isVisible||P.isTouch||ye&&ye.type==="focus"?0:y(E.props.delay,D?0:1,Ze.delay)}function s(){fe.style.pointerEvents=E.props.interactive&&E.state.isVisible?"":"none",fe.style.zIndex=""+E.props.zIndex}function b(D,K,te){if(te===void 0&&(te=!0),bt.forEach(function(we){we[D]&&we[D].apply(void 0,K)}),te){var ge;(ge=E.props)[D].apply(ge,K)}}function _(){var D=E.props.aria;if(D.content){var K="aria-"+D.content,te=fe.id,ge=I(E.props.triggerTarget||g);ge.forEach(function(we){var Ke=we.getAttribute(K);if(E.state.isVisible)we.setAttribute(K,Ke?Ke+" "+te:te);else{var Je=Ke&&Ke.replace(te,"").trim();Je?we.setAttribute(K,Je):we.removeAttribute(K)}})}}function T(){if(!(Gt||!E.props.aria.expanded)){var D=I(E.props.triggerTarget||g);D.forEach(function(K){E.props.interactive?K.setAttribute("aria-expanded",E.state.isVisible&&K===lt()?"true":"false"):K.removeAttribute("aria-expanded")})}}function F(){yt().removeEventListener("mousemove",Ie),yn=yn.filter(function(D){return D!==Ie})}function U(D){if(!(P.isTouch&&(le||D.type==="mousedown"))&&!(E.props.interactive&&fe.contains(D.target))){if(lt().contains(D.target)){if(P.isTouch||E.state.isVisible&&E.props.trigger.indexOf("click")>=0)return}else b("onClickOutside",[E,D]);E.props.hideOnClick===!0&&(E.clearDelayTimeouts(),E.hide(),be=!0,setTimeout(function(){be=!1}),E.state.isMounted||z())}}function H(){le=!0}function G(){le=!1}function oe(){var D=yt();D.addEventListener("mousedown",U,!0),D.addEventListener("touchend",U,f),D.addEventListener("touchstart",G,f),D.addEventListener("touchmove",H,f)}function z(){var D=yt();D.removeEventListener("mousedown",U,!0),D.removeEventListener("touchend",U,f),D.removeEventListener("touchstart",G,f),D.removeEventListener("touchmove",H,f)}function De(D,K){Ce(D,function(){!E.state.isVisible&&fe.parentNode&&fe.parentNode.contains(fe)&&K()})}function Fe(D,K){Ce(D,K)}function Ce(D,K){var te=un().box;function ge(we){we.target===te&&(j(te,"remove",ge),K())}if(D===0)return K();j(te,"remove",Te),j(te,"add",ge),Te=ge}function xe(D,K,te){te===void 0&&(te=!1);var ge=I(E.props.triggerTarget||g);ge.forEach(function(we){we.addEventListener(D,K,te),Ae.push({node:we,eventType:D,handler:K,options:te})})}function Me(){Jt()&&(xe("touchstart",Be,{passive:!0}),xe("touchend",He,{passive:!0})),M(E.props.trigger).forEach(function(D){if(D!=="manual")switch(xe(D,Be),D){case"mouseenter":xe("mouseleave",He);break;case"focus":xe(Nr?"focusout":"blur",ce);break;case"focusin":xe("focusout",ce);break}})}function Se(){Ae.forEach(function(D){var K=D.node,te=D.eventType,ge=D.handler,we=D.options;K.removeEventListener(te,ge,we)}),Ae=[]}function Be(D){var K,te=!1;if(!(!E.state.isEnabled||Pe(D)||be)){var ge=((K=ye)==null?void 0:K.type)==="focus";ye=D,re=D.currentTarget,T(),!E.state.isVisible&&X(D)&&yn.forEach(function(we){return we(D)}),D.type==="click"&&(E.props.trigger.indexOf("mouseenter")<0||B)&&E.props.hideOnClick!==!1&&E.state.isVisible?te=!0:$e(D),D.type==="click"&&(B=!te),te&&!ge&&Ue(D)}}function Re(D){var K=D.target,te=lt().contains(K)||fe.contains(K);if(!(D.type==="mousemove"&&te)){var ge=Ye().concat(fe).map(function(we){var Ke,Je=we._tippy,Dt=(Ke=Je.popperInstance)==null?void 0:Ke.state;return Dt?{popperRect:we.getBoundingClientRect(),popperState:Dt,props:C}:null}).filter(Boolean);p(ge,D)&&(F(),Ue(D))}}function He(D){var K=Pe(D)||E.props.trigger.indexOf("click")>=0&&B;if(!K){if(E.props.interactive){E.hideWithInteractivity(D);return}Ue(D)}}function ce(D){E.props.trigger.indexOf("focusin")<0&&D.target!==lt()||E.props.interactive&&D.relatedTarget&&fe.contains(D.relatedTarget)||Ue(D)}function Pe(D){return P.isTouch?Jt()!==D.type.indexOf("touch")>=0:!1}function _e(){ke();var D=E.props,K=D.popperOptions,te=D.placement,ge=D.offset,we=D.getReferenceClientRect,Ke=D.moveTransition,Je=rt()?Xt(fe).arrow:null,Dt=we?{getBoundingClientRect:we,contextElement:we.contextElement||lt()}:g,Un={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(pn){var en=pn.state;if(rt()){var Gr=un(),tn=Gr.box;["placement","reference-hidden","escaped"].forEach(function(hn){hn==="placement"?tn.setAttribute("data-placement",en.placement):en.attributes.popper["data-popper-"+hn]?tn.setAttribute("data-"+hn,""):tn.removeAttribute("data-"+hn)}),en.attributes.popper={}}}},_t=[{name:"offset",options:{offset:ge}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!Ke}},Un];rt()&&Je&&_t.push({name:"arrow",options:{element:Je,padding:3}}),_t.push.apply(_t,K?.modifiers||[]),E.popperInstance=t.createPopper(Dt,fe,Object.assign({},K,{placement:te,onFirstUpdate:je,modifiers:_t}))}function ke(){E.popperInstance&&(E.popperInstance.destroy(),E.popperInstance=null)}function Le(){var D=E.props.appendTo,K,te=lt();E.props.interactive&&D===Ze.appendTo||D==="parent"?K=te.parentNode:K=O(D,[te]),K.contains(fe)||K.appendChild(fe),_e(),mt(E.props.interactive&&D===Ze.appendTo&&te.nextElementSibling!==fe,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",` +`, + `All props: https://atomiks.github.io/tippyjs/v6/all-props/ +`, + "Plugins: https://atomiks.github.io/tippyjs/v6/plugins/", + ].join(" "), + )); + }); + } + var ln = function () { + return "innerHTML"; + }; + function Yt(g, w) { + g[ln()] = w; + } + function or(g) { + var w = J(); + return ( + g === !0 + ? (w.className = a) + : ((w.className = c), + V(g) ? w.appendChild(g) : Yt(w, g)), + w + ); + } + function Nn(g, w) { + V(w.content) + ? (Yt(g, ""), g.appendChild(w.content)) + : typeof w.content != "function" && + (w.allowHTML + ? Yt(g, w.content) + : (g.textContent = w.content)); + } + function Xt(g) { + var w = g.firstElementChild, + C = Y(w.children); + return { + box: w, + content: C.find(function (L) { + return L.classList.contains(i); + }), + arrow: C.find(function (L) { + return ( + L.classList.contains(a) || L.classList.contains(c) + ); + }), + backdrop: C.find(function (L) { + return L.classList.contains(o); + }), + }; + } + function ar(g) { + var w = J(), + C = J(); + ((C.className = n), + C.setAttribute("data-state", "hidden"), + C.setAttribute("tabindex", "-1")); + var L = J(); + ((L.className = i), + L.setAttribute("data-state", "hidden"), + Nn(L, g.props), + w.appendChild(C), + C.appendChild(L), + q(g.props, g.props)); + function q(W, B) { + var be = Xt(w), + le = be.box, + pe = be.content, + ye = be.arrow; + (B.theme + ? le.setAttribute("data-theme", B.theme) + : le.removeAttribute("data-theme"), + typeof B.animation == "string" + ? le.setAttribute("data-animation", B.animation) + : le.removeAttribute("data-animation"), + B.inertia + ? le.setAttribute("data-inertia", "") + : le.removeAttribute("data-inertia"), + (le.style.maxWidth = + typeof B.maxWidth == "number" + ? B.maxWidth + "px" + : B.maxWidth), + B.role + ? le.setAttribute("role", B.role) + : le.removeAttribute("role"), + (W.content !== B.content || + W.allowHTML !== B.allowHTML) && + Nn(pe, g.props), + B.arrow + ? ye + ? W.arrow !== B.arrow && + (le.removeChild(ye), + le.appendChild(or(B.arrow))) + : le.appendChild(or(B.arrow)) + : ye && le.removeChild(ye)); + } + return { popper: w, onUpdate: q }; + } + ar.$$tippy = !0; + var sr = 1, + yn = [], + wn = []; + function cn(g, w) { + var C = ir(g, Object.assign({}, Ze, {}, ot(ne(w)))), + L, + q, + W, + B = !1, + be = !1, + le = !1, + pe = !1, + ye, + Te, + je, + Ae = [], + Ie = S(Re, C.interactiveDebounce), + re, + he = sr++, + ve = null, + ee = A(C.plugins), + ie = { + isEnabled: !0, + isVisible: !1, + isDestroyed: !1, + isMounted: !1, + isShown: !1, + }, + E = { + id: he, + reference: g, + popper: J(), + popperInstance: ve, + props: C, + state: ie, + plugins: ee, + clearDelayTimeouts: Ft, + setProps: dn, + setContent: Qt, + show: kt, + hide: $n, + hideWithInteractivity: Zt, + enable: wt, + disable: et, + unmount: Sn, + destroy: Wn, + }; + if (!C.render) + return ( + zt(!0, "render() function has not been supplied."), + E + ); + var Ge = C.render(E), + fe = Ge.popper, + Lt = Ge.onUpdate; + (fe.setAttribute("data-tippy-root", ""), + (fe.id = "tippy-" + E.id), + (E.popper = fe), + (g._tippy = E), + (fe._tippy = E)); + var bt = ee.map(function (D) { + return D.fn(E); + }), + Gt = g.hasAttribute("aria-expanded"); + return ( + Me(), + T(), + s(), + b("onCreate", [E]), + C.showOnCreate && $e(), + fe.addEventListener("mouseenter", function () { + E.props.interactive && + E.state.isVisible && + E.clearDelayTimeouts(); + }), + fe.addEventListener("mouseleave", function (D) { + E.props.interactive && + E.props.trigger.indexOf("mouseenter") >= 0 && + (yt().addEventListener("mousemove", Ie), Ie(D)); + }), + E + ); + function Kt() { + var D = E.props.touch; + return Array.isArray(D) ? D : [D, 0]; + } + function Jt() { + return Kt()[0] === "hold"; + } + function rt() { + var D; + return !!((D = E.props.render) != null && D.$$tippy); + } + function lt() { + return re || g; + } + function yt() { + var D = lt().parentNode; + return D ? v(D) : document; + } + function un() { + return Xt(fe); + } + function d(D) { + return (E.state.isMounted && !E.state.isVisible) || + P.isTouch || + (ye && ye.type === "focus") + ? 0 + : y(E.props.delay, D ? 0 : 1, Ze.delay); + } + function s() { + ((fe.style.pointerEvents = + E.props.interactive && E.state.isVisible ? "" : "none"), + (fe.style.zIndex = "" + E.props.zIndex)); + } + function b(D, K, te) { + if ( + (te === void 0 && (te = !0), + bt.forEach(function (we) { + we[D] && we[D].apply(void 0, K); + }), + te) + ) { + var ge; + (ge = E.props)[D].apply(ge, K); + } + } + function _() { + var D = E.props.aria; + if (D.content) { + var K = "aria-" + D.content, + te = fe.id, + ge = I(E.props.triggerTarget || g); + ge.forEach(function (we) { + var Ke = we.getAttribute(K); + if (E.state.isVisible) + we.setAttribute(K, Ke ? Ke + " " + te : te); + else { + var Je = Ke && Ke.replace(te, "").trim(); + Je + ? we.setAttribute(K, Je) + : we.removeAttribute(K); + } + }); + } + } + function T() { + if (!(Gt || !E.props.aria.expanded)) { + var D = I(E.props.triggerTarget || g); + D.forEach(function (K) { + E.props.interactive + ? K.setAttribute( + "aria-expanded", + E.state.isVisible && K === lt() + ? "true" + : "false", + ) + : K.removeAttribute("aria-expanded"); + }); + } + } + function F() { + (yt().removeEventListener("mousemove", Ie), + (yn = yn.filter(function (D) { + return D !== Ie; + }))); + } + function U(D) { + if ( + !(P.isTouch && (le || D.type === "mousedown")) && + !(E.props.interactive && fe.contains(D.target)) + ) { + if (lt().contains(D.target)) { + if ( + P.isTouch || + (E.state.isVisible && + E.props.trigger.indexOf("click") >= 0) + ) + return; + } else b("onClickOutside", [E, D]); + E.props.hideOnClick === !0 && + (E.clearDelayTimeouts(), + E.hide(), + (be = !0), + setTimeout(function () { + be = !1; + }), + E.state.isMounted || z()); + } + } + function H() { + le = !0; + } + function G() { + le = !1; + } + function oe() { + var D = yt(); + (D.addEventListener("mousedown", U, !0), + D.addEventListener("touchend", U, f), + D.addEventListener("touchstart", G, f), + D.addEventListener("touchmove", H, f)); + } + function z() { + var D = yt(); + (D.removeEventListener("mousedown", U, !0), + D.removeEventListener("touchend", U, f), + D.removeEventListener("touchstart", G, f), + D.removeEventListener("touchmove", H, f)); + } + function De(D, K) { + Ce(D, function () { + !E.state.isVisible && + fe.parentNode && + fe.parentNode.contains(fe) && + K(); + }); + } + function Fe(D, K) { + Ce(D, K); + } + function Ce(D, K) { + var te = un().box; + function ge(we) { + we.target === te && (j(te, "remove", ge), K()); + } + if (D === 0) return K(); + (j(te, "remove", Te), j(te, "add", ge), (Te = ge)); + } + function xe(D, K, te) { + te === void 0 && (te = !1); + var ge = I(E.props.triggerTarget || g); + ge.forEach(function (we) { + (we.addEventListener(D, K, te), + Ae.push({ + node: we, + eventType: D, + handler: K, + options: te, + })); + }); + } + function Me() { + (Jt() && + (xe("touchstart", Be, { passive: !0 }), + xe("touchend", He, { passive: !0 })), + M(E.props.trigger).forEach(function (D) { + if (D !== "manual") + switch ((xe(D, Be), D)) { + case "mouseenter": + xe("mouseleave", He); + break; + case "focus": + xe(Nr ? "focusout" : "blur", ce); + break; + case "focusin": + xe("focusout", ce); + break; + } + })); + } + function Se() { + (Ae.forEach(function (D) { + var K = D.node, + te = D.eventType, + ge = D.handler, + we = D.options; + K.removeEventListener(te, ge, we); + }), + (Ae = [])); + } + function Be(D) { + var K, + te = !1; + if (!(!E.state.isEnabled || Pe(D) || be)) { + var ge = + ((K = ye) == null ? void 0 : K.type) === "focus"; + ((ye = D), + (re = D.currentTarget), + T(), + !E.state.isVisible && + X(D) && + yn.forEach(function (we) { + return we(D); + }), + D.type === "click" && + (E.props.trigger.indexOf("mouseenter") < 0 || B) && + E.props.hideOnClick !== !1 && + E.state.isVisible + ? (te = !0) + : $e(D), + D.type === "click" && (B = !te), + te && !ge && Ue(D)); + } + } + function Re(D) { + var K = D.target, + te = lt().contains(K) || fe.contains(K); + if (!(D.type === "mousemove" && te)) { + var ge = Ye() + .concat(fe) + .map(function (we) { + var Ke, + Je = we._tippy, + Dt = + (Ke = Je.popperInstance) == null + ? void 0 + : Ke.state; + return Dt + ? { + popperRect: + we.getBoundingClientRect(), + popperState: Dt, + props: C, + } + : null; + }) + .filter(Boolean); + p(ge, D) && (F(), Ue(D)); + } + } + function He(D) { + var K = + Pe(D) || (E.props.trigger.indexOf("click") >= 0 && B); + if (!K) { + if (E.props.interactive) { + E.hideWithInteractivity(D); + return; + } + Ue(D); + } + } + function ce(D) { + (E.props.trigger.indexOf("focusin") < 0 && + D.target !== lt()) || + (E.props.interactive && + D.relatedTarget && + fe.contains(D.relatedTarget)) || + Ue(D); + } + function Pe(D) { + return P.isTouch + ? Jt() !== D.type.indexOf("touch") >= 0 + : !1; + } + function _e() { + ke(); + var D = E.props, + K = D.popperOptions, + te = D.placement, + ge = D.offset, + we = D.getReferenceClientRect, + Ke = D.moveTransition, + Je = rt() ? Xt(fe).arrow : null, + Dt = we + ? { + getBoundingClientRect: we, + contextElement: we.contextElement || lt(), + } + : g, + Un = { + name: "$$tippy", + enabled: !0, + phase: "beforeWrite", + requires: ["computeStyles"], + fn: function (pn) { + var en = pn.state; + if (rt()) { + var Gr = un(), + tn = Gr.box; + ([ + "placement", + "reference-hidden", + "escaped", + ].forEach(function (hn) { + hn === "placement" + ? tn.setAttribute( + "data-placement", + en.placement, + ) + : en.attributes.popper[ + "data-popper-" + hn + ] + ? tn.setAttribute( + "data-" + hn, + "", + ) + : tn.removeAttribute( + "data-" + hn, + ); + }), + (en.attributes.popper = {})); + } + }, + }, + _t = [ + { name: "offset", options: { offset: ge } }, + { + name: "preventOverflow", + options: { + padding: { + top: 2, + bottom: 2, + left: 5, + right: 5, + }, + }, + }, + { name: "flip", options: { padding: 5 } }, + { + name: "computeStyles", + options: { adaptive: !Ke }, + }, + Un, + ]; + (rt() && + Je && + _t.push({ + name: "arrow", + options: { element: Je, padding: 3 }, + }), + _t.push.apply(_t, K?.modifiers || []), + (E.popperInstance = t.createPopper( + Dt, + fe, + Object.assign({}, K, { + placement: te, + onFirstUpdate: je, + modifiers: _t, + }), + ))); + } + function ke() { + E.popperInstance && + (E.popperInstance.destroy(), (E.popperInstance = null)); + } + function Le() { + var D = E.props.appendTo, + K, + te = lt(); + ((E.props.interactive && D === Ze.appendTo) || + D === "parent" + ? (K = te.parentNode) + : (K = O(D, [te])), + K.contains(fe) || K.appendChild(fe), + _e(), + mt( + E.props.interactive && + D === Ze.appendTo && + te.nextElementSibling !== fe, + [ + "Interactive tippy element may not be accessible via keyboard", + "navigation because it is not directly after the reference element", + "in the DOM source order.", + ` -`,"Using a wrapper
or tag around the reference element","solves this by creating a new parentNode context.",` +`, + "Using a wrapper
or tag around the reference element", + "solves this by creating a new parentNode context.", + ` -`,"Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.",` +`, + "Specifying `appendTo: document.body` silences this warning, but it", + "assumes you are using a focus management solution to handle", + "keyboard navigation.", + ` -`,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function Ye(){return Y(fe.querySelectorAll("[data-tippy-root]"))}function $e(D){E.clearDelayTimeouts(),D&&b("onTrigger",[E,D]),oe();var K=d(!0),te=Kt(),ge=te[0],we=te[1];P.isTouch&&ge==="hold"&&we&&(K=we),K?L=setTimeout(function(){E.show()},K):E.show()}function Ue(D){if(E.clearDelayTimeouts(),b("onUntrigger",[E,D]),!E.state.isVisible){z();return}if(!(E.props.trigger.indexOf("mouseenter")>=0&&E.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(D.type)>=0&&B)){var K=d(!1);K?q=setTimeout(function(){E.state.isVisible&&E.hide()},K):W=requestAnimationFrame(function(){E.hide()})}}function wt(){E.state.isEnabled=!0}function et(){E.hide(),E.state.isEnabled=!1}function Ft(){clearTimeout(L),clearTimeout(q),cancelAnimationFrame(W)}function dn(D){if(mt(E.state.isDestroyed,Vt("setProps")),!E.state.isDestroyed){b("onBeforeUpdate",[E,D]),Se();var K=E.props,te=ir(g,Object.assign({},E.props,{},D,{ignoreAttributes:!0}));E.props=te,Me(),K.interactiveDebounce!==te.interactiveDebounce&&(F(),Ie=S(Re,te.interactiveDebounce)),K.triggerTarget&&!te.triggerTarget?I(K.triggerTarget).forEach(function(ge){ge.removeAttribute("aria-expanded")}):te.triggerTarget&&g.removeAttribute("aria-expanded"),T(),s(),Lt&&Lt(K,te),E.popperInstance&&(_e(),Ye().forEach(function(ge){requestAnimationFrame(ge._tippy.popperInstance.forceUpdate)})),b("onAfterUpdate",[E,D])}}function Qt(D){E.setProps({content:D})}function kt(){mt(E.state.isDestroyed,Vt("show"));var D=E.state.isVisible,K=E.state.isDestroyed,te=!E.state.isEnabled,ge=P.isTouch&&!E.props.touch,we=y(E.props.duration,0,Ze.duration);if(!(D||K||te||ge)&&!lt().hasAttribute("disabled")&&(b("onShow",[E],!1),E.props.onShow(E)!==!1)){if(E.state.isVisible=!0,rt()&&(fe.style.visibility="visible"),s(),oe(),E.state.isMounted||(fe.style.transition="none"),rt()){var Ke=un(),Je=Ke.box,Dt=Ke.content;l([Je,Dt],0)}je=function(){var _t;if(!(!E.state.isVisible||pe)){if(pe=!0,fe.offsetHeight,fe.style.transition=E.props.moveTransition,rt()&&E.props.animation){var An=un(),pn=An.box,en=An.content;l([pn,en],we),h([pn,en],"visible")}_(),T(),$(wn,E),(_t=E.popperInstance)==null||_t.forceUpdate(),E.state.isMounted=!0,b("onMount",[E]),E.props.animation&&rt()&&Fe(we,function(){E.state.isShown=!0,b("onShown",[E])})}},Le()}}function $n(){mt(E.state.isDestroyed,Vt("hide"));var D=!E.state.isVisible,K=E.state.isDestroyed,te=!E.state.isEnabled,ge=y(E.props.duration,1,Ze.duration);if(!(D||K||te)&&(b("onHide",[E],!1),E.props.onHide(E)!==!1)){if(E.state.isVisible=!1,E.state.isShown=!1,pe=!1,B=!1,rt()&&(fe.style.visibility="hidden"),F(),z(),s(),rt()){var we=un(),Ke=we.box,Je=we.content;E.props.animation&&(l([Ke,Je],ge),h([Ke,Je],"hidden"))}_(),T(),E.props.animation?rt()&&De(ge,E.unmount):E.unmount()}}function Zt(D){mt(E.state.isDestroyed,Vt("hideWithInteractivity")),yt().addEventListener("mousemove",Ie),$(yn,Ie),Ie(D)}function Sn(){mt(E.state.isDestroyed,Vt("unmount")),E.state.isVisible&&E.hide(),E.state.isMounted&&(ke(),Ye().forEach(function(D){D._tippy.unmount()}),fe.parentNode&&fe.parentNode.removeChild(fe),wn=wn.filter(function(D){return D!==E}),E.state.isMounted=!1,b("onHidden",[E]))}function Wn(){mt(E.state.isDestroyed,Vt("destroy")),!E.state.isDestroyed&&(E.clearDelayTimeouts(),E.unmount(),Se(),delete g._tippy,E.state.isDestroyed=!0,b("onDestroy",[E]))}}function dt(g,w){w===void 0&&(w={});var C=Ze.plugins.concat(w.plugins||[]);At(g),gt(w,C),Ut();var L=Object.assign({},w,{plugins:C}),q=me(g),W=V(L.content),B=q.length>1;mt(W&&B,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.",` +`, + "See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity", + ].join(" "), + )); + } + function Ye() { + return Y(fe.querySelectorAll("[data-tippy-root]")); + } + function $e(D) { + (E.clearDelayTimeouts(), D && b("onTrigger", [E, D]), oe()); + var K = d(!0), + te = Kt(), + ge = te[0], + we = te[1]; + (P.isTouch && ge === "hold" && we && (K = we), + K + ? (L = setTimeout(function () { + E.show(); + }, K)) + : E.show()); + } + function Ue(D) { + if ( + (E.clearDelayTimeouts(), + b("onUntrigger", [E, D]), + !E.state.isVisible) + ) { + z(); + return; + } + if ( + !( + E.props.trigger.indexOf("mouseenter") >= 0 && + E.props.trigger.indexOf("click") >= 0 && + ["mouseleave", "mousemove"].indexOf(D.type) >= 0 && + B + ) + ) { + var K = d(!1); + K + ? (q = setTimeout(function () { + E.state.isVisible && E.hide(); + }, K)) + : (W = requestAnimationFrame(function () { + E.hide(); + })); + } + } + function wt() { + E.state.isEnabled = !0; + } + function et() { + (E.hide(), (E.state.isEnabled = !1)); + } + function Ft() { + (clearTimeout(L), clearTimeout(q), cancelAnimationFrame(W)); + } + function dn(D) { + if ( + (mt(E.state.isDestroyed, Vt("setProps")), + !E.state.isDestroyed) + ) { + (b("onBeforeUpdate", [E, D]), Se()); + var K = E.props, + te = ir( + g, + Object.assign({}, E.props, {}, D, { + ignoreAttributes: !0, + }), + ); + ((E.props = te), + Me(), + K.interactiveDebounce !== te.interactiveDebounce && + (F(), (Ie = S(Re, te.interactiveDebounce))), + K.triggerTarget && !te.triggerTarget + ? I(K.triggerTarget).forEach(function (ge) { + ge.removeAttribute("aria-expanded"); + }) + : te.triggerTarget && + g.removeAttribute("aria-expanded"), + T(), + s(), + Lt && Lt(K, te), + E.popperInstance && + (_e(), + Ye().forEach(function (ge) { + requestAnimationFrame( + ge._tippy.popperInstance.forceUpdate, + ); + })), + b("onAfterUpdate", [E, D])); + } + } + function Qt(D) { + E.setProps({ content: D }); + } + function kt() { + mt(E.state.isDestroyed, Vt("show")); + var D = E.state.isVisible, + K = E.state.isDestroyed, + te = !E.state.isEnabled, + ge = P.isTouch && !E.props.touch, + we = y(E.props.duration, 0, Ze.duration); + if ( + !(D || K || te || ge) && + !lt().hasAttribute("disabled") && + (b("onShow", [E], !1), E.props.onShow(E) !== !1) + ) { + if ( + ((E.state.isVisible = !0), + rt() && (fe.style.visibility = "visible"), + s(), + oe(), + E.state.isMounted || (fe.style.transition = "none"), + rt()) + ) { + var Ke = un(), + Je = Ke.box, + Dt = Ke.content; + l([Je, Dt], 0); + } + ((je = function () { + var _t; + if (!(!E.state.isVisible || pe)) { + if ( + ((pe = !0), + fe.offsetHeight, + (fe.style.transition = + E.props.moveTransition), + rt() && E.props.animation) + ) { + var An = un(), + pn = An.box, + en = An.content; + (l([pn, en], we), h([pn, en], "visible")); + } + (_(), + T(), + $(wn, E), + (_t = E.popperInstance) == null || + _t.forceUpdate(), + (E.state.isMounted = !0), + b("onMount", [E]), + E.props.animation && + rt() && + Fe(we, function () { + ((E.state.isShown = !0), + b("onShown", [E])); + })); + } + }), + Le()); + } + } + function $n() { + mt(E.state.isDestroyed, Vt("hide")); + var D = !E.state.isVisible, + K = E.state.isDestroyed, + te = !E.state.isEnabled, + ge = y(E.props.duration, 1, Ze.duration); + if ( + !(D || K || te) && + (b("onHide", [E], !1), E.props.onHide(E) !== !1) + ) { + if ( + ((E.state.isVisible = !1), + (E.state.isShown = !1), + (pe = !1), + (B = !1), + rt() && (fe.style.visibility = "hidden"), + F(), + z(), + s(), + rt()) + ) { + var we = un(), + Ke = we.box, + Je = we.content; + E.props.animation && + (l([Ke, Je], ge), h([Ke, Je], "hidden")); + } + (_(), + T(), + E.props.animation + ? rt() && De(ge, E.unmount) + : E.unmount()); + } + } + function Zt(D) { + (mt(E.state.isDestroyed, Vt("hideWithInteractivity")), + yt().addEventListener("mousemove", Ie), + $(yn, Ie), + Ie(D)); + } + function Sn() { + (mt(E.state.isDestroyed, Vt("unmount")), + E.state.isVisible && E.hide(), + E.state.isMounted && + (ke(), + Ye().forEach(function (D) { + D._tippy.unmount(); + }), + fe.parentNode && fe.parentNode.removeChild(fe), + (wn = wn.filter(function (D) { + return D !== E; + })), + (E.state.isMounted = !1), + b("onHidden", [E]))); + } + function Wn() { + (mt(E.state.isDestroyed, Vt("destroy")), + !E.state.isDestroyed && + (E.clearDelayTimeouts(), + E.unmount(), + Se(), + delete g._tippy, + (E.state.isDestroyed = !0), + b("onDestroy", [E]))); + } + } + function dt(g, w) { + w === void 0 && (w = {}); + var C = Ze.plugins.concat(w.plugins || []); + (At(g), gt(w, C), Ut()); + var L = Object.assign({}, w, { plugins: C }), + q = me(g), + W = V(L.content), + B = q.length > 1; + mt( + W && B, + [ + "tippy() was passed an Element as the `content` prop, but more than", + "one tippy instance was created by this invocation. This means the", + "content element will only be appended to the last tippy instance.", + ` -`,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",` +`, + "Instead, pass the .innerHTML of the element, or use a function that", + "returns a cloned version of the element instead.", + ` -`,`1) content: element.innerHTML -`,"2) content: () => element.cloneNode(true)"].join(" "));var be=q.reduce(function(le,pe){var ye=pe&&cn(pe,L);return ye&&le.push(ye),le},[]);return V(g)?be[0]:be}dt.defaultProps=Ze,dt.setDefaultProps=Wr,dt.currentInput=P;var lr=function(w){var C=w===void 0?{}:w,L=C.exclude,q=C.duration;wn.forEach(function(W){var B=!1;if(L&&(B=Q(L)?W.reference===L:W.popper===L.popper),!B){var be=W.props.duration;W.setProps({duration:q}),W.hide(),W.state.isDestroyed||W.setProps({duration:be})}})},cr=Object.assign({},t.applyStyles,{effect:function(w){var C=w.state,L={popper:{position:C.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(C.elements.popper.style,L.popper),C.styles=L,C.elements.arrow&&Object.assign(C.elements.arrow.style,L.arrow)}}),fr=function(w,C){var L;C===void 0&&(C={}),zt(!Array.isArray(w),["The first argument passed to createSingleton() must be an array of","tippy instances. The passed value was",String(w)].join(" "));var q=w,W=[],B,be=C.overrides,le=[],pe=!1;function ye(){W=q.map(function(ee){return ee.reference})}function Te(ee){q.forEach(function(ie){ee?ie.enable():ie.disable()})}function je(ee){return q.map(function(ie){var E=ie.setProps;return ie.setProps=function(Ge){E(Ge),ie.reference===B&&ee.setProps(Ge)},function(){ie.setProps=E}})}function Ae(ee,ie){var E=W.indexOf(ie);if(ie!==B){B=ie;var Ge=(be||[]).concat("content").reduce(function(fe,Lt){return fe[Lt]=q[E].props[Lt],fe},{});ee.setProps(Object.assign({},Ge,{getReferenceClientRect:typeof Ge.getReferenceClientRect=="function"?Ge.getReferenceClientRect:function(){return ie.getBoundingClientRect()}}))}}Te(!1),ye();var Ie={fn:function(){return{onDestroy:function(){Te(!0)},onHidden:function(){B=null},onClickOutside:function(E){E.props.showOnCreate&&!pe&&(pe=!0,B=null)},onShow:function(E){E.props.showOnCreate&&!pe&&(pe=!0,Ae(E,W[0]))},onTrigger:function(E,Ge){Ae(E,Ge.currentTarget)}}}},re=dt(J(),Object.assign({},x(C,["overrides"]),{plugins:[Ie].concat(C.plugins||[]),triggerTarget:W,popperOptions:Object.assign({},C.popperOptions,{modifiers:[].concat(((L=C.popperOptions)==null?void 0:L.modifiers)||[],[cr])})})),he=re.show;re.show=function(ee){if(he(),!B&&ee==null)return Ae(re,W[0]);if(!(B&&ee==null)){if(typeof ee=="number")return W[ee]&&Ae(re,W[ee]);if(q.includes(ee)){var ie=ee.reference;return Ae(re,ie)}if(W.includes(ee))return Ae(re,ee)}},re.showNext=function(){var ee=W[0];if(!B)return re.show(0);var ie=W.indexOf(B);re.show(W[ie+1]||ee)},re.showPrevious=function(){var ee=W[W.length-1];if(!B)return re.show(ee);var ie=W.indexOf(B),E=W[ie-1]||ee;re.show(E)};var ve=re.setProps;return re.setProps=function(ee){be=ee.overrides||be,ve(ee)},re.setInstances=function(ee){Te(!0),le.forEach(function(ie){return ie()}),q=ee,Te(!1),ye(),je(re),re.setProps({triggerTarget:W})},le=je(re),re},ur={mouseover:"mouseenter",focusin:"focus",click:"click"};function qt(g,w){zt(!(w&&w.target),["You must specity a `target` prop indicating a CSS selector string matching","the target elements that should receive a tippy."].join(" "));var C=[],L=[],q=!1,W=w.target,B=x(w,["target"]),be=Object.assign({},B,{trigger:"manual",touch:!1}),le=Object.assign({},B,{showOnCreate:!0}),pe=dt(g,be),ye=I(pe);function Te(he){if(!(!he.target||q)){var ve=he.target.closest(W);if(ve){var ee=ve.getAttribute("data-tippy-trigger")||w.trigger||Ze.trigger;if(!ve._tippy&&!(he.type==="touchstart"&&typeof le.touch=="boolean")&&!(he.type!=="touchstart"&&ee.indexOf(ur[he.type])<0)){var ie=dt(ve,le);ie&&(L=L.concat(ie))}}}}function je(he,ve,ee,ie){ie===void 0&&(ie=!1),he.addEventListener(ve,ee,ie),C.push({node:he,eventType:ve,handler:ee,options:ie})}function Ae(he){var ve=he.reference;je(ve,"touchstart",Te,f),je(ve,"mouseover",Te),je(ve,"focusin",Te),je(ve,"click",Te)}function Ie(){C.forEach(function(he){var ve=he.node,ee=he.eventType,ie=he.handler,E=he.options;ve.removeEventListener(ee,ie,E)}),C=[]}function re(he){var ve=he.destroy,ee=he.enable,ie=he.disable;he.destroy=function(E){E===void 0&&(E=!0),E&&L.forEach(function(Ge){Ge.destroy()}),L=[],Ie(),ve()},he.enable=function(){ee(),L.forEach(function(E){return E.enable()}),q=!1},he.disable=function(){ie(),L.forEach(function(E){return E.disable()}),q=!0},Ae(he)}return ye.forEach(re),pe}var dr={name:"animateFill",defaultValue:!1,fn:function(w){var C;if(!((C=w.props.render)!=null&&C.$$tippy))return zt(w.props.animateFill,"The `animateFill` plugin requires the default render function."),{};var L=Xt(w.popper),q=L.box,W=L.content,B=w.props.animateFill?Vr():null;return{onCreate:function(){B&&(q.insertBefore(B,q.firstElementChild),q.setAttribute("data-animatefill",""),q.style.overflow="hidden",w.setProps({arrow:!1,animation:"shift-away"}))},onMount:function(){if(B){var le=q.style.transitionDuration,pe=Number(le.replace("ms",""));W.style.transitionDelay=Math.round(pe/10)+"ms",B.style.transitionDuration=le,h([B],"visible")}},onShow:function(){B&&(B.style.transitionDuration="0ms")},onHide:function(){B&&h([B],"hidden")}}}};function Vr(){var g=J();return g.className=o,h([g],"hidden"),g}var xn={clientX:0,clientY:0},fn=[];function En(g){var w=g.clientX,C=g.clientY;xn={clientX:w,clientY:C}}function On(g){g.addEventListener("mousemove",En)}function zr(g){g.removeEventListener("mousemove",En)}var jn={name:"followCursor",defaultValue:!1,fn:function(w){var C=w.reference,L=v(w.props.triggerTarget||C),q=!1,W=!1,B=!0,be=w.props;function le(){return w.props.followCursor==="initial"&&w.state.isVisible}function pe(){L.addEventListener("mousemove",je)}function ye(){L.removeEventListener("mousemove",je)}function Te(){q=!0,w.setProps({getReferenceClientRect:null}),q=!1}function je(re){var he=re.target?C.contains(re.target):!0,ve=w.props.followCursor,ee=re.clientX,ie=re.clientY,E=C.getBoundingClientRect(),Ge=ee-E.left,fe=ie-E.top;(he||!w.props.interactive)&&w.setProps({getReferenceClientRect:function(){var bt=C.getBoundingClientRect(),Gt=ee,Kt=ie;ve==="initial"&&(Gt=bt.left+Ge,Kt=bt.top+fe);var Jt=ve==="horizontal"?bt.top:Kt,rt=ve==="vertical"?bt.right:Gt,lt=ve==="horizontal"?bt.bottom:Kt,yt=ve==="vertical"?bt.left:Gt;return{width:rt-yt,height:lt-Jt,top:Jt,right:rt,bottom:lt,left:yt}}})}function Ae(){w.props.followCursor&&(fn.push({instance:w,doc:L}),On(L))}function Ie(){fn=fn.filter(function(re){return re.instance!==w}),fn.filter(function(re){return re.doc===L}).length===0&&zr(L)}return{onCreate:Ae,onDestroy:Ie,onBeforeUpdate:function(){be=w.props},onAfterUpdate:function(he,ve){var ee=ve.followCursor;q||ee!==void 0&&be.followCursor!==ee&&(Ie(),ee?(Ae(),w.state.isMounted&&!W&&!le()&&pe()):(ye(),Te()))},onMount:function(){w.props.followCursor&&!W&&(B&&(je(xn),B=!1),le()||pe())},onTrigger:function(he,ve){X(ve)&&(xn={clientX:ve.clientX,clientY:ve.clientY}),W=ve.type==="focus"},onHidden:function(){w.props.followCursor&&(Te(),ye(),B=!0)}}}};function Yr(g,w){var C;return{popperOptions:Object.assign({},g.popperOptions,{modifiers:[].concat((((C=g.popperOptions)==null?void 0:C.modifiers)||[]).filter(function(L){var q=L.name;return q!==w.name}),[w])})}}var Bn={name:"inlinePositioning",defaultValue:!1,fn:function(w){var C=w.reference;function L(){return!!w.props.inlinePositioning}var q,W=-1,B=!1,be={name:"tippyInlinePositioning",enabled:!0,phase:"afterWrite",fn:function(je){var Ae=je.state;L()&&(q!==Ae.placement&&w.setProps({getReferenceClientRect:function(){return le(Ae.placement)}}),q=Ae.placement)}};function le(Te){return Xr(N(Te),C.getBoundingClientRect(),Y(C.getClientRects()),W)}function pe(Te){B=!0,w.setProps(Te),B=!1}function ye(){B||pe(Yr(w.props,be))}return{onCreate:ye,onAfterUpdate:ye,onTrigger:function(je,Ae){if(X(Ae)){var Ie=Y(w.reference.getClientRects()),re=Ie.find(function(he){return he.left-2<=Ae.clientX&&he.right+2>=Ae.clientX&&he.top-2<=Ae.clientY&&he.bottom+2>=Ae.clientY});W=Ie.indexOf(re)}},onUntrigger:function(){W=-1}}}};function Xr(g,w,C,L){if(C.length<2||g===null)return w;if(C.length===2&&L>=0&&C[0].left>C[1].right)return C[L]||w;switch(g){case"top":case"bottom":{var q=C[0],W=C[C.length-1],B=g==="top",be=q.top,le=W.bottom,pe=B?q.left:W.left,ye=B?q.right:W.right,Te=ye-pe,je=le-be;return{top:be,bottom:le,left:pe,right:ye,width:Te,height:je}}case"left":case"right":{var Ae=Math.min.apply(Math,C.map(function(fe){return fe.left})),Ie=Math.max.apply(Math,C.map(function(fe){return fe.right})),re=C.filter(function(fe){return g==="left"?fe.left===Ae:fe.right===Ie}),he=re[0].top,ve=re[re.length-1].bottom,ee=Ae,ie=Ie,E=ie-ee,Ge=ve-he;return{top:he,bottom:ve,left:ee,right:ie,width:E,height:Ge}}default:return w}}var qr={name:"sticky",defaultValue:!1,fn:function(w){var C=w.reference,L=w.popper;function q(){return w.popperInstance?w.popperInstance.state.elements.reference:C}function W(pe){return w.props.sticky===!0||w.props.sticky===pe}var B=null,be=null;function le(){var pe=W("reference")?q().getBoundingClientRect():null,ye=W("popper")?L.getBoundingClientRect():null;(pe&&Hn(B,pe)||ye&&Hn(be,ye))&&w.popperInstance&&w.popperInstance.update(),B=pe,be=ye,w.state.isMounted&&requestAnimationFrame(le)}return{onMount:function(){w.props.sticky&&le()}}}};function Hn(g,w){return g&&w?g.top!==w.top||g.right!==w.right||g.bottom!==w.bottom||g.left!==w.left:!0}dt.setDefaultProps({render:ar}),e.animateFill=dr,e.createSingleton=fr,e.default=dt,e.delegate=qt,e.followCursor=jn,e.hideAll=lr,e.inlinePositioning=Bn,e.roundArrow=r,e.sticky=qr}),Si=Ho($o()),Ts=Ho($o()),Ps=e=>{let t={plugins:[]},r=i=>e[e.indexOf(i)+1];if(e.includes("animation")&&(t.animation=r("animation")),e.includes("duration")&&(t.duration=parseInt(r("duration"))),e.includes("delay")){let i=r("delay");t.delay=i.includes("-")?i.split("-").map(o=>parseInt(o)):parseInt(i)}if(e.includes("cursor")){t.plugins.push(Ts.followCursor);let i=r("cursor");["x","initial"].includes(i)?t.followCursor=i==="x"?"horizontal":"initial":t.followCursor=!0}e.includes("on")&&(t.trigger=r("on")),e.includes("arrowless")&&(t.arrow=!1),e.includes("html")&&(t.allowHTML=!0),e.includes("interactive")&&(t.interactive=!0),e.includes("border")&&t.interactive&&(t.interactiveBorder=parseInt(r("border"))),e.includes("debounce")&&t.interactive&&(t.interactiveDebounce=parseInt(r("debounce"))),e.includes("max-width")&&(t.maxWidth=parseInt(r("max-width"))),e.includes("theme")&&(t.theme=r("theme")),e.includes("placement")&&(t.placement=r("placement"));let n={};return e.includes("no-flip")&&(n.modifiers||(n.modifiers=[]),n.modifiers.push({name:"flip",enabled:!1})),t.popperOptions=n,t};function Ai(e){e.magic("tooltip",t=>(r,n={})=>{let i=n.timeout;delete n.timeout;let o=(0,Si.default)(t,{content:r,trigger:"manual",...n});o.show(),setTimeout(()=>{o.hide(),setTimeout(()=>o.destroy(),n.duration||300)},i||2e3)}),e.directive("tooltip",(t,{modifiers:r,expression:n},{evaluateLater:i,effect:o,cleanup:a})=>{let c=r.length>0?Ps(r):{};t.__x_tippy||(t.__x_tippy=(0,Si.default)(t,c)),a(()=>{t.__x_tippy&&(t.__x_tippy.destroy(),delete t.__x_tippy)});let f=()=>t.__x_tippy.enable(),u=()=>t.__x_tippy.disable(),y=m=>{m?(f(),t.__x_tippy.setContent(m)):u()};if(r.includes("raw"))y(n);else{let m=i(n);o(()=>{m(O=>{typeof O=="object"?(t.__x_tippy.setProps(O),f()):y(O)})})}})}Ai.defaultProps=e=>(Si.default.setDefaultProps(e),Ai);var Ms=Ai,Wo=Ms;var Uo=()=>({toggle(e){this.$refs.panel?.toggle(e)},open(e){this.$refs.panel?.open(e)},close(e){this.$refs.panel?.close(e)}});var Vo=()=>({form:null,isProcessing:!1,processingMessage:null,init(){let e=this.$el.closest("form");e?.addEventListener("form-processing-started",t=>{this.isProcessing=!0,this.processingMessage=t.detail.message}),e?.addEventListener("form-processing-finished",()=>{this.isProcessing=!1})}});var zo=({id:e})=>({isOpen:!1,isWindowVisible:!1,livewire:null,textSelectionClosePreventionMouseDownHandler:null,textSelectionClosePreventionMouseUpHandler:null,textSelectionClosePreventionClickHandler:null,init(){this.$nextTick(()=>{this.isWindowVisible=this.isOpen,this.setUpTextSelectionClosePrevention(),this.$watch("isOpen",()=>this.isWindowVisible=this.isOpen)})},setUpTextSelectionClosePrevention(){let t=".fi-modal-window",r=".fi-modal-close-overlay",i=!1,o=0;this.textSelectionClosePreventionClickHandler=c=>{c.stopPropagation(),c.preventDefault(),document.removeEventListener("click",this.textSelectionClosePreventionClickHandler,!0)};let a=c=>!c.target.closest(t)&&(c.target.closest(r)||c.target.closest("body"));this.textSelectionClosePreventionMouseDownHandler=c=>{o=Date.now(),i=!!c.target.closest(t)},this.textSelectionClosePreventionMouseUpHandler=c=>{let f=Date.now()-o<75;i&&a(c)&&!f?document.addEventListener("click",this.textSelectionClosePreventionClickHandler,!0):document.removeEventListener("click",this.textSelectionClosePreventionClickHandler,!0),i=!1},document.addEventListener("mousedown",this.textSelectionClosePreventionMouseDownHandler,!0),document.addEventListener("mouseup",this.textSelectionClosePreventionMouseUpHandler,!0)},isTopmost(){if(!e)return!0;let t=document.querySelectorAll(".fi-modal-open");return t.length===0?!1:t[t.length-1].id===e},close(){this.closeQuietly(),this.$dispatch("modal-closed",{id:e})},closeQuietly(){this.isOpen=!1},open(){this.$nextTick(()=>{this.isOpen=!0,document.dispatchEvent(new CustomEvent("x-modal-opened",{bubbles:!0,composed:!0,detail:{id:e}}))})},destroy(){this.textSelectionClosePreventionMouseDownHandler&&(document.removeEventListener("mousedown",this.textSelectionClosePreventionMouseDownHandler,!0),this.textSelectionClosePreventionMouseDownHandler=null),this.textSelectionClosePreventionMouseUpHandler&&(document.removeEventListener("mouseup",this.textSelectionClosePreventionMouseUpHandler,!0),this.textSelectionClosePreventionMouseUpHandler=null),this.textSelectionClosePreventionClickHandler&&(document.removeEventListener("click",this.textSelectionClosePreventionClickHandler,!0),this.textSelectionClosePreventionClickHandler=null)}});document.addEventListener("livewire:init",()=>{let e=t=>{let r=Alpine.findClosest(t,n=>n.__livewire);if(!r)throw"Could not find Livewire component in DOM tree.";return r.__livewire};Livewire.interceptMessage(({message:t,onSuccess:r})=>{r(({payload:o})=>{queueMicrotask(()=>{if(!o.effects?.html)for(let[a,c]of Object.entries(o.effects?.partials??{})){let f=Array.from(t.component.el.querySelectorAll(`[wire\\:partial="${a}"]`)).filter(x=>e(x)===t.component);if(!f.length)continue;if(f.length>1)throw`Multiple elements found for partial [${a}].`;let u=f[0],y=u.parentElement?u.parentElement.tagName.toLowerCase():"div",m=document.createElement(y);m.innerHTML=c,m.__livewire=t.component;let O=m.firstElementChild;O.__livewire=t.component;let S={};u.querySelectorAll("[wire\\:id]").forEach(x=>{S[x.getAttribute("wire:id")]=x}),O.querySelectorAll("[wire\\:id]").forEach(x=>{if(x.hasAttribute("wire:snapshot"))return;let M=x.getAttribute("wire:id"),I=S[M];I&&x.replaceWith(I.cloneNode(!0))}),window.Alpine.morph(u,O,{updating:(x,M,I,$)=>{if(!n(x)){if(x.__livewire_replace===!0&&(x.innerHTML=M.innerHTML),x.__livewire_replace_self===!0)return x.outerHTML=M.outerHTML,$();if(x.__livewire_ignore===!0||(x.__livewire_ignore_self===!0&&I(),i(x)&&x.getAttribute("wire:id")!==t.component.id))return $();i(x)&&(M.__livewire=t.component)}},key:x=>{if(!n(x))return x.hasAttribute("wire:key")?x.getAttribute("wire:key"):x.hasAttribute("wire:id")?x.getAttribute("wire:id"):x.id},lookahead:!1})}})});function n(o){return typeof o.hasAttribute!="function"}function i(o){return o.hasAttribute("wire:id")}})});var Yo=(e,t,r)=>{let n=(y,m)=>{for(let O of y){let S=i(O,m);if(S!==null)return S}},i=(y,m)=>{let O=y.match(/^[\{\[]([^\[\]\{\}]*)[\}\]](.*)/s);if(O===null||O.length!==3)return null;let S=O[1],x=O[2];if(S.includes(",")){let[M,I]=S.split(",",2);if(I==="*"&&m>=M)return x;if(M==="*"&&m<=I)return x;if(m>=M&&m<=I)return x}return S==m?x:null},o=y=>y.toString().charAt(0).toUpperCase()+y.toString().slice(1),a=(y,m)=>{if(m.length===0)return y;let O={};for(let[S,x]of Object.entries(m))O[":"+o(S??"")]=o(x??""),O[":"+S.toUpperCase()]=x.toString().toUpperCase(),O[":"+S]=x;return Object.entries(O).forEach(([S,x])=>{y=y.replaceAll(S,x)}),y},c=y=>y.map(m=>m.replace(/^[\{\[]([^\[\]\{\}]*)[\}\]]/,"")),f=e.split("|"),u=n(f,t);return u!=null?a(u.trim(),r):(f=c(f),a(f.length>1&&t>1?f[1]:f[0],r))};document.addEventListener("alpine:init",()=>{window.Alpine.plugin(oo),window.Alpine.plugin(ao),window.Alpine.plugin(fo),window.Alpine.plugin(jo),window.Alpine.plugin(Wo),window.Alpine.data("filamentDropdown",Uo),window.Alpine.data("filamentFormButton",Vo),window.Alpine.data("filamentModal",zo)});window.jsMd5=Xo.md5;window.pluralize=Yo;})(); +`, + `1) content: element.innerHTML +`, + "2) content: () => element.cloneNode(true)", + ].join(" "), + ); + var be = q.reduce(function (le, pe) { + var ye = pe && cn(pe, L); + return (ye && le.push(ye), le); + }, []); + return V(g) ? be[0] : be; + } + ((dt.defaultProps = Ze), + (dt.setDefaultProps = Wr), + (dt.currentInput = P)); + var lr = function (w) { + var C = w === void 0 ? {} : w, + L = C.exclude, + q = C.duration; + wn.forEach(function (W) { + var B = !1; + if ( + (L && + (B = Q(L) + ? W.reference === L + : W.popper === L.popper), + !B) + ) { + var be = W.props.duration; + (W.setProps({ duration: q }), + W.hide(), + W.state.isDestroyed || + W.setProps({ duration: be })); + } + }); + }, + cr = Object.assign({}, t.applyStyles, { + effect: function (w) { + var C = w.state, + L = { + popper: { + position: C.options.strategy, + left: "0", + top: "0", + margin: "0", + }, + arrow: { position: "absolute" }, + reference: {}, + }; + (Object.assign(C.elements.popper.style, L.popper), + (C.styles = L), + C.elements.arrow && + Object.assign(C.elements.arrow.style, L.arrow)); + }, + }), + fr = function (w, C) { + var L; + (C === void 0 && (C = {}), + zt( + !Array.isArray(w), + [ + "The first argument passed to createSingleton() must be an array of", + "tippy instances. The passed value was", + String(w), + ].join(" "), + )); + var q = w, + W = [], + B, + be = C.overrides, + le = [], + pe = !1; + function ye() { + W = q.map(function (ee) { + return ee.reference; + }); + } + function Te(ee) { + q.forEach(function (ie) { + ee ? ie.enable() : ie.disable(); + }); + } + function je(ee) { + return q.map(function (ie) { + var E = ie.setProps; + return ( + (ie.setProps = function (Ge) { + (E(Ge), + ie.reference === B && ee.setProps(Ge)); + }), + function () { + ie.setProps = E; + } + ); + }); + } + function Ae(ee, ie) { + var E = W.indexOf(ie); + if (ie !== B) { + B = ie; + var Ge = (be || []) + .concat("content") + .reduce(function (fe, Lt) { + return ((fe[Lt] = q[E].props[Lt]), fe); + }, {}); + ee.setProps( + Object.assign({}, Ge, { + getReferenceClientRect: + typeof Ge.getReferenceClientRect == + "function" + ? Ge.getReferenceClientRect + : function () { + return ie.getBoundingClientRect(); + }, + }), + ); + } + } + (Te(!1), ye()); + var Ie = { + fn: function () { + return { + onDestroy: function () { + Te(!0); + }, + onHidden: function () { + B = null; + }, + onClickOutside: function (E) { + E.props.showOnCreate && + !pe && + ((pe = !0), (B = null)); + }, + onShow: function (E) { + E.props.showOnCreate && + !pe && + ((pe = !0), Ae(E, W[0])); + }, + onTrigger: function (E, Ge) { + Ae(E, Ge.currentTarget); + }, + }; + }, + }, + re = dt( + J(), + Object.assign({}, x(C, ["overrides"]), { + plugins: [Ie].concat(C.plugins || []), + triggerTarget: W, + popperOptions: Object.assign( + {}, + C.popperOptions, + { + modifiers: [].concat( + ((L = C.popperOptions) == null + ? void 0 + : L.modifiers) || [], + [cr], + ), + }, + ), + }), + ), + he = re.show; + ((re.show = function (ee) { + if ((he(), !B && ee == null)) return Ae(re, W[0]); + if (!(B && ee == null)) { + if (typeof ee == "number") + return W[ee] && Ae(re, W[ee]); + if (q.includes(ee)) { + var ie = ee.reference; + return Ae(re, ie); + } + if (W.includes(ee)) return Ae(re, ee); + } + }), + (re.showNext = function () { + var ee = W[0]; + if (!B) return re.show(0); + var ie = W.indexOf(B); + re.show(W[ie + 1] || ee); + }), + (re.showPrevious = function () { + var ee = W[W.length - 1]; + if (!B) return re.show(ee); + var ie = W.indexOf(B), + E = W[ie - 1] || ee; + re.show(E); + })); + var ve = re.setProps; + return ( + (re.setProps = function (ee) { + ((be = ee.overrides || be), ve(ee)); + }), + (re.setInstances = function (ee) { + (Te(!0), + le.forEach(function (ie) { + return ie(); + }), + (q = ee), + Te(!1), + ye(), + je(re), + re.setProps({ triggerTarget: W })); + }), + (le = je(re)), + re + ); + }, + ur = { + mouseover: "mouseenter", + focusin: "focus", + click: "click", + }; + function qt(g, w) { + zt( + !(w && w.target), + [ + "You must specity a `target` prop indicating a CSS selector string matching", + "the target elements that should receive a tippy.", + ].join(" "), + ); + var C = [], + L = [], + q = !1, + W = w.target, + B = x(w, ["target"]), + be = Object.assign({}, B, { trigger: "manual", touch: !1 }), + le = Object.assign({}, B, { showOnCreate: !0 }), + pe = dt(g, be), + ye = I(pe); + function Te(he) { + if (!(!he.target || q)) { + var ve = he.target.closest(W); + if (ve) { + var ee = + ve.getAttribute("data-tippy-trigger") || + w.trigger || + Ze.trigger; + if ( + !ve._tippy && + !( + he.type === "touchstart" && + typeof le.touch == "boolean" + ) && + !( + he.type !== "touchstart" && + ee.indexOf(ur[he.type]) < 0 + ) + ) { + var ie = dt(ve, le); + ie && (L = L.concat(ie)); + } + } + } + } + function je(he, ve, ee, ie) { + (ie === void 0 && (ie = !1), + he.addEventListener(ve, ee, ie), + C.push({ + node: he, + eventType: ve, + handler: ee, + options: ie, + })); + } + function Ae(he) { + var ve = he.reference; + (je(ve, "touchstart", Te, f), + je(ve, "mouseover", Te), + je(ve, "focusin", Te), + je(ve, "click", Te)); + } + function Ie() { + (C.forEach(function (he) { + var ve = he.node, + ee = he.eventType, + ie = he.handler, + E = he.options; + ve.removeEventListener(ee, ie, E); + }), + (C = [])); + } + function re(he) { + var ve = he.destroy, + ee = he.enable, + ie = he.disable; + ((he.destroy = function (E) { + (E === void 0 && (E = !0), + E && + L.forEach(function (Ge) { + Ge.destroy(); + }), + (L = []), + Ie(), + ve()); + }), + (he.enable = function () { + (ee(), + L.forEach(function (E) { + return E.enable(); + }), + (q = !1)); + }), + (he.disable = function () { + (ie(), + L.forEach(function (E) { + return E.disable(); + }), + (q = !0)); + }), + Ae(he)); + } + return (ye.forEach(re), pe); + } + var dr = { + name: "animateFill", + defaultValue: !1, + fn: function (w) { + var C; + if (!((C = w.props.render) != null && C.$$tippy)) + return ( + zt( + w.props.animateFill, + "The `animateFill` plugin requires the default render function.", + ), + {} + ); + var L = Xt(w.popper), + q = L.box, + W = L.content, + B = w.props.animateFill ? Vr() : null; + return { + onCreate: function () { + B && + (q.insertBefore(B, q.firstElementChild), + q.setAttribute("data-animatefill", ""), + (q.style.overflow = "hidden"), + w.setProps({ + arrow: !1, + animation: "shift-away", + })); + }, + onMount: function () { + if (B) { + var le = q.style.transitionDuration, + pe = Number(le.replace("ms", "")); + ((W.style.transitionDelay = + Math.round(pe / 10) + "ms"), + (B.style.transitionDuration = le), + h([B], "visible")); + } + }, + onShow: function () { + B && (B.style.transitionDuration = "0ms"); + }, + onHide: function () { + B && h([B], "hidden"); + }, + }; + }, + }; + function Vr() { + var g = J(); + return ((g.className = o), h([g], "hidden"), g); + } + var xn = { clientX: 0, clientY: 0 }, + fn = []; + function En(g) { + var w = g.clientX, + C = g.clientY; + xn = { clientX: w, clientY: C }; + } + function On(g) { + g.addEventListener("mousemove", En); + } + function zr(g) { + g.removeEventListener("mousemove", En); + } + var jn = { + name: "followCursor", + defaultValue: !1, + fn: function (w) { + var C = w.reference, + L = v(w.props.triggerTarget || C), + q = !1, + W = !1, + B = !0, + be = w.props; + function le() { + return ( + w.props.followCursor === "initial" && + w.state.isVisible + ); + } + function pe() { + L.addEventListener("mousemove", je); + } + function ye() { + L.removeEventListener("mousemove", je); + } + function Te() { + ((q = !0), + w.setProps({ getReferenceClientRect: null }), + (q = !1)); + } + function je(re) { + var he = re.target ? C.contains(re.target) : !0, + ve = w.props.followCursor, + ee = re.clientX, + ie = re.clientY, + E = C.getBoundingClientRect(), + Ge = ee - E.left, + fe = ie - E.top; + (he || !w.props.interactive) && + w.setProps({ + getReferenceClientRect: function () { + var bt = C.getBoundingClientRect(), + Gt = ee, + Kt = ie; + ve === "initial" && + ((Gt = bt.left + Ge), + (Kt = bt.top + fe)); + var Jt = ve === "horizontal" ? bt.top : Kt, + rt = ve === "vertical" ? bt.right : Gt, + lt = + ve === "horizontal" + ? bt.bottom + : Kt, + yt = ve === "vertical" ? bt.left : Gt; + return { + width: rt - yt, + height: lt - Jt, + top: Jt, + right: rt, + bottom: lt, + left: yt, + }; + }, + }); + } + function Ae() { + w.props.followCursor && + (fn.push({ instance: w, doc: L }), On(L)); + } + function Ie() { + ((fn = fn.filter(function (re) { + return re.instance !== w; + })), + fn.filter(function (re) { + return re.doc === L; + }).length === 0 && zr(L)); + } + return { + onCreate: Ae, + onDestroy: Ie, + onBeforeUpdate: function () { + be = w.props; + }, + onAfterUpdate: function (he, ve) { + var ee = ve.followCursor; + q || + (ee !== void 0 && + be.followCursor !== ee && + (Ie(), + ee + ? (Ae(), + w.state.isMounted && + !W && + !le() && + pe()) + : (ye(), Te()))); + }, + onMount: function () { + w.props.followCursor && + !W && + (B && (je(xn), (B = !1)), le() || pe()); + }, + onTrigger: function (he, ve) { + (X(ve) && + (xn = { + clientX: ve.clientX, + clientY: ve.clientY, + }), + (W = ve.type === "focus")); + }, + onHidden: function () { + w.props.followCursor && (Te(), ye(), (B = !0)); + }, + }; + }, + }; + function Yr(g, w) { + var C; + return { + popperOptions: Object.assign({}, g.popperOptions, { + modifiers: [].concat( + ( + ((C = g.popperOptions) == null + ? void 0 + : C.modifiers) || [] + ).filter(function (L) { + var q = L.name; + return q !== w.name; + }), + [w], + ), + }), + }; + } + var Bn = { + name: "inlinePositioning", + defaultValue: !1, + fn: function (w) { + var C = w.reference; + function L() { + return !!w.props.inlinePositioning; + } + var q, + W = -1, + B = !1, + be = { + name: "tippyInlinePositioning", + enabled: !0, + phase: "afterWrite", + fn: function (je) { + var Ae = je.state; + L() && + (q !== Ae.placement && + w.setProps({ + getReferenceClientRect: + function () { + return le(Ae.placement); + }, + }), + (q = Ae.placement)); + }, + }; + function le(Te) { + return Xr( + N(Te), + C.getBoundingClientRect(), + Y(C.getClientRects()), + W, + ); + } + function pe(Te) { + ((B = !0), w.setProps(Te), (B = !1)); + } + function ye() { + B || pe(Yr(w.props, be)); + } + return { + onCreate: ye, + onAfterUpdate: ye, + onTrigger: function (je, Ae) { + if (X(Ae)) { + var Ie = Y(w.reference.getClientRects()), + re = Ie.find(function (he) { + return ( + he.left - 2 <= Ae.clientX && + he.right + 2 >= Ae.clientX && + he.top - 2 <= Ae.clientY && + he.bottom + 2 >= Ae.clientY + ); + }); + W = Ie.indexOf(re); + } + }, + onUntrigger: function () { + W = -1; + }, + }; + }, + }; + function Xr(g, w, C, L) { + if (C.length < 2 || g === null) return w; + if (C.length === 2 && L >= 0 && C[0].left > C[1].right) + return C[L] || w; + switch (g) { + case "top": + case "bottom": { + var q = C[0], + W = C[C.length - 1], + B = g === "top", + be = q.top, + le = W.bottom, + pe = B ? q.left : W.left, + ye = B ? q.right : W.right, + Te = ye - pe, + je = le - be; + return { + top: be, + bottom: le, + left: pe, + right: ye, + width: Te, + height: je, + }; + } + case "left": + case "right": { + var Ae = Math.min.apply( + Math, + C.map(function (fe) { + return fe.left; + }), + ), + Ie = Math.max.apply( + Math, + C.map(function (fe) { + return fe.right; + }), + ), + re = C.filter(function (fe) { + return g === "left" + ? fe.left === Ae + : fe.right === Ie; + }), + he = re[0].top, + ve = re[re.length - 1].bottom, + ee = Ae, + ie = Ie, + E = ie - ee, + Ge = ve - he; + return { + top: he, + bottom: ve, + left: ee, + right: ie, + width: E, + height: Ge, + }; + } + default: + return w; + } + } + var qr = { + name: "sticky", + defaultValue: !1, + fn: function (w) { + var C = w.reference, + L = w.popper; + function q() { + return w.popperInstance + ? w.popperInstance.state.elements.reference + : C; + } + function W(pe) { + return w.props.sticky === !0 || w.props.sticky === pe; + } + var B = null, + be = null; + function le() { + var pe = W("reference") + ? q().getBoundingClientRect() + : null, + ye = W("popper") ? L.getBoundingClientRect() : null; + (((pe && Hn(B, pe)) || (ye && Hn(be, ye))) && + w.popperInstance && + w.popperInstance.update(), + (B = pe), + (be = ye), + w.state.isMounted && requestAnimationFrame(le)); + } + return { + onMount: function () { + w.props.sticky && le(); + }, + }; + }, + }; + function Hn(g, w) { + return g && w + ? g.top !== w.top || + g.right !== w.right || + g.bottom !== w.bottom || + g.left !== w.left + : !0; + } + (dt.setDefaultProps({ render: ar }), + (e.animateFill = dr), + (e.createSingleton = fr), + (e.default = dt), + (e.delegate = qt), + (e.followCursor = jn), + (e.hideAll = lr), + (e.inlinePositioning = Bn), + (e.roundArrow = r), + (e.sticky = qr)); + }), + Si = Ho($o()), + Ts = Ho($o()), + Ps = (e) => { + let t = { plugins: [] }, + r = (i) => e[e.indexOf(i) + 1]; + if ( + (e.includes("animation") && (t.animation = r("animation")), + e.includes("duration") && + (t.duration = parseInt(r("duration"))), + e.includes("delay")) + ) { + let i = r("delay"); + t.delay = i.includes("-") + ? i.split("-").map((o) => parseInt(o)) + : parseInt(i); + } + if (e.includes("cursor")) { + t.plugins.push(Ts.followCursor); + let i = r("cursor"); + ["x", "initial"].includes(i) + ? (t.followCursor = i === "x" ? "horizontal" : "initial") + : (t.followCursor = !0); + } + (e.includes("on") && (t.trigger = r("on")), + e.includes("arrowless") && (t.arrow = !1), + e.includes("html") && (t.allowHTML = !0), + e.includes("interactive") && (t.interactive = !0), + e.includes("border") && + t.interactive && + (t.interactiveBorder = parseInt(r("border"))), + e.includes("debounce") && + t.interactive && + (t.interactiveDebounce = parseInt(r("debounce"))), + e.includes("max-width") && + (t.maxWidth = parseInt(r("max-width"))), + e.includes("theme") && (t.theme = r("theme")), + e.includes("placement") && (t.placement = r("placement"))); + let n = {}; + return ( + e.includes("no-flip") && + (n.modifiers || (n.modifiers = []), + n.modifiers.push({ name: "flip", enabled: !1 })), + (t.popperOptions = n), + t + ); + }; + function Ai(e) { + (e.magic("tooltip", (t) => (r, n = {}) => { + let i = n.timeout; + delete n.timeout; + let o = (0, Si.default)(t, { content: r, trigger: "manual", ...n }); + (o.show(), + setTimeout(() => { + (o.hide(), + setTimeout(() => o.destroy(), n.duration || 300)); + }, i || 2e3)); + }), + e.directive( + "tooltip", + ( + t, + { modifiers: r, expression: n }, + { evaluateLater: i, effect: o, cleanup: a }, + ) => { + let c = r.length > 0 ? Ps(r) : {}; + (t.__x_tippy || (t.__x_tippy = (0, Si.default)(t, c)), + a(() => { + t.__x_tippy && + (t.__x_tippy.destroy(), delete t.__x_tippy); + })); + let f = () => t.__x_tippy.enable(), + u = () => t.__x_tippy.disable(), + y = (m) => { + m ? (f(), t.__x_tippy.setContent(m)) : u(); + }; + if (r.includes("raw")) y(n); + else { + let m = i(n); + o(() => { + m((O) => { + typeof O == "object" + ? (t.__x_tippy.setProps(O), f()) + : y(O); + }); + }); + } + }, + )); + } + Ai.defaultProps = (e) => (Si.default.setDefaultProps(e), Ai); + var Ms = Ai, + Wo = Ms; + var Uo = () => ({ + toggle(e) { + this.$refs.panel?.toggle(e); + }, + open(e) { + this.$refs.panel?.open(e); + }, + close(e) { + this.$refs.panel?.close(e); + }, + }); + var Vo = () => ({ + form: null, + isProcessing: !1, + processingMessage: null, + init() { + let e = this.$el.closest("form"); + (e?.addEventListener("form-processing-started", (t) => { + ((this.isProcessing = !0), + (this.processingMessage = t.detail.message)); + }), + e?.addEventListener("form-processing-finished", () => { + this.isProcessing = !1; + })); + }, + }); + var zo = ({ id: e }) => ({ + isOpen: !1, + isWindowVisible: !1, + livewire: null, + textSelectionClosePreventionMouseDownHandler: null, + textSelectionClosePreventionMouseUpHandler: null, + textSelectionClosePreventionClickHandler: null, + init() { + this.$nextTick(() => { + ((this.isWindowVisible = this.isOpen), + this.setUpTextSelectionClosePrevention(), + this.$watch( + "isOpen", + () => (this.isWindowVisible = this.isOpen), + )); + }); + }, + setUpTextSelectionClosePrevention() { + let t = ".fi-modal-window", + r = ".fi-modal-close-overlay", + i = !1, + o = 0; + this.textSelectionClosePreventionClickHandler = (c) => { + (c.stopPropagation(), + c.preventDefault(), + document.removeEventListener( + "click", + this.textSelectionClosePreventionClickHandler, + !0, + )); + }; + let a = (c) => + !c.target.closest(t) && + (c.target.closest(r) || c.target.closest("body")); + ((this.textSelectionClosePreventionMouseDownHandler = (c) => { + ((o = Date.now()), (i = !!c.target.closest(t))); + }), + (this.textSelectionClosePreventionMouseUpHandler = (c) => { + let f = Date.now() - o < 75; + (i && a(c) && !f + ? document.addEventListener( + "click", + this.textSelectionClosePreventionClickHandler, + !0, + ) + : document.removeEventListener( + "click", + this.textSelectionClosePreventionClickHandler, + !0, + ), + (i = !1)); + }), + document.addEventListener( + "mousedown", + this.textSelectionClosePreventionMouseDownHandler, + !0, + ), + document.addEventListener( + "mouseup", + this.textSelectionClosePreventionMouseUpHandler, + !0, + )); + }, + isTopmost() { + if (!e) return !0; + let t = document.querySelectorAll(".fi-modal-open"); + return t.length === 0 ? !1 : t[t.length - 1].id === e; + }, + close() { + (this.closeQuietly(), this.$dispatch("modal-closed", { id: e })); + }, + closeQuietly() { + this.isOpen = !1; + }, + open() { + this.$nextTick(() => { + ((this.isOpen = !0), + document.dispatchEvent( + new CustomEvent("x-modal-opened", { + bubbles: !0, + composed: !0, + detail: { id: e }, + }), + )); + }); + }, + destroy() { + (this.textSelectionClosePreventionMouseDownHandler && + (document.removeEventListener( + "mousedown", + this.textSelectionClosePreventionMouseDownHandler, + !0, + ), + (this.textSelectionClosePreventionMouseDownHandler = null)), + this.textSelectionClosePreventionMouseUpHandler && + (document.removeEventListener( + "mouseup", + this.textSelectionClosePreventionMouseUpHandler, + !0, + ), + (this.textSelectionClosePreventionMouseUpHandler = null)), + this.textSelectionClosePreventionClickHandler && + (document.removeEventListener( + "click", + this.textSelectionClosePreventionClickHandler, + !0, + ), + (this.textSelectionClosePreventionClickHandler = null))); + }, + }); + document.addEventListener("livewire:init", () => { + let e = (t) => { + let r = Alpine.findClosest(t, (n) => n.__livewire); + if (!r) throw "Could not find Livewire component in DOM tree."; + return r.__livewire; + }; + Livewire.interceptMessage(({ message: t, onSuccess: r }) => { + r(({ payload: o }) => { + queueMicrotask(() => { + if (!o.effects?.html) + for (let [a, c] of Object.entries( + o.effects?.partials ?? {}, + )) { + let f = Array.from( + t.component.el.querySelectorAll( + `[wire\\:partial="${a}"]`, + ), + ).filter((x) => e(x) === t.component); + if (!f.length) continue; + if (f.length > 1) + throw `Multiple elements found for partial [${a}].`; + let u = f[0], + y = u.parentElement + ? u.parentElement.tagName.toLowerCase() + : "div", + m = document.createElement(y); + ((m.innerHTML = c), (m.__livewire = t.component)); + let O = m.firstElementChild; + O.__livewire = t.component; + let S = {}; + (u.querySelectorAll("[wire\\:id]").forEach((x) => { + S[x.getAttribute("wire:id")] = x; + }), + O.querySelectorAll("[wire\\:id]").forEach( + (x) => { + if (x.hasAttribute("wire:snapshot")) + return; + let M = x.getAttribute("wire:id"), + I = S[M]; + I && x.replaceWith(I.cloneNode(!0)); + }, + ), + window.Alpine.morph(u, O, { + updating: (x, M, I, $) => { + if (!n(x)) { + if ( + (x.__livewire_replace === !0 && + (x.innerHTML = M.innerHTML), + x.__livewire_replace_self === + !0) + ) + return ( + (x.outerHTML = M.outerHTML), + $() + ); + if ( + x.__livewire_ignore === !0 || + (x.__livewire_ignore_self === + !0 && I(), + i(x) && + x.getAttribute( + "wire:id", + ) !== t.component.id) + ) + return $(); + i(x) && + (M.__livewire = t.component); + } + }, + key: (x) => { + if (!n(x)) + return x.hasAttribute("wire:key") + ? x.getAttribute("wire:key") + : x.hasAttribute("wire:id") + ? x.getAttribute("wire:id") + : x.id; + }, + lookahead: !1, + })); + } + }); + }); + function n(o) { + return typeof o.hasAttribute != "function"; + } + function i(o) { + return o.hasAttribute("wire:id"); + } + }); + }); + var Yo = (e, t, r) => { + let n = (y, m) => { + for (let O of y) { + let S = i(O, m); + if (S !== null) return S; + } + }, + i = (y, m) => { + let O = y.match(/^[\{\[]([^\[\]\{\}]*)[\}\]](.*)/s); + if (O === null || O.length !== 3) return null; + let S = O[1], + x = O[2]; + if (S.includes(",")) { + let [M, I] = S.split(",", 2); + if (I === "*" && m >= M) return x; + if (M === "*" && m <= I) return x; + if (m >= M && m <= I) return x; + } + return S == m ? x : null; + }, + o = (y) => + y.toString().charAt(0).toUpperCase() + y.toString().slice(1), + a = (y, m) => { + if (m.length === 0) return y; + let O = {}; + for (let [S, x] of Object.entries(m)) + ((O[":" + o(S ?? "")] = o(x ?? "")), + (O[":" + S.toUpperCase()] = x.toString().toUpperCase()), + (O[":" + S] = x)); + return ( + Object.entries(O).forEach(([S, x]) => { + y = y.replaceAll(S, x); + }), + y + ); + }, + c = (y) => + y.map((m) => m.replace(/^[\{\[]([^\[\]\{\}]*)[\}\]]/, "")), + f = e.split("|"), + u = n(f, t); + return u != null + ? a(u.trim(), r) + : ((f = c(f)), a(f.length > 1 && t > 1 ? f[1] : f[0], r)); + }; + document.addEventListener("alpine:init", () => { + (window.Alpine.plugin(oo), + window.Alpine.plugin(ao), + window.Alpine.plugin(fo), + window.Alpine.plugin(jo), + window.Alpine.plugin(Wo), + window.Alpine.data("filamentDropdown", Uo), + window.Alpine.data("filamentFormButton", Vo), + window.Alpine.data("filamentModal", zo)); + }); + window.jsMd5 = Xo.md5; + window.pluralize = Yo; +})(); /*! Bundled license information: js-md5/src/md5.js: diff --git a/public/js/filament/tables/components/columns/select.js b/public/js/filament/tables/components/columns/select.js index a75f759f..0bc05ad6 100644 --- a/public/js/filament/tables/components/columns/select.js +++ b/public/js/filament/tables/components/columns/select.js @@ -1,4 +1,4652 @@ -var Ft=Math.min,vt=Math.max,Ht=Math.round;var st=n=>({x:n,y:n}),ji={left:"right",right:"left",bottom:"top",top:"bottom"},qi={start:"end",end:"start"};function De(n,t,e){return vt(n,Ft(t,e))}function Vt(n,t){return typeof n=="function"?n(t):n}function wt(n){return n.split("-")[0]}function Wt(n){return n.split("-")[1]}function Ae(n){return n==="x"?"y":"x"}function Ce(n){return n==="y"?"height":"width"}var Ji=new Set(["top","bottom"]);function ht(n){return Ji.has(wt(n))?"y":"x"}function Le(n){return Ae(ht(n))}function Je(n,t,e){e===void 0&&(e=!1);let i=Wt(n),o=Le(n),s=Ce(o),r=o==="x"?i===(e?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(r=Bt(r)),[r,Bt(r)]}function Qe(n){let t=Bt(n);return[ie(n),t,ie(t)]}function ie(n){return n.replace(/start|end/g,t=>qi[t])}var je=["left","right"],qe=["right","left"],Qi=["top","bottom"],Zi=["bottom","top"];function tn(n,t,e){switch(n){case"top":case"bottom":return e?t?qe:je:t?je:qe;case"left":case"right":return t?Qi:Zi;default:return[]}}function Ze(n,t,e,i){let o=Wt(n),s=tn(wt(n),e==="start",i);return o&&(s=s.map(r=>r+"-"+o),t&&(s=s.concat(s.map(ie)))),s}function Bt(n){return n.replace(/left|right|bottom|top/g,t=>ji[t])}function en(n){return{top:0,right:0,bottom:0,left:0,...n}}function ti(n){return typeof n!="number"?en(n):{top:n,right:n,bottom:n,left:n}}function Ot(n){let{x:t,y:e,width:i,height:o}=n;return{width:i,height:o,top:e,left:t,right:t+i,bottom:e+o,x:t,y:e}}function ei(n,t,e){let{reference:i,floating:o}=n,s=ht(t),r=Le(t),a=Ce(r),l=wt(t),c=s==="y",f=i.x+i.width/2-o.width/2,d=i.y+i.height/2-o.height/2,p=i[a]/2-o[a]/2,u;switch(l){case"top":u={x:f,y:i.y-o.height};break;case"bottom":u={x:f,y:i.y+i.height};break;case"right":u={x:i.x+i.width,y:d};break;case"left":u={x:i.x-o.width,y:d};break;default:u={x:i.x,y:i.y}}switch(Wt(t)){case"start":u[r]-=p*(e&&c?-1:1);break;case"end":u[r]+=p*(e&&c?-1:1);break}return u}var ii=async(n,t,e)=>{let{placement:i="bottom",strategy:o="absolute",middleware:s=[],platform:r}=e,a=s.filter(Boolean),l=await(r.isRTL==null?void 0:r.isRTL(t)),c=await r.getElementRects({reference:n,floating:t,strategy:o}),{x:f,y:d}=ei(c,i,l),p=i,u={},g=0;for(let m=0;mH<=0)){var L,X;let H=(((L=s.flip)==null?void 0:L.index)||0)+1,tt=q[H];if(tt&&(!(d==="alignment"?y!==ht(tt):!1)||W.every(B=>ht(B.placement)===y?B.overflows[0]>0:!0)))return{data:{index:H,overflows:W},reset:{placement:tt}};let z=(X=W.filter(Y=>Y.overflows[0]<=0).sort((Y,B)=>Y.overflows[1]-B.overflows[1])[0])==null?void 0:X.placement;if(!z)switch(u){case"bestFit":{var M;let Y=(M=W.filter(B=>{if(F){let et=ht(B.placement);return et===y||et==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(et=>et>0).reduce((et,ee)=>et+ee,0)]).sort((B,et)=>B[1]-et[1])[0])==null?void 0:M[0];Y&&(z=Y);break}case"initialPlacement":z=a;break}if(o!==z)return{reset:{placement:z}}}return{}}}};var nn=new Set(["left","top"]);async function on(n,t){let{placement:e,platform:i,elements:o}=n,s=await(i.isRTL==null?void 0:i.isRTL(o.floating)),r=wt(e),a=Wt(e),l=ht(e)==="y",c=nn.has(r)?-1:1,f=s&&l?-1:1,d=Vt(t,n),{mainAxis:p,crossAxis:u,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof g=="number"&&(u=a==="end"?g*-1:g),l?{x:u*f,y:p*c}:{x:p*c,y:u*f}}var oi=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(t){var e,i;let{x:o,y:s,placement:r,middlewareData:a}=t,l=await on(t,n);return r===((e=a.offset)==null?void 0:e.placement)&&(i=a.arrow)!=null&&i.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:r}}}}},si=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(t){let{x:e,y:i,placement:o}=t,{mainAxis:s=!0,crossAxis:r=!1,limiter:a={fn:S=>{let{x:E,y}=S;return{x:E,y}}},...l}=Vt(n,t),c={x:e,y:i},f=await Ie(t,l),d=ht(wt(o)),p=Ae(d),u=c[p],g=c[d];if(s){let S=p==="y"?"top":"left",E=p==="y"?"bottom":"right",y=u+f[S],D=u-f[E];u=De(y,u,D)}if(r){let S=d==="y"?"top":"left",E=d==="y"?"bottom":"right",y=g+f[S],D=g-f[E];g=De(y,g,D)}let m=a.fn({...t,[p]:u,[d]:g});return{...m,data:{x:m.x-e,y:m.y-i,enabled:{[p]:s,[d]:r}}}}}};function oe(){return typeof window<"u"}function Et(n){return ai(n)?(n.nodeName||"").toLowerCase():"#document"}function U(n){var t;return(n==null||(t=n.ownerDocument)==null?void 0:t.defaultView)||window}function ct(n){var t;return(t=(ai(n)?n.ownerDocument:n.document)||window.document)==null?void 0:t.documentElement}function ai(n){return oe()?n instanceof Node||n instanceof U(n).Node:!1}function it(n){return oe()?n instanceof Element||n instanceof U(n).Element:!1}function rt(n){return oe()?n instanceof HTMLElement||n instanceof U(n).HTMLElement:!1}function ri(n){return!oe()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof U(n).ShadowRoot}var sn=new Set(["inline","contents"]);function It(n){let{overflow:t,overflowX:e,overflowY:i,display:o}=nt(n);return/auto|scroll|overlay|hidden|clip/.test(t+i+e)&&!sn.has(o)}var rn=new Set(["table","td","th"]);function li(n){return rn.has(Et(n))}var an=[":popover-open",":modal"];function zt(n){return an.some(t=>{try{return n.matches(t)}catch{return!1}})}var ln=["transform","translate","scale","rotate","perspective"],cn=["transform","translate","scale","rotate","perspective","filter"],dn=["paint","layout","strict","content"];function se(n){let t=re(),e=it(n)?nt(n):n;return ln.some(i=>e[i]?e[i]!=="none":!1)||(e.containerType?e.containerType!=="normal":!1)||!t&&(e.backdropFilter?e.backdropFilter!=="none":!1)||!t&&(e.filter?e.filter!=="none":!1)||cn.some(i=>(e.willChange||"").includes(i))||dn.some(i=>(e.contain||"").includes(i))}function ci(n){let t=ut(n);for(;rt(t)&&!Dt(t);){if(se(t))return t;if(zt(t))return null;t=ut(t)}return null}function re(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}var fn=new Set(["html","body","#document"]);function Dt(n){return fn.has(Et(n))}function nt(n){return U(n).getComputedStyle(n)}function $t(n){return it(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function ut(n){if(Et(n)==="html")return n;let t=n.assignedSlot||n.parentNode||ri(n)&&n.host||ct(n);return ri(t)?t.host:t}function di(n){let t=ut(n);return Dt(t)?n.ownerDocument?n.ownerDocument.body:n.body:rt(t)&&It(t)?t:di(t)}function ne(n,t,e){var i;t===void 0&&(t=[]),e===void 0&&(e=!0);let o=di(n),s=o===((i=n.ownerDocument)==null?void 0:i.body),r=U(o);if(s){let a=ae(r);return t.concat(r,r.visualViewport||[],It(o)?o:[],a&&e?ne(a):[])}return t.concat(o,ne(o,[],e))}function ae(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function pi(n){let t=nt(n),e=parseFloat(t.width)||0,i=parseFloat(t.height)||0,o=rt(n),s=o?n.offsetWidth:e,r=o?n.offsetHeight:i,a=Ht(e)!==s||Ht(i)!==r;return a&&(e=s,i=r),{width:e,height:i,$:a}}function gi(n){return it(n)?n:n.contextElement}function Tt(n){let t=gi(n);if(!rt(t))return st(1);let e=t.getBoundingClientRect(),{width:i,height:o,$:s}=pi(t),r=(s?Ht(e.width):e.width)/i,a=(s?Ht(e.height):e.height)/o;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}var hn=st(0);function mi(n){let t=U(n);return!re()||!t.visualViewport?hn:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function un(n,t,e){return t===void 0&&(t=!1),!e||t&&e!==U(n)?!1:t}function Xt(n,t,e,i){t===void 0&&(t=!1),e===void 0&&(e=!1);let o=n.getBoundingClientRect(),s=gi(n),r=st(1);t&&(i?it(i)&&(r=Tt(i)):r=Tt(n));let a=un(s,e,i)?mi(s):st(0),l=(o.left+a.x)/r.x,c=(o.top+a.y)/r.y,f=o.width/r.x,d=o.height/r.y;if(s){let p=U(s),u=i&&it(i)?U(i):i,g=p,m=ae(g);for(;m&&i&&u!==g;){let S=Tt(m),E=m.getBoundingClientRect(),y=nt(m),D=E.left+(m.clientLeft+parseFloat(y.paddingLeft))*S.x,A=E.top+(m.clientTop+parseFloat(y.paddingTop))*S.y;l*=S.x,c*=S.y,f*=S.x,d*=S.y,l+=D,c+=A,g=U(m),m=ae(g)}}return Ot({width:f,height:d,x:l,y:c})}function le(n,t){let e=$t(n).scrollLeft;return t?t.left+e:Xt(ct(n)).left+e}function bi(n,t){let e=n.getBoundingClientRect(),i=e.left+t.scrollLeft-le(n,e),o=e.top+t.scrollTop;return{x:i,y:o}}function pn(n){let{elements:t,rect:e,offsetParent:i,strategy:o}=n,s=o==="fixed",r=ct(i),a=t?zt(t.floating):!1;if(i===r||a&&s)return e;let l={scrollLeft:0,scrollTop:0},c=st(1),f=st(0),d=rt(i);if((d||!d&&!s)&&((Et(i)!=="body"||It(r))&&(l=$t(i)),rt(i))){let u=Xt(i);c=Tt(i),f.x=u.x+i.clientLeft,f.y=u.y+i.clientTop}let p=r&&!d&&!s?bi(r,l):st(0);return{width:e.width*c.x,height:e.height*c.y,x:e.x*c.x-l.scrollLeft*c.x+f.x+p.x,y:e.y*c.y-l.scrollTop*c.y+f.y+p.y}}function gn(n){return Array.from(n.getClientRects())}function mn(n){let t=ct(n),e=$t(n),i=n.ownerDocument.body,o=vt(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),s=vt(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight),r=-e.scrollLeft+le(n),a=-e.scrollTop;return nt(i).direction==="rtl"&&(r+=vt(t.clientWidth,i.clientWidth)-o),{width:o,height:s,x:r,y:a}}var fi=25;function bn(n,t){let e=U(n),i=ct(n),o=e.visualViewport,s=i.clientWidth,r=i.clientHeight,a=0,l=0;if(o){s=o.width,r=o.height;let f=re();(!f||f&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}let c=le(i);if(c<=0){let f=i.ownerDocument,d=f.body,p=getComputedStyle(d),u=f.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,g=Math.abs(i.clientWidth-d.clientWidth-u);g<=fi&&(s-=g)}else c<=fi&&(s+=c);return{width:s,height:r,x:a,y:l}}var vn=new Set(["absolute","fixed"]);function wn(n,t){let e=Xt(n,!0,t==="fixed"),i=e.top+n.clientTop,o=e.left+n.clientLeft,s=rt(n)?Tt(n):st(1),r=n.clientWidth*s.x,a=n.clientHeight*s.y,l=o*s.x,c=i*s.y;return{width:r,height:a,x:l,y:c}}function hi(n,t,e){let i;if(t==="viewport")i=bn(n,e);else if(t==="document")i=mn(ct(n));else if(it(t))i=wn(t,e);else{let o=mi(n);i={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Ot(i)}function vi(n,t){let e=ut(n);return e===t||!it(e)||Dt(e)?!1:nt(e).position==="fixed"||vi(e,t)}function yn(n,t){let e=t.get(n);if(e)return e;let i=ne(n,[],!1).filter(a=>it(a)&&Et(a)!=="body"),o=null,s=nt(n).position==="fixed",r=s?ut(n):n;for(;it(r)&&!Dt(r);){let a=nt(r),l=se(r);!l&&a.position==="fixed"&&(o=null),(s?!l&&!o:!l&&a.position==="static"&&!!o&&vn.has(o.position)||It(r)&&!l&&vi(n,r))?i=i.filter(f=>f!==r):o=a,r=ut(r)}return t.set(n,i),i}function Sn(n){let{element:t,boundary:e,rootBoundary:i,strategy:o}=n,r=[...e==="clippingAncestors"?zt(t)?[]:yn(t,this._c):[].concat(e),i],a=r[0],l=r.reduce((c,f)=>{let d=hi(t,f,o);return c.top=vt(d.top,c.top),c.right=Ft(d.right,c.right),c.bottom=Ft(d.bottom,c.bottom),c.left=vt(d.left,c.left),c},hi(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function xn(n){let{width:t,height:e}=pi(n);return{width:t,height:e}}function On(n,t,e){let i=rt(t),o=ct(t),s=e==="fixed",r=Xt(n,!0,s,t),a={scrollLeft:0,scrollTop:0},l=st(0);function c(){l.x=le(o)}if(i||!i&&!s)if((Et(t)!=="body"||It(o))&&(a=$t(t)),i){let u=Xt(t,!0,s,t);l.x=u.x+t.clientLeft,l.y=u.y+t.clientTop}else o&&c();s&&!i&&o&&c();let f=o&&!i&&!s?bi(o,a):st(0),d=r.left+a.scrollLeft-l.x-f.x,p=r.top+a.scrollTop-l.y-f.y;return{x:d,y:p,width:r.width,height:r.height}}function Te(n){return nt(n).position==="static"}function ui(n,t){if(!rt(n)||nt(n).position==="fixed")return null;if(t)return t(n);let e=n.offsetParent;return ct(n)===e&&(e=e.ownerDocument.body),e}function wi(n,t){let e=U(n);if(zt(n))return e;if(!rt(n)){let o=ut(n);for(;o&&!Dt(o);){if(it(o)&&!Te(o))return o;o=ut(o)}return e}let i=ui(n,t);for(;i&&li(i)&&Te(i);)i=ui(i,t);return i&&Dt(i)&&Te(i)&&!se(i)?e:i||ci(n)||e}var En=async function(n){let t=this.getOffsetParent||wi,e=this.getDimensions,i=await e(n.floating);return{reference:On(n.reference,await t(n.floating),n.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function Dn(n){return nt(n).direction==="rtl"}var An={convertOffsetParentRelativeRectToViewportRelativeRect:pn,getDocumentElement:ct,getClippingRect:Sn,getOffsetParent:wi,getElementRects:En,getClientRects:gn,getDimensions:xn,getScale:Tt,isElement:it,isRTL:Dn};var yi=oi;var Si=si,xi=ni;var Oi=(n,t,e)=>{let i=new Map,o={platform:An,...e},s={...o.platform,_c:i};return ii(n,t,{...o,platform:s})};function Ei(n,t){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);t&&(i=i.filter(function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable})),e.push.apply(e,i)}return e}function ft(n){for(var t=1;t=0)&&(e[o]=n[o]);return e}function In(n,t){if(n==null)return{};var e=Ln(n,t),i,o;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(o=0;o=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(e[i]=n[i])}return e}var Tn="1.15.6";function pt(n){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(n)}var mt=pt(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Zt=pt(/Edge/i),Di=pt(/firefox/i),Gt=pt(/safari/i)&&!pt(/chrome/i)&&!pt(/android/i),Xe=pt(/iP(ad|od|hone)/i),Pi=pt(/chrome/i)&&pt(/android/i),Mi={capture:!1,passive:!1};function O(n,t,e){n.addEventListener(t,e,!mt&&Mi)}function x(n,t,e){n.removeEventListener(t,e,!mt&&Mi)}function ve(n,t){if(t){if(t[0]===">"&&(t=t.substring(1)),n)try{if(n.matches)return n.matches(t);if(n.msMatchesSelector)return n.msMatchesSelector(t);if(n.webkitMatchesSelector)return n.webkitMatchesSelector(t)}catch{return!1}return!1}}function Ni(n){return n.host&&n!==document&&n.host.nodeType?n.host:n.parentNode}function lt(n,t,e,i){if(n){e=e||document;do{if(t!=null&&(t[0]===">"?n.parentNode===e&&ve(n,t):ve(n,t))||i&&n===e)return n;if(n===e)break}while(n=Ni(n))}return null}var Ai=/\s+/g;function Q(n,t,e){if(n&&t)if(n.classList)n.classList[e?"add":"remove"](t);else{var i=(" "+n.className+" ").replace(Ai," ").replace(" "+t+" "," ");n.className=(i+(e?" "+t:"")).replace(Ai," ")}}function b(n,t,e){var i=n&&n.style;if(i){if(e===void 0)return document.defaultView&&document.defaultView.getComputedStyle?e=document.defaultView.getComputedStyle(n,""):n.currentStyle&&(e=n.currentStyle),t===void 0?e:e[t];!(t in i)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),i[t]=e+(typeof e=="string"?"":"px")}}function Nt(n,t){var e="";if(typeof n=="string")e=n;else do{var i=b(n,"transform");i&&i!=="none"&&(e=i+" "+e)}while(!t&&(n=n.parentNode));var o=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return o&&new o(e)}function ki(n,t,e){if(n){var i=n.getElementsByTagName(t),o=0,s=i.length;if(e)for(;o=s:r=o<=s,!r)return i;if(i===dt())break;i=xt(i,!1)}return!1}function kt(n,t,e,i){for(var o=0,s=0,r=n.children;s2&&arguments[2]!==void 0?arguments[2]:{},o=i.evt,s=In(i,Fn);te.pluginEvent.bind(v)(t,e,ft({dragEl:h,parentEl:R,ghostEl:w,rootEl:I,nextEl:Lt,lastDownEl:pe,cloneEl:T,cloneHidden:St,dragStarted:Kt,putSortable:V,activeSortable:v.active,originalEvent:o,oldIndex:Mt,oldDraggableIndex:qt,newIndex:Z,newDraggableIndex:yt,hideGhostForTarget:Xi,unhideGhostForTarget:Ki,cloneNowHidden:function(){St=!0},cloneNowShown:function(){St=!1},dispatchSortableEvent:function(a){K({sortable:e,name:a,originalEvent:o})}},s))};function K(n){Bn(ft({putSortable:V,cloneEl:T,targetEl:h,rootEl:I,oldIndex:Mt,oldDraggableIndex:qt,newIndex:Z,newDraggableIndex:yt},n))}var h,R,w,I,Lt,pe,T,St,Mt,Z,qt,yt,ce,V,Pt=!1,we=!1,ye=[],At,at,Pe,Me,Ii,Ti,Kt,Rt,Jt,Qt=!1,de=!1,ge,$,Ne=[],Ve=!1,Se=[],Oe=typeof document<"u",fe=Xe,_i=Zt||mt?"cssFloat":"float",Hn=Oe&&!Pi&&!Xe&&"draggable"in document.createElement("div"),Wi=(function(){if(Oe){if(mt)return!1;var n=document.createElement("x");return n.style.cssText="pointer-events:auto",n.style.pointerEvents==="auto"}})(),zi=function(t,e){var i=b(t),o=parseInt(i.width)-parseInt(i.paddingLeft)-parseInt(i.paddingRight)-parseInt(i.borderLeftWidth)-parseInt(i.borderRightWidth),s=kt(t,0,e),r=kt(t,1,e),a=s&&b(s),l=r&&b(r),c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+k(s).width,f=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+k(r).width;if(i.display==="flex")return i.flexDirection==="column"||i.flexDirection==="column-reverse"?"vertical":"horizontal";if(i.display==="grid")return i.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(s&&a.float&&a.float!=="none"){var d=a.float==="left"?"left":"right";return r&&(l.clear==="both"||l.clear===d)?"vertical":"horizontal"}return s&&(a.display==="block"||a.display==="flex"||a.display==="table"||a.display==="grid"||c>=o&&i[_i]==="none"||r&&i[_i]==="none"&&c+f>o)?"vertical":"horizontal"},Vn=function(t,e,i){var o=i?t.left:t.top,s=i?t.right:t.bottom,r=i?t.width:t.height,a=i?e.left:e.top,l=i?e.right:e.bottom,c=i?e.width:e.height;return o===a||s===l||o+r/2===a+c/2},Wn=function(t,e){var i;return ye.some(function(o){var s=o[j].options.emptyInsertThreshold;if(!(!s||Ke(o))){var r=k(o),a=t>=r.left-s&&t<=r.right+s,l=e>=r.top-s&&e<=r.bottom+s;if(a&&l)return i=o}}),i},$i=function(t){function e(s,r){return function(a,l,c,f){var d=a.options.group.name&&l.options.group.name&&a.options.group.name===l.options.group.name;if(s==null&&(r||d))return!0;if(s==null||s===!1)return!1;if(r&&s==="clone")return s;if(typeof s=="function")return e(s(a,l,c,f),r)(a,l,c,f);var p=(r?a:l).options.group.name;return s===!0||typeof s=="string"&&s===p||s.join&&s.indexOf(p)>-1}}var i={},o=t.group;(!o||ue(o)!="object")&&(o={name:o}),i.name=o.name,i.checkPull=e(o.pull,!0),i.checkPut=e(o.put),i.revertClone=o.revertClone,t.group=i},Xi=function(){!Wi&&w&&b(w,"display","none")},Ki=function(){!Wi&&w&&b(w,"display","")};Oe&&!Pi&&document.addEventListener("click",function(n){if(we)return n.preventDefault(),n.stopPropagation&&n.stopPropagation(),n.stopImmediatePropagation&&n.stopImmediatePropagation(),we=!1,!1},!0);var Ct=function(t){if(h){t=t.touches?t.touches[0]:t;var e=Wn(t.clientX,t.clientY);if(e){var i={};for(var o in t)t.hasOwnProperty(o)&&(i[o]=t[o]);i.target=i.rootEl=e,i.preventDefault=void 0,i.stopPropagation=void 0,e[j]._onDragOver(i)}}},zn=function(t){h&&h.parentNode[j]._isOutsideThisEl(t.target)};function v(n,t){if(!(n&&n.nodeType&&n.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(n));this.el=n,this.options=t=gt({},t),n[j]=this;var e={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(n.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return zi(n,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(r,a){r.setData("Text",a.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:v.supportPointer!==!1&&"PointerEvent"in window&&(!Gt||Xe),emptyInsertThreshold:5};te.initializePlugins(this,n,e);for(var i in e)!(i in t)&&(t[i]=e[i]);$i(t);for(var o in this)o.charAt(0)==="_"&&typeof this[o]=="function"&&(this[o]=this[o].bind(this));this.nativeDraggable=t.forceFallback?!1:Hn,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?O(n,"pointerdown",this._onTapStart):(O(n,"mousedown",this._onTapStart),O(n,"touchstart",this._onTapStart)),this.nativeDraggable&&(O(n,"dragover",this),O(n,"dragenter",this)),ye.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),gt(this,Mn())}v.prototype={constructor:v,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(Rt=null)},_getDirection:function(t,e){return typeof this.options.direction=="function"?this.options.direction.call(this,t,e,h):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,i=this.el,o=this.options,s=o.preventOnFilter,r=t.type,a=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,l=(a||t).target,c=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||l,f=o.filter;if(qn(i),!h&&!(/mousedown|pointerdown/.test(r)&&t.button!==0||o.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&Gt&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=lt(l,o.draggable,i,!1),!(l&&l.animated)&&pe!==l)){if(Mt=ot(l),qt=ot(l,o.draggable),typeof f=="function"){if(f.call(this,t,l,this)){K({sortable:e,rootEl:c,name:"filter",targetEl:l,toEl:i,fromEl:i}),G("filter",e,{evt:t}),s&&t.preventDefault();return}}else if(f&&(f=f.split(",").some(function(d){if(d=lt(c,d.trim(),i,!1),d)return K({sortable:e,rootEl:d,name:"filter",targetEl:l,fromEl:i,toEl:i}),G("filter",e,{evt:t}),!0}),f)){s&&t.preventDefault();return}o.handle&&!lt(c,o.handle,i,!1)||this._prepareDragStart(t,a,l)}}},_prepareDragStart:function(t,e,i){var o=this,s=o.el,r=o.options,a=s.ownerDocument,l;if(i&&!h&&i.parentNode===s){var c=k(i);if(I=s,h=i,R=h.parentNode,Lt=h.nextSibling,pe=i,ce=r.group,v.dragged=h,At={target:h,clientX:(e||t).clientX,clientY:(e||t).clientY},Ii=At.clientX-c.left,Ti=At.clientY-c.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,h.style["will-change"]="all",l=function(){if(G("delayEnded",o,{evt:t}),v.eventCanceled){o._onDrop();return}o._disableDelayedDragEvents(),!Di&&o.nativeDraggable&&(h.draggable=!0),o._triggerDragStart(t,e),K({sortable:o,name:"choose",originalEvent:t}),Q(h,r.chosenClass,!0)},r.ignore.split(",").forEach(function(f){ki(h,f.trim(),ke)}),O(a,"dragover",Ct),O(a,"mousemove",Ct),O(a,"touchmove",Ct),r.supportPointer?(O(a,"pointerup",o._onDrop),!this.nativeDraggable&&O(a,"pointercancel",o._onDrop)):(O(a,"mouseup",o._onDrop),O(a,"touchend",o._onDrop),O(a,"touchcancel",o._onDrop)),Di&&this.nativeDraggable&&(this.options.touchStartThreshold=4,h.draggable=!0),G("delayStart",this,{evt:t}),r.delay&&(!r.delayOnTouchOnly||e)&&(!this.nativeDraggable||!(Zt||mt))){if(v.eventCanceled){this._onDrop();return}r.supportPointer?(O(a,"pointerup",o._disableDelayedDrag),O(a,"pointercancel",o._disableDelayedDrag)):(O(a,"mouseup",o._disableDelayedDrag),O(a,"touchend",o._disableDelayedDrag),O(a,"touchcancel",o._disableDelayedDrag)),O(a,"mousemove",o._delayedDragTouchMoveHandler),O(a,"touchmove",o._delayedDragTouchMoveHandler),r.supportPointer&&O(a,"pointermove",o._delayedDragTouchMoveHandler),o._dragStartTimer=setTimeout(l,r.delay)}else l()}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){h&&ke(h),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;x(t,"mouseup",this._disableDelayedDrag),x(t,"touchend",this._disableDelayedDrag),x(t,"touchcancel",this._disableDelayedDrag),x(t,"pointerup",this._disableDelayedDrag),x(t,"pointercancel",this._disableDelayedDrag),x(t,"mousemove",this._delayedDragTouchMoveHandler),x(t,"touchmove",this._delayedDragTouchMoveHandler),x(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||t.pointerType=="touch"&&t,!this.nativeDraggable||e?this.options.supportPointer?O(document,"pointermove",this._onTouchMove):e?O(document,"touchmove",this._onTouchMove):O(document,"mousemove",this._onTouchMove):(O(h,"dragend",this),O(I,"dragstart",this._onDragStart));try{document.selection?me(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,e){if(Pt=!1,I&&h){G("dragStarted",this,{evt:e}),this.nativeDraggable&&O(document,"dragover",zn);var i=this.options;!t&&Q(h,i.dragClass,!1),Q(h,i.ghostClass,!0),v.active=this,t&&this._appendGhost(),K({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(at){this._lastX=at.clientX,this._lastY=at.clientY,Xi();for(var t=document.elementFromPoint(at.clientX,at.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(at.clientX,at.clientY),t!==e);)e=t;if(h.parentNode[j]._isOutsideThisEl(t),e)do{if(e[j]){var i=void 0;if(i=e[j]._onDragOver({clientX:at.clientX,clientY:at.clientY,target:t,rootEl:e}),i&&!this.options.dragoverBubble)break}t=e}while(e=Ni(e));Ki()}},_onTouchMove:function(t){if(At){var e=this.options,i=e.fallbackTolerance,o=e.fallbackOffset,s=t.touches?t.touches[0]:t,r=w&&Nt(w,!0),a=w&&r&&r.a,l=w&&r&&r.d,c=fe&&$&&Li($),f=(s.clientX-At.clientX+o.x)/(a||1)+(c?c[0]-Ne[0]:0)/(a||1),d=(s.clientY-At.clientY+o.y)/(l||1)+(c?c[1]-Ne[1]:0)/(l||1);if(!v.active&&!Pt){if(i&&Math.max(Math.abs(s.clientX-this._lastX),Math.abs(s.clientY-this._lastY))=0&&(K({rootEl:R,name:"add",toEl:R,fromEl:I,originalEvent:t}),K({sortable:this,name:"remove",toEl:R,originalEvent:t}),K({rootEl:R,name:"sort",toEl:R,fromEl:I,originalEvent:t}),K({sortable:this,name:"sort",toEl:R,originalEvent:t})),V&&V.save()):Z!==Mt&&Z>=0&&(K({sortable:this,name:"update",toEl:R,originalEvent:t}),K({sortable:this,name:"sort",toEl:R,originalEvent:t})),v.active&&((Z==null||Z===-1)&&(Z=Mt,yt=qt),K({sortable:this,name:"end",toEl:R,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){G("nulling",this),I=h=R=w=Lt=T=pe=St=At=at=Kt=Z=yt=Mt=qt=Rt=Jt=V=ce=v.dragged=v.ghost=v.clone=v.active=null,Se.forEach(function(t){t.checked=!0}),Se.length=Pe=Me=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":h&&(this._onDragOver(t),$n(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],e,i=this.el.children,o=0,s=i.length,r=this.options;oo.right+s||n.clientY>i.bottom&&n.clientX>i.left:n.clientY>o.bottom+s||n.clientX>i.right&&n.clientY>i.top}function Un(n,t,e,i,o,s,r,a){var l=i?n.clientY:n.clientX,c=i?e.height:e.width,f=i?e.top:e.left,d=i?e.bottom:e.right,p=!1;if(!r){if(a&&gef+c*s/2:ld-ge)return-Jt}else if(l>f+c*(1-o)/2&&ld-c*s/2)?l>f+c/2?1:-1:0}function Gn(n){return ot(h){},options:L,optionsLimit:X=null,placeholder:M,position:H=null,searchableOptionFields:tt=["label"],searchDebounce:z=1e3,searchingMessage:Y="Searching...",searchPrompt:B="Search...",state:et,statePath:ee=null}){this.canOptionLabelsWrap=t,this.canSelectPlaceholder=e,this.element=i,this.getOptionLabelUsing=o,this.getOptionLabelsUsing=s,this.getOptionsUsing=r,this.getSearchResultsUsing=a,this.hasDynamicOptions=l,this.hasDynamicSearchResults=c,this.hasInitialNoOptionsMessage=f,this.initialOptionLabel=d,this.initialOptionLabels=p,this.initialState=u,this.isAutofocused=g,this.isDisabled=m,this.isHtmlAllowed=S,this.isMultiple=E,this.isReorderable=y,this.isSearchable=D,this.livewireId=A,this.loadingMessage=C,this.maxItems=F,this.maxItemsMessage=q,this.noOptionsMessage=J,this.noSearchResultsMessage=_,this.onStateChange=W,this.options=L,this.optionsLimit=X,this.originalOptions=JSON.parse(JSON.stringify(L)),this.placeholder=M,this.position=H,this.searchableOptionFields=Array.isArray(tt)?tt:["label"],this.searchDebounce=z,this.searchingMessage=Y,this.searchPrompt=B,this.state=et,this.statePath=ee,this.activeSearchId=0,this.labelRepository={},this.isOpen=!1,this.selectedIndex=-1,this.searchQuery="",this.searchTimeout=null,this.isSearching=!1,this.selectedDisplayVersion=0,this.render(),this.setUpEventListeners(),this.isAutofocused&&this.selectButton.focus()}populateLabelRepositoryFromOptions(t){if(!(!t||!Array.isArray(t)))for(let e of t)e.options&&Array.isArray(e.options)?this.populateLabelRepositoryFromOptions(e.options):e.value!==void 0&&e.label!==void 0&&(this.labelRepository[e.value]=e.label)}render(){this.populateLabelRepositoryFromOptions(this.options),this.container=document.createElement("div"),this.container.className="fi-select-input-ctn",this.canOptionLabelsWrap||this.container.classList.add("fi-select-input-ctn-option-labels-not-wrapped"),this.container.setAttribute("aria-haspopup","listbox"),this.selectButton=document.createElement("button"),this.selectButton.className="fi-select-input-btn",this.selectButton.type="button",this.selectButton.setAttribute("aria-expanded","false"),this.selectedDisplay=document.createElement("div"),this.selectedDisplay.className="fi-select-input-value-ctn",this.updateSelectedDisplay(),this.selectButton.appendChild(this.selectedDisplay),this.dropdown=document.createElement("div"),this.dropdown.className="fi-dropdown-panel fi-scrollable",this.dropdown.setAttribute("role","listbox"),this.dropdown.setAttribute("tabindex","-1"),this.dropdown.style.display="none",this.dropdownId=`fi-select-input-dropdown-${Math.random().toString(36).substring(2,11)}`,this.dropdown.id=this.dropdownId,this.isMultiple&&this.dropdown.setAttribute("aria-multiselectable","true"),this.isSearchable&&(this.searchContainer=document.createElement("div"),this.searchContainer.className="fi-select-input-search-ctn",this.searchInput=document.createElement("input"),this.searchInput.className="fi-input",this.searchInput.type="text",this.searchInput.placeholder=this.searchPrompt,this.searchInput.setAttribute("aria-label","Search"),this.searchContainer.appendChild(this.searchInput),this.dropdown.appendChild(this.searchContainer),this.searchInput.addEventListener("input",t=>{this.isDisabled||this.handleSearch(t)}),this.searchInput.addEventListener("keydown",t=>{if(!this.isDisabled){if(t.key==="Tab"){t.preventDefault();let e=this.getVisibleOptions();if(e.length===0)return;t.shiftKey?this.selectedIndex=e.length-1:this.selectedIndex=0,e.forEach(i=>{i.classList.remove("fi-selected")}),e[this.selectedIndex].classList.add("fi-selected"),e[this.selectedIndex].focus()}else if(t.key==="ArrowDown"){if(t.preventDefault(),t.stopPropagation(),this.getVisibleOptions().length===0)return;this.selectedIndex=-1,this.searchInput.blur(),this.focusNextOption()}else if(t.key==="ArrowUp"){t.preventDefault(),t.stopPropagation();let e=this.getVisibleOptions();if(e.length===0)return;this.selectedIndex=e.length-1,this.searchInput.blur(),e[this.selectedIndex].classList.add("fi-selected"),e[this.selectedIndex].focus(),e[this.selectedIndex].id&&this.dropdown.setAttribute("aria-activedescendant",e[this.selectedIndex].id),this.scrollOptionIntoView(e[this.selectedIndex])}else if(t.key==="Enter"){if(t.preventDefault(),t.stopPropagation(),this.isSearching)return;let e=this.getVisibleOptions();if(e.length===0)return;let i=e.find(s=>{let r=s.getAttribute("aria-disabled")==="true",a=s.classList.contains("fi-disabled"),l=s.offsetParent===null;return!(r||a||l)});if(!i)return;let o=i.getAttribute("data-value");if(o===null)return;this.selectOption(o)}}})),this.optionsList=document.createElement("ul"),this.renderOptions(),this.container.appendChild(this.selectButton),this.container.appendChild(this.dropdown),this.element.appendChild(this.container),this.applyDisabledState()}renderOptions(){this.optionsList.innerHTML="";let t=0,e=this.options,i=0,o=!1;this.options.forEach(a=>{a.options&&Array.isArray(a.options)?(i+=a.options.length,o=!0):i++}),o?this.optionsList.className="fi-select-input-options-ctn":i>0&&(this.optionsList.className="fi-dropdown-list");let s=o?null:this.optionsList,r=0;for(let a of e){if(this.optionsLimit>0&&r>=this.optionsLimit)break;if(a.options&&Array.isArray(a.options)){let l=a.options;if(this.isMultiple&&Array.isArray(this.state)&&this.state.length>0&&(l=a.options.filter(c=>!this.state.includes(c.value))),l.length>0){if(this.optionsLimit>0){let c=this.optionsLimit-r;c{let a=this.createOptionElement(r.value,r);s.appendChild(a)}),i.appendChild(o),i.appendChild(s),this.optionsList.appendChild(i)}createOptionElement(t,e){let i=t,o=e,s=!1;typeof e=="object"&&e!==null&&"label"in e&&"value"in e&&(i=e.value,o=e.label,s=e.isDisabled||!1);let r=document.createElement("li");r.className="fi-dropdown-list-item fi-select-input-option",s&&r.classList.add("fi-disabled");let a=`fi-select-input-option-${Math.random().toString(36).substring(2,11)}`;if(r.id=a,r.setAttribute("role","option"),r.setAttribute("data-value",i),r.setAttribute("tabindex","0"),s&&r.setAttribute("aria-disabled","true"),this.isHtmlAllowed&&typeof o=="string"){let f=document.createElement("div");f.innerHTML=o;let d=f.textContent||f.innerText||o;r.setAttribute("aria-label",d)}let l=this.isMultiple?Array.isArray(this.state)&&this.state.includes(i):this.state===i;r.setAttribute("aria-selected",l?"true":"false"),l&&r.classList.add("fi-selected");let c=document.createElement("span");return this.isHtmlAllowed?c.innerHTML=o:c.textContent=o,r.appendChild(c),s||r.addEventListener("click",f=>{f.preventDefault(),f.stopPropagation(),this.selectOption(i),this.isMultiple&&(this.isSearchable&&this.searchInput?setTimeout(()=>{this.searchInput.focus()},0):setTimeout(()=>{r.focus()},0))}),r}async updateSelectedDisplay(){this.selectedDisplayVersion=this.selectedDisplayVersion+1;let t=this.selectedDisplayVersion,e=document.createDocumentFragment();if(this.isMultiple){if(!Array.isArray(this.state)||this.state.length===0){let o=document.createElement("span");o.textContent=this.placeholder,o.classList.add("fi-select-input-placeholder"),e.appendChild(o)}else{let o=await this.getLabelsForMultipleSelection();if(t!==this.selectedDisplayVersion)return;this.addBadgesForSelectedOptions(o,e)}t===this.selectedDisplayVersion&&(this.selectedDisplay.replaceChildren(e),this.isOpen&&this.deferPositionDropdown());return}if(this.state===null||this.state===""){let o=document.createElement("span");if(o.textContent=this.placeholder,o.classList.add("fi-select-input-placeholder"),e.appendChild(o),t===this.selectedDisplayVersion){this.selectedDisplay.replaceChildren(e);let s=this.container.querySelector(".fi-select-input-value-remove-btn");s&&s.remove(),this.container.classList.remove("fi-select-input-ctn-clearable")}return}let i=await this.getLabelForSingleSelection();t===this.selectedDisplayVersion&&(this.addSingleSelectionDisplay(i,e),t===this.selectedDisplayVersion&&this.selectedDisplay.replaceChildren(e))}async getLabelsForMultipleSelection(){let t=this.getSelectedOptionLabels(),e=[];if(Array.isArray(this.state)){for(let o of this.state)if(!P(this.labelRepository[o])){if(P(t[o])){this.labelRepository[o]=t[o];continue}e.push(o.toString())}}if(e.length>0&&P(this.initialOptionLabels)&&JSON.stringify(this.state)===JSON.stringify(this.initialState)){if(Array.isArray(this.initialOptionLabels))for(let o of this.initialOptionLabels)P(o)&&o.value!==void 0&&o.label!==void 0&&e.includes(o.value)&&(this.labelRepository[o.value]=o.label)}else if(e.length>0&&this.getOptionLabelsUsing)try{let o=await this.getOptionLabelsUsing();for(let s of o)P(s)&&s.value!==void 0&&s.label!==void 0&&(this.labelRepository[s.value]=s.label)}catch(o){console.error("Error fetching option labels:",o)}let i=[];if(Array.isArray(this.state))for(let o of this.state)P(this.labelRepository[o])?i.push(this.labelRepository[o]):P(t[o])?i.push(t[o]):i.push(o);return i}createBadgeElement(t,e){let i=document.createElement("span");i.className="fi-badge fi-size-md fi-color fi-color-primary fi-text-color-600 dark:fi-text-color-200",P(t)&&i.setAttribute("data-value",t);let o=document.createElement("span");o.className="fi-badge-label-ctn";let s=document.createElement("span");s.className="fi-badge-label",this.canOptionLabelsWrap&&s.classList.add("fi-wrapped"),this.isHtmlAllowed?s.innerHTML=e:s.textContent=e,o.appendChild(s),i.appendChild(o);let r=this.createRemoveButton(t,e);return i.appendChild(r),i}createRemoveButton(t,e){let i=document.createElement("button");return i.type="button",i.className="fi-badge-delete-btn",i.innerHTML='',i.setAttribute("aria-label","Remove "+(this.isHtmlAllowed?e.replace(/<[^>]*>/g,""):e)),i.addEventListener("click",o=>{o.stopPropagation(),P(t)&&this.selectOption(t)}),i.addEventListener("keydown",o=>{(o.key===" "||o.key==="Enter")&&(o.preventDefault(),o.stopPropagation(),P(t)&&this.selectOption(t))}),i}addBadgesForSelectedOptions(t,e=this.selectedDisplay){let i=document.createElement("div");i.className="fi-select-input-value-badges-ctn",t.forEach((o,s)=>{let r=Array.isArray(this.state)?this.state[s]:null,a=this.createBadgeElement(r,o);i.appendChild(a)}),e.appendChild(i),this.isReorderable&&(i.addEventListener("click",o=>{o.stopPropagation()}),i.addEventListener("mousedown",o=>{o.stopPropagation()}),new Ui(i,{animation:150,onEnd:()=>{let o=[];i.querySelectorAll("[data-value]").forEach(s=>{o.push(s.getAttribute("data-value"))}),this.state=o,this.onStateChange(this.state)}}))}async getLabelForSingleSelection(){let t=this.labelRepository[this.state];if(bt(t)&&(t=this.getSelectedOptionLabel(this.state)),bt(t)&&P(this.initialOptionLabel)&&this.state===this.initialState)t=this.initialOptionLabel,P(this.state)&&(this.labelRepository[this.state]=t);else if(bt(t)&&this.getOptionLabelUsing)try{t=await this.getOptionLabelUsing(),P(t)&&P(this.state)&&(this.labelRepository[this.state]=t)}catch(e){console.error("Error fetching option label:",e),t=this.state}else bt(t)&&(t=this.state);return t}addSingleSelectionDisplay(t,e=this.selectedDisplay){let i=document.createElement("span");if(i.className="fi-select-input-value-label",this.isHtmlAllowed?i.innerHTML=t:i.textContent=t,e.appendChild(i),!this.canSelectPlaceholder||this.container.querySelector(".fi-select-input-value-remove-btn"))return;let o=document.createElement("button");o.type="button",o.className="fi-select-input-value-remove-btn",o.innerHTML='',o.setAttribute("aria-label","Clear selection"),o.addEventListener("click",s=>{s.stopPropagation(),this.selectOption("")}),o.addEventListener("keydown",s=>{(s.key===" "||s.key==="Enter")&&(s.preventDefault(),s.stopPropagation(),this.selectOption(""))}),this.container.appendChild(o),this.container.classList.add("fi-select-input-ctn-clearable")}getSelectedOptionLabel(t){if(P(this.labelRepository[t]))return this.labelRepository[t];let e="";for(let i of this.options)if(i.options&&Array.isArray(i.options)){for(let o of i.options)if(o.value===t){e=o.label,this.labelRepository[t]=e;break}}else if(i.value===t){e=i.label,this.labelRepository[t]=e;break}return e}setUpEventListeners(){this.buttonClickListener=()=>{this.toggleDropdown()},this.documentClickListener=t=>{!this.container.contains(t.target)&&this.isOpen&&this.closeDropdown()},this.buttonKeydownListener=t=>{this.isDisabled||this.handleSelectButtonKeydown(t)},this.dropdownKeydownListener=t=>{this.isDisabled||this.isSearchable&&document.activeElement===this.searchInput&&!["Tab","Escape"].includes(t.key)||this.handleDropdownKeydown(t)},this.selectButton.addEventListener("click",this.buttonClickListener),document.addEventListener("click",this.documentClickListener),this.selectButton.addEventListener("keydown",this.buttonKeydownListener),this.dropdown.addEventListener("keydown",this.dropdownKeydownListener),!this.isMultiple&&this.livewireId&&this.statePath&&this.getOptionLabelUsing&&(this.refreshOptionLabelListener=async t=>{if(t.detail.livewireId===this.livewireId&&t.detail.statePath===this.statePath&&P(this.state))try{delete this.labelRepository[this.state];let e=await this.getOptionLabelUsing();P(e)&&(this.labelRepository[this.state]=e);let i=this.selectedDisplay.querySelector(".fi-select-input-value-label");P(i)&&(this.isHtmlAllowed?i.innerHTML=e:i.textContent=e),this.updateOptionLabelInList(this.state,e)}catch(e){console.error("Error refreshing option label:",e)}},window.addEventListener("filament-forms::select.refreshSelectedOptionLabel",this.refreshOptionLabelListener))}updateOptionLabelInList(t,e){this.labelRepository[t]=e;let i=this.getVisibleOptions();for(let o of i)if(o.getAttribute("data-value")===String(t)){if(o.innerHTML="",this.isHtmlAllowed){let s=document.createElement("span");s.innerHTML=e,o.appendChild(s)}else o.appendChild(document.createTextNode(e));break}for(let o of this.options)if(o.options&&Array.isArray(o.options)){for(let s of o.options)if(s.value===t){s.label=e;break}}else if(o.value===t){o.label=e;break}for(let o of this.originalOptions)if(o.options&&Array.isArray(o.options)){for(let s of o.options)if(s.value===t){s.label=e;break}}else if(o.value===t){o.label=e;break}}handleSelectButtonKeydown(t){switch(t.key){case"ArrowDown":t.preventDefault(),t.stopPropagation(),this.isOpen?this.focusNextOption():this.openDropdown();break;case"ArrowUp":t.preventDefault(),t.stopPropagation(),this.isOpen?this.focusPreviousOption():this.openDropdown();break;case" ":if(t.preventDefault(),this.isOpen){if(this.selectedIndex>=0){let e=this.getVisibleOptions()[this.selectedIndex];e&&e.click()}}else this.openDropdown();break;case"Enter":break;case"Escape":this.isOpen&&(t.preventDefault(),this.closeDropdown());break;case"Tab":this.isOpen&&this.closeDropdown();break;default:if(this.isSearchable&&!t.ctrlKey&&!t.metaKey&&!t.altKey&&typeof t.key=="string"&&t.key.length===1){t.preventDefault();let e=t.key;this.isOpen||this.openDropdown(),this.searchInput&&(this.searchInput.focus(),this.searchInput.value=(this.searchInput.value||"")+e,this.searchInput.dispatchEvent(new Event("input",{bubbles:!0})))}break}}handleDropdownKeydown(t){switch(t.key){case"ArrowDown":t.preventDefault(),t.stopPropagation(),this.focusNextOption();break;case"ArrowUp":t.preventDefault(),t.stopPropagation(),this.focusPreviousOption();break;case" ":if(t.preventDefault(),this.selectedIndex>=0){let e=this.getVisibleOptions()[this.selectedIndex];e&&e.click()}break;case"Enter":if(t.preventDefault(),this.selectedIndex>=0){let e=this.getVisibleOptions()[this.selectedIndex];e&&e.click()}else{let e=this.element.closest("form");e&&e.submit()}break;case"Escape":t.preventDefault(),this.closeDropdown(),this.selectButton.focus();break;case"Tab":this.closeDropdown();break;default:if(this.isSearchable&&!t.ctrlKey&&!t.metaKey&&!t.altKey&&typeof t.key=="string"&&t.key.length===1){t.preventDefault();let e=t.key;this.searchInput&&(this.searchInput.focus(),this.searchInput.value=(this.searchInput.value||"")+e,this.searchInput.dispatchEvent(new Event("input",{bubbles:!0})))}break}}toggleDropdown(){if(!this.isDisabled){if(this.isOpen){this.closeDropdown();return}this.isMultiple&&!this.isSearchable&&!this.hasAvailableOptions()||this.openDropdown()}}hasAvailableOptions(){for(let t of this.options)if(t.options&&Array.isArray(t.options)){for(let e of t.options)if(!Array.isArray(this.state)||!this.state.includes(e.value))return!0}else if(!Array.isArray(this.state)||!this.state.includes(t.value))return!0;return!1}async openDropdown(){this.dropdown.style.display="block",this.dropdown.style.opacity="0";let t=this.selectButton.closest(".fi-fixed-positioning-context")!==null&&this.selectButton.closest(".fi-absolute-positioning-context")===null;if(this.dropdown.style.position=t?"fixed":"absolute",this.dropdown.style.width=`${this.selectButton.offsetWidth}px`,this.selectButton.setAttribute("aria-expanded","true"),this.isOpen=!0,this.positionDropdown(),this.resizeListener||(this.resizeListener=()=>{this.dropdown.style.width=`${this.selectButton.offsetWidth}px`,this.positionDropdown()},window.addEventListener("resize",this.resizeListener)),this.scrollListener||(this.scrollListener=()=>this.positionDropdown(),window.addEventListener("scroll",this.scrollListener,!0)),this.dropdown.style.opacity="1",this.isSearchable&&this.searchInput&&(this.searchInput.value="",this.searchQuery="",this.hasDynamicOptions||(this.options=JSON.parse(JSON.stringify(this.originalOptions)),this.renderOptions())),this.hasDynamicOptions&&this.getOptionsUsing){this.showLoadingState(!1);try{let e=await this.getOptionsUsing(),i=Array.isArray(e)?e:e&&Array.isArray(e.options)?e.options:[];if(this.options=i,this.originalOptions=JSON.parse(JSON.stringify(i)),this.populateLabelRepositoryFromOptions(i),this.isSearchable&&this.searchInput&&(this.searchInput.value&&this.searchInput.value.trim()!==""||this.searchQuery&&this.searchQuery.trim()!=="")){let o=(this.searchInput.value||this.searchQuery||"").trim().toLowerCase();this.hideLoadingState(),this.filterOptions(o)}else this.renderOptions()}catch(e){console.error("Error fetching options:",e),this.hideLoadingState()}}else(!this.hasInitialNoOptionsMessage||this.searchQuery)&&this.hideLoadingState();if(this.isSearchable&&this.searchInput)this.searchInput.focus();else{this.selectedIndex=-1;let e=this.getVisibleOptions();if(this.isMultiple){if(Array.isArray(this.state)&&this.state.length>0){for(let i=0;i0&&(this.selectedIndex=0),this.selectedIndex>=0&&(e[this.selectedIndex].classList.add("fi-selected"),e[this.selectedIndex].focus())}}positionDropdown(){let t=this.position==="top"?"top-start":"bottom-start",e=[yi(4),Si({padding:5})];this.position!=="top"&&this.position!=="bottom"&&e.push(xi());let i=this.selectButton.closest(".fi-fixed-positioning-context")!==null&&this.selectButton.closest(".fi-absolute-positioning-context")===null;Oi(this.selectButton,this.dropdown,{placement:t,middleware:e,strategy:i?"fixed":"absolute"}).then(({x:o,y:s})=>{Object.assign(this.dropdown.style,{left:`${o}px`,top:`${s}px`})})}deferPositionDropdown(){this.isOpen&&(this.positioningRequestAnimationFrame&&(cancelAnimationFrame(this.positioningRequestAnimationFrame),this.positioningRequestAnimationFrame=null),this.positioningRequestAnimationFrame=requestAnimationFrame(()=>{this.positionDropdown(),this.positioningRequestAnimationFrame=null}))}closeDropdown(){this.dropdown.style.display="none",this.selectButton.setAttribute("aria-expanded","false"),this.isOpen=!1,this.searchTimeout&&(clearTimeout(this.searchTimeout),this.searchTimeout=null),this.activeSearchId++,this.isSearching=!1,this.hideLoadingState(),this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null),this.scrollListener&&(window.removeEventListener("scroll",this.scrollListener,!0),this.scrollListener=null),this.getVisibleOptions().forEach(e=>{e.classList.remove("fi-selected")}),this.dropdown.removeAttribute("aria-activedescendant")}focusNextOption(){let t=this.getVisibleOptions();if(t.length!==0){if(this.selectedIndex>=0&&this.selectedIndex=0&&this.selectedIndexe.bottom?this.dropdown.scrollTop+=i.bottom-e.bottom:i.top li[role="option"]')):t=Array.from(this.optionsList.querySelectorAll(':scope > ul.fi-dropdown-list > li[role="option"]'));let e=Array.from(this.optionsList.querySelectorAll('li.fi-select-input-option-group > ul > li[role="option"]'));return[...t,...e]}getSelectedOptionLabels(){if(!Array.isArray(this.state)||this.state.length===0)return{};let t={};for(let e of this.state){let i=!1;for(let o of this.options)if(o.options&&Array.isArray(o.options)){for(let s of o.options)if(s.value===e){t[e]=s.label,i=!0;break}if(i)break}else if(o.value===e){t[e]=o.label,i=!0;break}}return t}handleSearch(t){let e=t.target.value.trim();if(this.searchQuery=e,this.searchTimeout&&clearTimeout(this.searchTimeout),e===""){this.options=JSON.parse(JSON.stringify(this.originalOptions)),this.renderOptions();return}if(!this.getSearchResultsUsing||typeof this.getSearchResultsUsing!="function"||!this.hasDynamicSearchResults){this.filterOptions(e);return}this.searchTimeout=setTimeout(async()=>{this.searchTimeout=null;let i=++this.activeSearchId;this.isSearching=!0;try{this.showLoadingState(!0);let o=await this.getSearchResultsUsing(e);if(i!==this.activeSearchId||!this.isOpen)return;let s=Array.isArray(o)?o:o&&Array.isArray(o.options)?o.options:[];this.options=s,this.populateLabelRepositoryFromOptions(s),this.hideLoadingState(),this.renderOptions(),this.isOpen&&this.deferPositionDropdown(),this.options.length===0&&this.showNoResultsMessage()}catch(o){i===this.activeSearchId&&(console.error("Error fetching search results:",o),this.hideLoadingState(),this.options=JSON.parse(JSON.stringify(this.originalOptions)),this.renderOptions())}finally{i===this.activeSearchId&&(this.isSearching=!1)}},this.searchDebounce)}showLoadingState(t=!1){this.optionsList.parentNode===this.dropdown&&this.dropdown.removeChild(this.optionsList),this.hideLoadingState();let e=document.createElement("div");e.className="fi-select-input-message",e.textContent=t?this.searchingMessage:this.loadingMessage,this.dropdown.appendChild(e),this.isOpen&&this.deferPositionDropdown()}hideLoadingState(){let t=this.dropdown.querySelector(".fi-select-input-message");t&&t.remove()}showNoOptionsMessage(){this.optionsList.parentNode===this.dropdown&&this.dropdown.removeChild(this.optionsList),this.hideLoadingState();let t=document.createElement("div");t.className="fi-select-input-message",t.textContent=this.noOptionsMessage,this.dropdown.appendChild(t),this.isOpen&&this.deferPositionDropdown()}showNoResultsMessage(){this.optionsList.parentNode===this.dropdown&&this.dropdown.removeChild(this.optionsList),this.hideLoadingState();let t=document.createElement("div");t.className="fi-select-input-message",t.textContent=this.noSearchResultsMessage,this.dropdown.appendChild(t),this.isOpen&&this.deferPositionDropdown()}filterOptions(t){let e=this.searchableOptionFields.includes("label"),i=this.searchableOptionFields.includes("value");t=t.toLowerCase();let o=[];for(let s of this.originalOptions)if(s.options&&Array.isArray(s.options)){let r=s.options.filter(a=>e&&a.label.toLowerCase().includes(t)||i&&String(a.value).toLowerCase().includes(t));r.length>0&&o.push({label:s.label,options:r})}else(e&&s.label.toLowerCase().includes(t)||i&&String(s.value).toLowerCase().includes(t))&&o.push(s);this.options=o,this.renderOptions(),this.options.length===0&&this.showNoResultsMessage(),this.isOpen&&this.positionDropdown()}selectOption(t){if(this.isDisabled)return;if(!this.isMultiple){this.state=t,this.updateSelectedDisplay(),this.renderOptions(),this.closeDropdown(),this.selectButton.focus(),this.onStateChange(this.state);return}let e=Array.isArray(this.state)?[...this.state]:[];if(e.includes(t)){let o=this.selectedDisplay.querySelector(`[data-value="${t}"]`);if(P(o)){let s=o.parentElement;P(s)&&s.children.length===1?(e=e.filter(r=>r!==t),this.state=e,this.updateSelectedDisplay()):(o.remove(),e=e.filter(r=>r!==t),this.state=e)}else e=e.filter(s=>s!==t),this.state=e,this.updateSelectedDisplay();this.renderOptions(),this.isOpen&&this.deferPositionDropdown(),this.maintainFocusInMultipleMode(),this.onStateChange(this.state);return}if(this.maxItems&&e.length>=this.maxItems){this.maxItemsMessage&&alert(this.maxItemsMessage);return}e.push(t),this.state=e;let i=this.selectedDisplay.querySelector(".fi-select-input-value-badges-ctn");bt(i)?this.updateSelectedDisplay():this.addSingleBadge(t,i),this.renderOptions(),this.isOpen&&this.deferPositionDropdown(),this.maintainFocusInMultipleMode(),this.onStateChange(this.state)}async addSingleBadge(t,e){let i=this.labelRepository[t];if(bt(i)&&(i=this.getSelectedOptionLabel(t),P(i)&&(this.labelRepository[t]=i)),bt(i)&&this.getOptionLabelsUsing)try{let s=await this.getOptionLabelsUsing();for(let r of s)if(P(r)&&r.value===t&&r.label!==void 0){i=r.label,this.labelRepository[t]=i;break}}catch(s){console.error("Error fetching option label:",s)}bt(i)&&(i=t);let o=this.createBadgeElement(t,i);e.appendChild(o)}maintainFocusInMultipleMode(){if(this.isSearchable&&this.searchInput){this.searchInput.focus();return}let t=this.getVisibleOptions();if(t.length!==0){if(this.selectedIndex=-1,Array.isArray(this.state)&&this.state.length>0){for(let e=0;e{e.setAttribute("disabled","disabled"),e.classList.add("fi-disabled")}),!this.isMultiple&&this.canSelectPlaceholder){let t=this.container.querySelector(".fi-select-input-value-remove-btn");t&&(t.setAttribute("disabled","disabled"),t.classList.add("fi-disabled"))}this.isSearchable&&this.searchInput&&(this.searchInput.setAttribute("disabled","disabled"),this.searchInput.classList.add("fi-disabled"))}else{if(this.selectButton.removeAttribute("disabled"),this.selectButton.removeAttribute("aria-disabled"),this.selectButton.classList.remove("fi-disabled"),this.isMultiple&&this.container.querySelectorAll(".fi-select-input-badge-remove").forEach(e=>{e.removeAttribute("disabled"),e.classList.remove("fi-disabled")}),!this.isMultiple&&this.canSelectPlaceholder){let t=this.container.querySelector(".fi-select-input-value-remove-btn");t&&(t.removeAttribute("disabled"),t.classList.add("fi-disabled"))}this.isSearchable&&this.searchInput&&(this.searchInput.removeAttribute("disabled"),this.searchInput.classList.remove("fi-disabled"))}}destroy(){this.selectButton&&this.buttonClickListener&&this.selectButton.removeEventListener("click",this.buttonClickListener),this.documentClickListener&&document.removeEventListener("click",this.documentClickListener),this.selectButton&&this.buttonKeydownListener&&this.selectButton.removeEventListener("keydown",this.buttonKeydownListener),this.dropdown&&this.dropdownKeydownListener&&this.dropdown.removeEventListener("keydown",this.dropdownKeydownListener),this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null),this.scrollListener&&(window.removeEventListener("scroll",this.scrollListener,!0),this.scrollListener=null),this.refreshOptionLabelListener&&window.removeEventListener("filament-forms::select.refreshSelectedOptionLabel",this.refreshOptionLabelListener),this.isOpen&&this.closeDropdown(),this.searchTimeout&&(clearTimeout(this.searchTimeout),this.searchTimeout=null),this.container&&this.container.remove()}};function Qn({canOptionLabelsWrap:n,canSelectPlaceholder:t,getOptionLabelUsing:e,getOptionsUsing:i,getSearchResultsUsing:o,hasDynamicOptions:s,hasDynamicSearchResults:r,hasInitialNoOptionsMessage:a,initialOptionLabel:l,isDisabled:c,isHtmlAllowed:f,isNative:d,isSearchable:p,loadingMessage:u,name:g,noOptionsMessage:m,noSearchResultsMessage:S,options:E,optionsLimit:y,placeholder:D,position:A,recordKey:C,searchableOptionFields:F,searchDebounce:q,searchingMessage:J,searchPrompt:_,state:W}){return{error:void 0,isLoading:!1,select:null,state:W,unsubscribeLivewireHook:null,init(){d||(this.select=new Ee({canOptionLabelsWrap:n,canSelectPlaceholder:t,element:this.$refs.select,getOptionLabelUsing:e,getOptionsUsing:i,getSearchResultsUsing:o,hasDynamicOptions:s,hasDynamicSearchResults:r,hasInitialNoOptionsMessage:a,initialOptionLabel:l,isDisabled:c,isHtmlAllowed:f,isSearchable:p,loadingMessage:u,noOptionsMessage:m,noSearchResultsMessage:S,onStateChange:L=>{this.state=L},options:E,optionsLimit:y,placeholder:D,position:A,searchableOptionFields:F,searchDebounce:q,searchingMessage:J,searchPrompt:_,state:this.state})),this.unsubscribeLivewireHook=Livewire.interceptMessage(({message:L,onSuccess:X})=>{X(()=>{this.$nextTick(()=>{if(this.isLoading||L.component.id!==this.$root.closest("[wire\\:id]")?.attributes["wire:id"].value)return;let M=this.getServerState();M===void 0||this.getNormalizedState()===M||(this.state=M)})})}),this.$watch("state",async L=>{!d&&this.select&&this.select.state!==L&&(this.select.state=L,this.select.updateSelectedDisplay(),this.select.renderOptions());let X=this.getServerState();if(X===void 0||this.getNormalizedState()===X)return;this.isLoading=!0;let M=await this.$wire.updateTableColumnState(g,C,this.state);this.error=M?.error??void 0,!this.error&&this.$refs.serverState&&(this.$refs.serverState.value=this.getNormalizedState()),this.isLoading=!1})},getServerState(){if(this.$refs.serverState)return[null,void 0].includes(this.$refs.serverState.value)?"":this.$refs.serverState.value.replaceAll('\\"','"')},getNormalizedState(){let L=Alpine.raw(this.state);return[null,void 0].includes(L)?"":L},destroy(){this.unsubscribeLivewireHook?.(),this.select&&(this.select.destroy(),this.select=null)}}}export{Qn as default}; +var Ft = Math.min, + vt = Math.max, + Ht = Math.round; +var st = (n) => ({ x: n, y: n }), + ji = { left: "right", right: "left", bottom: "top", top: "bottom" }, + qi = { start: "end", end: "start" }; +function De(n, t, e) { + return vt(n, Ft(t, e)); +} +function Vt(n, t) { + return typeof n == "function" ? n(t) : n; +} +function wt(n) { + return n.split("-")[0]; +} +function Wt(n) { + return n.split("-")[1]; +} +function Ae(n) { + return n === "x" ? "y" : "x"; +} +function Ce(n) { + return n === "y" ? "height" : "width"; +} +var Ji = new Set(["top", "bottom"]); +function ht(n) { + return Ji.has(wt(n)) ? "y" : "x"; +} +function Le(n) { + return Ae(ht(n)); +} +function Je(n, t, e) { + e === void 0 && (e = !1); + let i = Wt(n), + o = Le(n), + s = Ce(o), + r = + o === "x" + ? i === (e ? "end" : "start") + ? "right" + : "left" + : i === "start" + ? "bottom" + : "top"; + return (t.reference[s] > t.floating[s] && (r = Bt(r)), [r, Bt(r)]); +} +function Qe(n) { + let t = Bt(n); + return [ie(n), t, ie(t)]; +} +function ie(n) { + return n.replace(/start|end/g, (t) => qi[t]); +} +var je = ["left", "right"], + qe = ["right", "left"], + Qi = ["top", "bottom"], + Zi = ["bottom", "top"]; +function tn(n, t, e) { + switch (n) { + case "top": + case "bottom": + return e ? (t ? qe : je) : t ? je : qe; + case "left": + case "right": + return t ? Qi : Zi; + default: + return []; + } +} +function Ze(n, t, e, i) { + let o = Wt(n), + s = tn(wt(n), e === "start", i); + return ( + o && ((s = s.map((r) => r + "-" + o)), t && (s = s.concat(s.map(ie)))), + s + ); +} +function Bt(n) { + return n.replace(/left|right|bottom|top/g, (t) => ji[t]); +} +function en(n) { + return { top: 0, right: 0, bottom: 0, left: 0, ...n }; +} +function ti(n) { + return typeof n != "number" + ? en(n) + : { top: n, right: n, bottom: n, left: n }; +} +function Ot(n) { + let { x: t, y: e, width: i, height: o } = n; + return { + width: i, + height: o, + top: e, + left: t, + right: t + i, + bottom: e + o, + x: t, + y: e, + }; +} +function ei(n, t, e) { + let { reference: i, floating: o } = n, + s = ht(t), + r = Le(t), + a = Ce(r), + l = wt(t), + c = s === "y", + f = i.x + i.width / 2 - o.width / 2, + d = i.y + i.height / 2 - o.height / 2, + p = i[a] / 2 - o[a] / 2, + u; + switch (l) { + case "top": + u = { x: f, y: i.y - o.height }; + break; + case "bottom": + u = { x: f, y: i.y + i.height }; + break; + case "right": + u = { x: i.x + i.width, y: d }; + break; + case "left": + u = { x: i.x - o.width, y: d }; + break; + default: + u = { x: i.x, y: i.y }; + } + switch (Wt(t)) { + case "start": + u[r] -= p * (e && c ? -1 : 1); + break; + case "end": + u[r] += p * (e && c ? -1 : 1); + break; + } + return u; +} +var ii = async (n, t, e) => { + let { + placement: i = "bottom", + strategy: o = "absolute", + middleware: s = [], + platform: r, + } = e, + a = s.filter(Boolean), + l = await (r.isRTL == null ? void 0 : r.isRTL(t)), + c = await r.getElementRects({ reference: n, floating: t, strategy: o }), + { x: f, y: d } = ei(c, i, l), + p = i, + u = {}, + g = 0; + for (let m = 0; m < a.length; m++) { + let { name: S, fn: E } = a[m], + { + x: y, + y: D, + data: A, + reset: C, + } = await E({ + x: f, + y: d, + initialPlacement: i, + placement: p, + strategy: o, + middlewareData: u, + rects: c, + platform: r, + elements: { reference: n, floating: t }, + }); + ((f = y ?? f), + (d = D ?? d), + (u = { ...u, [S]: { ...u[S], ...A } }), + C && + g <= 50 && + (g++, + typeof C == "object" && + (C.placement && (p = C.placement), + C.rects && + (c = + C.rects === !0 + ? await r.getElementRects({ + reference: n, + floating: t, + strategy: o, + }) + : C.rects), + ({ x: f, y: d } = ei(c, p, l))), + (m = -1))); + } + return { x: f, y: d, placement: p, strategy: o, middlewareData: u }; +}; +async function Ie(n, t) { + var e; + t === void 0 && (t = {}); + let { x: i, y: o, platform: s, rects: r, elements: a, strategy: l } = n, + { + boundary: c = "clippingAncestors", + rootBoundary: f = "viewport", + elementContext: d = "floating", + altBoundary: p = !1, + padding: u = 0, + } = Vt(t, n), + g = ti(u), + S = a[p ? (d === "floating" ? "reference" : "floating") : d], + E = Ot( + await s.getClippingRect({ + element: + (e = await (s.isElement == null + ? void 0 + : s.isElement(S))) == null || e + ? S + : S.contextElement || + (await (s.getDocumentElement == null + ? void 0 + : s.getDocumentElement(a.floating))), + boundary: c, + rootBoundary: f, + strategy: l, + }), + ), + y = + d === "floating" + ? { + x: i, + y: o, + width: r.floating.width, + height: r.floating.height, + } + : r.reference, + D = await (s.getOffsetParent == null + ? void 0 + : s.getOffsetParent(a.floating)), + A = (await (s.isElement == null ? void 0 : s.isElement(D))) + ? (await (s.getScale == null ? void 0 : s.getScale(D))) || { + x: 1, + y: 1, + } + : { x: 1, y: 1 }, + C = Ot( + s.convertOffsetParentRelativeRectToViewportRelativeRect + ? await s.convertOffsetParentRelativeRectToViewportRelativeRect( + { elements: a, rect: y, offsetParent: D, strategy: l }, + ) + : y, + ); + return { + top: (E.top - C.top + g.top) / A.y, + bottom: (C.bottom - E.bottom + g.bottom) / A.y, + left: (E.left - C.left + g.left) / A.x, + right: (C.right - E.right + g.right) / A.x, + }; +} +var ni = function (n) { + return ( + n === void 0 && (n = {}), + { + name: "flip", + options: n, + async fn(t) { + var e, i; + let { + placement: o, + middlewareData: s, + rects: r, + initialPlacement: a, + platform: l, + elements: c, + } = t, + { + mainAxis: f = !0, + crossAxis: d = !0, + fallbackPlacements: p, + fallbackStrategy: u = "bestFit", + fallbackAxisSideDirection: g = "none", + flipAlignment: m = !0, + ...S + } = Vt(n, t); + if ((e = s.arrow) != null && e.alignmentOffset) return {}; + let E = wt(o), + y = ht(a), + D = wt(a) === a, + A = await (l.isRTL == null ? void 0 : l.isRTL(c.floating)), + C = p || (D || !m ? [Bt(a)] : Qe(a)), + F = g !== "none"; + !p && F && C.push(...Ze(a, m, g, A)); + let q = [a, ...C], + J = await Ie(t, S), + _ = [], + W = ((i = s.flip) == null ? void 0 : i.overflows) || []; + if ((f && _.push(J[E]), d)) { + let H = Je(o, r, A); + _.push(J[H[0]], J[H[1]]); + } + if ( + ((W = [...W, { placement: o, overflows: _ }]), + !_.every((H) => H <= 0)) + ) { + var L, X; + let H = + (((L = s.flip) == null ? void 0 : L.index) || 0) + + 1, + tt = q[H]; + if ( + tt && + (!(d === "alignment" ? y !== ht(tt) : !1) || + W.every((B) => + ht(B.placement) === y ? B.overflows[0] > 0 : !0, + )) + ) + return { + data: { index: H, overflows: W }, + reset: { placement: tt }, + }; + let z = + (X = W.filter((Y) => Y.overflows[0] <= 0).sort( + (Y, B) => Y.overflows[1] - B.overflows[1], + )[0]) == null + ? void 0 + : X.placement; + if (!z) + switch (u) { + case "bestFit": { + var M; + let Y = + (M = W.filter((B) => { + if (F) { + let et = ht(B.placement); + return et === y || et === "y"; + } + return !0; + }) + .map((B) => [ + B.placement, + B.overflows + .filter((et) => et > 0) + .reduce((et, ee) => et + ee, 0), + ]) + .sort((B, et) => B[1] - et[1])[0]) == + null + ? void 0 + : M[0]; + Y && (z = Y); + break; + } + case "initialPlacement": + z = a; + break; + } + if (o !== z) return { reset: { placement: z } }; + } + return {}; + }, + } + ); +}; +var nn = new Set(["left", "top"]); +async function on(n, t) { + let { placement: e, platform: i, elements: o } = n, + s = await (i.isRTL == null ? void 0 : i.isRTL(o.floating)), + r = wt(e), + a = Wt(e), + l = ht(e) === "y", + c = nn.has(r) ? -1 : 1, + f = s && l ? -1 : 1, + d = Vt(t, n), + { + mainAxis: p, + crossAxis: u, + alignmentAxis: g, + } = typeof d == "number" + ? { mainAxis: d, crossAxis: 0, alignmentAxis: null } + : { + mainAxis: d.mainAxis || 0, + crossAxis: d.crossAxis || 0, + alignmentAxis: d.alignmentAxis, + }; + return ( + a && typeof g == "number" && (u = a === "end" ? g * -1 : g), + l ? { x: u * f, y: p * c } : { x: p * c, y: u * f } + ); +} +var oi = function (n) { + return ( + n === void 0 && (n = 0), + { + name: "offset", + options: n, + async fn(t) { + var e, i; + let { x: o, y: s, placement: r, middlewareData: a } = t, + l = await on(t, n); + return r === + ((e = a.offset) == null ? void 0 : e.placement) && + (i = a.arrow) != null && + i.alignmentOffset + ? {} + : { + x: o + l.x, + y: s + l.y, + data: { ...l, placement: r }, + }; + }, + } + ); + }, + si = function (n) { + return ( + n === void 0 && (n = {}), + { + name: "shift", + options: n, + async fn(t) { + let { x: e, y: i, placement: o } = t, + { + mainAxis: s = !0, + crossAxis: r = !1, + limiter: a = { + fn: (S) => { + let { x: E, y } = S; + return { x: E, y }; + }, + }, + ...l + } = Vt(n, t), + c = { x: e, y: i }, + f = await Ie(t, l), + d = ht(wt(o)), + p = Ae(d), + u = c[p], + g = c[d]; + if (s) { + let S = p === "y" ? "top" : "left", + E = p === "y" ? "bottom" : "right", + y = u + f[S], + D = u - f[E]; + u = De(y, u, D); + } + if (r) { + let S = d === "y" ? "top" : "left", + E = d === "y" ? "bottom" : "right", + y = g + f[S], + D = g - f[E]; + g = De(y, g, D); + } + let m = a.fn({ ...t, [p]: u, [d]: g }); + return { + ...m, + data: { + x: m.x - e, + y: m.y - i, + enabled: { [p]: s, [d]: r }, + }, + }; + }, + } + ); + }; +function oe() { + return typeof window < "u"; +} +function Et(n) { + return ai(n) ? (n.nodeName || "").toLowerCase() : "#document"; +} +function U(n) { + var t; + return ( + (n == null || (t = n.ownerDocument) == null ? void 0 : t.defaultView) || + window + ); +} +function ct(n) { + var t; + return (t = (ai(n) ? n.ownerDocument : n.document) || window.document) == + null + ? void 0 + : t.documentElement; +} +function ai(n) { + return oe() ? n instanceof Node || n instanceof U(n).Node : !1; +} +function it(n) { + return oe() ? n instanceof Element || n instanceof U(n).Element : !1; +} +function rt(n) { + return oe() + ? n instanceof HTMLElement || n instanceof U(n).HTMLElement + : !1; +} +function ri(n) { + return !oe() || typeof ShadowRoot > "u" + ? !1 + : n instanceof ShadowRoot || n instanceof U(n).ShadowRoot; +} +var sn = new Set(["inline", "contents"]); +function It(n) { + let { overflow: t, overflowX: e, overflowY: i, display: o } = nt(n); + return /auto|scroll|overlay|hidden|clip/.test(t + i + e) && !sn.has(o); +} +var rn = new Set(["table", "td", "th"]); +function li(n) { + return rn.has(Et(n)); +} +var an = [":popover-open", ":modal"]; +function zt(n) { + return an.some((t) => { + try { + return n.matches(t); + } catch { + return !1; + } + }); +} +var ln = ["transform", "translate", "scale", "rotate", "perspective"], + cn = ["transform", "translate", "scale", "rotate", "perspective", "filter"], + dn = ["paint", "layout", "strict", "content"]; +function se(n) { + let t = re(), + e = it(n) ? nt(n) : n; + return ( + ln.some((i) => (e[i] ? e[i] !== "none" : !1)) || + (e.containerType ? e.containerType !== "normal" : !1) || + (!t && (e.backdropFilter ? e.backdropFilter !== "none" : !1)) || + (!t && (e.filter ? e.filter !== "none" : !1)) || + cn.some((i) => (e.willChange || "").includes(i)) || + dn.some((i) => (e.contain || "").includes(i)) + ); +} +function ci(n) { + let t = ut(n); + for (; rt(t) && !Dt(t); ) { + if (se(t)) return t; + if (zt(t)) return null; + t = ut(t); + } + return null; +} +function re() { + return typeof CSS > "u" || !CSS.supports + ? !1 + : CSS.supports("-webkit-backdrop-filter", "none"); +} +var fn = new Set(["html", "body", "#document"]); +function Dt(n) { + return fn.has(Et(n)); +} +function nt(n) { + return U(n).getComputedStyle(n); +} +function $t(n) { + return it(n) + ? { scrollLeft: n.scrollLeft, scrollTop: n.scrollTop } + : { scrollLeft: n.scrollX, scrollTop: n.scrollY }; +} +function ut(n) { + if (Et(n) === "html") return n; + let t = n.assignedSlot || n.parentNode || (ri(n) && n.host) || ct(n); + return ri(t) ? t.host : t; +} +function di(n) { + let t = ut(n); + return Dt(t) + ? n.ownerDocument + ? n.ownerDocument.body + : n.body + : rt(t) && It(t) + ? t + : di(t); +} +function ne(n, t, e) { + var i; + (t === void 0 && (t = []), e === void 0 && (e = !0)); + let o = di(n), + s = o === ((i = n.ownerDocument) == null ? void 0 : i.body), + r = U(o); + if (s) { + let a = ae(r); + return t.concat( + r, + r.visualViewport || [], + It(o) ? o : [], + a && e ? ne(a) : [], + ); + } + return t.concat(o, ne(o, [], e)); +} +function ae(n) { + return n.parent && Object.getPrototypeOf(n.parent) ? n.frameElement : null; +} +function pi(n) { + let t = nt(n), + e = parseFloat(t.width) || 0, + i = parseFloat(t.height) || 0, + o = rt(n), + s = o ? n.offsetWidth : e, + r = o ? n.offsetHeight : i, + a = Ht(e) !== s || Ht(i) !== r; + return (a && ((e = s), (i = r)), { width: e, height: i, $: a }); +} +function gi(n) { + return it(n) ? n : n.contextElement; +} +function Tt(n) { + let t = gi(n); + if (!rt(t)) return st(1); + let e = t.getBoundingClientRect(), + { width: i, height: o, $: s } = pi(t), + r = (s ? Ht(e.width) : e.width) / i, + a = (s ? Ht(e.height) : e.height) / o; + return ( + (!r || !Number.isFinite(r)) && (r = 1), + (!a || !Number.isFinite(a)) && (a = 1), + { x: r, y: a } + ); +} +var hn = st(0); +function mi(n) { + let t = U(n); + return !re() || !t.visualViewport + ? hn + : { x: t.visualViewport.offsetLeft, y: t.visualViewport.offsetTop }; +} +function un(n, t, e) { + return (t === void 0 && (t = !1), !e || (t && e !== U(n)) ? !1 : t); +} +function Xt(n, t, e, i) { + (t === void 0 && (t = !1), e === void 0 && (e = !1)); + let o = n.getBoundingClientRect(), + s = gi(n), + r = st(1); + t && (i ? it(i) && (r = Tt(i)) : (r = Tt(n))); + let a = un(s, e, i) ? mi(s) : st(0), + l = (o.left + a.x) / r.x, + c = (o.top + a.y) / r.y, + f = o.width / r.x, + d = o.height / r.y; + if (s) { + let p = U(s), + u = i && it(i) ? U(i) : i, + g = p, + m = ae(g); + for (; m && i && u !== g; ) { + let S = Tt(m), + E = m.getBoundingClientRect(), + y = nt(m), + D = E.left + (m.clientLeft + parseFloat(y.paddingLeft)) * S.x, + A = E.top + (m.clientTop + parseFloat(y.paddingTop)) * S.y; + ((l *= S.x), + (c *= S.y), + (f *= S.x), + (d *= S.y), + (l += D), + (c += A), + (g = U(m)), + (m = ae(g))); + } + } + return Ot({ width: f, height: d, x: l, y: c }); +} +function le(n, t) { + let e = $t(n).scrollLeft; + return t ? t.left + e : Xt(ct(n)).left + e; +} +function bi(n, t) { + let e = n.getBoundingClientRect(), + i = e.left + t.scrollLeft - le(n, e), + o = e.top + t.scrollTop; + return { x: i, y: o }; +} +function pn(n) { + let { elements: t, rect: e, offsetParent: i, strategy: o } = n, + s = o === "fixed", + r = ct(i), + a = t ? zt(t.floating) : !1; + if (i === r || (a && s)) return e; + let l = { scrollLeft: 0, scrollTop: 0 }, + c = st(1), + f = st(0), + d = rt(i); + if ( + (d || (!d && !s)) && + ((Et(i) !== "body" || It(r)) && (l = $t(i)), rt(i)) + ) { + let u = Xt(i); + ((c = Tt(i)), (f.x = u.x + i.clientLeft), (f.y = u.y + i.clientTop)); + } + let p = r && !d && !s ? bi(r, l) : st(0); + return { + width: e.width * c.x, + height: e.height * c.y, + x: e.x * c.x - l.scrollLeft * c.x + f.x + p.x, + y: e.y * c.y - l.scrollTop * c.y + f.y + p.y, + }; +} +function gn(n) { + return Array.from(n.getClientRects()); +} +function mn(n) { + let t = ct(n), + e = $t(n), + i = n.ownerDocument.body, + o = vt(t.scrollWidth, t.clientWidth, i.scrollWidth, i.clientWidth), + s = vt(t.scrollHeight, t.clientHeight, i.scrollHeight, i.clientHeight), + r = -e.scrollLeft + le(n), + a = -e.scrollTop; + return ( + nt(i).direction === "rtl" && + (r += vt(t.clientWidth, i.clientWidth) - o), + { width: o, height: s, x: r, y: a } + ); +} +var fi = 25; +function bn(n, t) { + let e = U(n), + i = ct(n), + o = e.visualViewport, + s = i.clientWidth, + r = i.clientHeight, + a = 0, + l = 0; + if (o) { + ((s = o.width), (r = o.height)); + let f = re(); + (!f || (f && t === "fixed")) && ((a = o.offsetLeft), (l = o.offsetTop)); + } + let c = le(i); + if (c <= 0) { + let f = i.ownerDocument, + d = f.body, + p = getComputedStyle(d), + u = + (f.compatMode === "CSS1Compat" && + parseFloat(p.marginLeft) + parseFloat(p.marginRight)) || + 0, + g = Math.abs(i.clientWidth - d.clientWidth - u); + g <= fi && (s -= g); + } else c <= fi && (s += c); + return { width: s, height: r, x: a, y: l }; +} +var vn = new Set(["absolute", "fixed"]); +function wn(n, t) { + let e = Xt(n, !0, t === "fixed"), + i = e.top + n.clientTop, + o = e.left + n.clientLeft, + s = rt(n) ? Tt(n) : st(1), + r = n.clientWidth * s.x, + a = n.clientHeight * s.y, + l = o * s.x, + c = i * s.y; + return { width: r, height: a, x: l, y: c }; +} +function hi(n, t, e) { + let i; + if (t === "viewport") i = bn(n, e); + else if (t === "document") i = mn(ct(n)); + else if (it(t)) i = wn(t, e); + else { + let o = mi(n); + i = { x: t.x - o.x, y: t.y - o.y, width: t.width, height: t.height }; + } + return Ot(i); +} +function vi(n, t) { + let e = ut(n); + return e === t || !it(e) || Dt(e) + ? !1 + : nt(e).position === "fixed" || vi(e, t); +} +function yn(n, t) { + let e = t.get(n); + if (e) return e; + let i = ne(n, [], !1).filter((a) => it(a) && Et(a) !== "body"), + o = null, + s = nt(n).position === "fixed", + r = s ? ut(n) : n; + for (; it(r) && !Dt(r); ) { + let a = nt(r), + l = se(r); + (!l && a.position === "fixed" && (o = null), + ( + s + ? !l && !o + : (!l && + a.position === "static" && + !!o && + vn.has(o.position)) || + (It(r) && !l && vi(n, r)) + ) + ? (i = i.filter((f) => f !== r)) + : (o = a), + (r = ut(r))); + } + return (t.set(n, i), i); +} +function Sn(n) { + let { element: t, boundary: e, rootBoundary: i, strategy: o } = n, + r = [ + ...(e === "clippingAncestors" + ? zt(t) + ? [] + : yn(t, this._c) + : [].concat(e)), + i, + ], + a = r[0], + l = r.reduce( + (c, f) => { + let d = hi(t, f, o); + return ( + (c.top = vt(d.top, c.top)), + (c.right = Ft(d.right, c.right)), + (c.bottom = Ft(d.bottom, c.bottom)), + (c.left = vt(d.left, c.left)), + c + ); + }, + hi(t, a, o), + ); + return { + width: l.right - l.left, + height: l.bottom - l.top, + x: l.left, + y: l.top, + }; +} +function xn(n) { + let { width: t, height: e } = pi(n); + return { width: t, height: e }; +} +function On(n, t, e) { + let i = rt(t), + o = ct(t), + s = e === "fixed", + r = Xt(n, !0, s, t), + a = { scrollLeft: 0, scrollTop: 0 }, + l = st(0); + function c() { + l.x = le(o); + } + if (i || (!i && !s)) + if (((Et(t) !== "body" || It(o)) && (a = $t(t)), i)) { + let u = Xt(t, !0, s, t); + ((l.x = u.x + t.clientLeft), (l.y = u.y + t.clientTop)); + } else o && c(); + s && !i && o && c(); + let f = o && !i && !s ? bi(o, a) : st(0), + d = r.left + a.scrollLeft - l.x - f.x, + p = r.top + a.scrollTop - l.y - f.y; + return { x: d, y: p, width: r.width, height: r.height }; +} +function Te(n) { + return nt(n).position === "static"; +} +function ui(n, t) { + if (!rt(n) || nt(n).position === "fixed") return null; + if (t) return t(n); + let e = n.offsetParent; + return (ct(n) === e && (e = e.ownerDocument.body), e); +} +function wi(n, t) { + let e = U(n); + if (zt(n)) return e; + if (!rt(n)) { + let o = ut(n); + for (; o && !Dt(o); ) { + if (it(o) && !Te(o)) return o; + o = ut(o); + } + return e; + } + let i = ui(n, t); + for (; i && li(i) && Te(i); ) i = ui(i, t); + return i && Dt(i) && Te(i) && !se(i) ? e : i || ci(n) || e; +} +var En = async function (n) { + let t = this.getOffsetParent || wi, + e = this.getDimensions, + i = await e(n.floating); + return { + reference: On(n.reference, await t(n.floating), n.strategy), + floating: { x: 0, y: 0, width: i.width, height: i.height }, + }; +}; +function Dn(n) { + return nt(n).direction === "rtl"; +} +var An = { + convertOffsetParentRelativeRectToViewportRelativeRect: pn, + getDocumentElement: ct, + getClippingRect: Sn, + getOffsetParent: wi, + getElementRects: En, + getClientRects: gn, + getDimensions: xn, + getScale: Tt, + isElement: it, + isRTL: Dn, +}; +var yi = oi; +var Si = si, + xi = ni; +var Oi = (n, t, e) => { + let i = new Map(), + o = { platform: An, ...e }, + s = { ...o.platform, _c: i }; + return ii(n, t, { ...o, platform: s }); +}; +function Ei(n, t) { + var e = Object.keys(n); + if (Object.getOwnPropertySymbols) { + var i = Object.getOwnPropertySymbols(n); + (t && + (i = i.filter(function (o) { + return Object.getOwnPropertyDescriptor(n, o).enumerable; + })), + e.push.apply(e, i)); + } + return e; +} +function ft(n) { + for (var t = 1; t < arguments.length; t++) { + var e = arguments[t] != null ? arguments[t] : {}; + t % 2 + ? Ei(Object(e), !0).forEach(function (i) { + Cn(n, i, e[i]); + }) + : Object.getOwnPropertyDescriptors + ? Object.defineProperties(n, Object.getOwnPropertyDescriptors(e)) + : Ei(Object(e)).forEach(function (i) { + Object.defineProperty( + n, + i, + Object.getOwnPropertyDescriptor(e, i), + ); + }); + } + return n; +} +function ue(n) { + "@babel/helpers - typeof"; + return ( + typeof Symbol == "function" && typeof Symbol.iterator == "symbol" + ? (ue = function (t) { + return typeof t; + }) + : (ue = function (t) { + return t && + typeof Symbol == "function" && + t.constructor === Symbol && + t !== Symbol.prototype + ? "symbol" + : typeof t; + }), + ue(n) + ); +} +function Cn(n, t, e) { + return ( + t in n + ? Object.defineProperty(n, t, { + value: e, + enumerable: !0, + configurable: !0, + writable: !0, + }) + : (n[t] = e), + n + ); +} +function gt() { + return ( + (gt = + Object.assign || + function (n) { + for (var t = 1; t < arguments.length; t++) { + var e = arguments[t]; + for (var i in e) + Object.prototype.hasOwnProperty.call(e, i) && + (n[i] = e[i]); + } + return n; + }), + gt.apply(this, arguments) + ); +} +function Ln(n, t) { + if (n == null) return {}; + var e = {}, + i = Object.keys(n), + o, + s; + for (s = 0; s < i.length; s++) + ((o = i[s]), !(t.indexOf(o) >= 0) && (e[o] = n[o])); + return e; +} +function In(n, t) { + if (n == null) return {}; + var e = Ln(n, t), + i, + o; + if (Object.getOwnPropertySymbols) { + var s = Object.getOwnPropertySymbols(n); + for (o = 0; o < s.length; o++) + ((i = s[o]), + !(t.indexOf(i) >= 0) && + Object.prototype.propertyIsEnumerable.call(n, i) && + (e[i] = n[i])); + } + return e; +} +var Tn = "1.15.6"; +function pt(n) { + if (typeof window < "u" && window.navigator) + return !!navigator.userAgent.match(n); +} +var mt = pt(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i), + Zt = pt(/Edge/i), + Di = pt(/firefox/i), + Gt = pt(/safari/i) && !pt(/chrome/i) && !pt(/android/i), + Xe = pt(/iP(ad|od|hone)/i), + Pi = pt(/chrome/i) && pt(/android/i), + Mi = { capture: !1, passive: !1 }; +function O(n, t, e) { + n.addEventListener(t, e, !mt && Mi); +} +function x(n, t, e) { + n.removeEventListener(t, e, !mt && Mi); +} +function ve(n, t) { + if (t) { + if ((t[0] === ">" && (t = t.substring(1)), n)) + try { + if (n.matches) return n.matches(t); + if (n.msMatchesSelector) return n.msMatchesSelector(t); + if (n.webkitMatchesSelector) return n.webkitMatchesSelector(t); + } catch { + return !1; + } + return !1; + } +} +function Ni(n) { + return n.host && n !== document && n.host.nodeType ? n.host : n.parentNode; +} +function lt(n, t, e, i) { + if (n) { + e = e || document; + do { + if ( + (t != null && + (t[0] === ">" + ? n.parentNode === e && ve(n, t) + : ve(n, t))) || + (i && n === e) + ) + return n; + if (n === e) break; + } while ((n = Ni(n))); + } + return null; +} +var Ai = /\s+/g; +function Q(n, t, e) { + if (n && t) + if (n.classList) n.classList[e ? "add" : "remove"](t); + else { + var i = (" " + n.className + " ") + .replace(Ai, " ") + .replace(" " + t + " ", " "); + n.className = (i + (e ? " " + t : "")).replace(Ai, " "); + } +} +function b(n, t, e) { + var i = n && n.style; + if (i) { + if (e === void 0) + return ( + document.defaultView && document.defaultView.getComputedStyle + ? (e = document.defaultView.getComputedStyle(n, "")) + : n.currentStyle && (e = n.currentStyle), + t === void 0 ? e : e[t] + ); + (!(t in i) && t.indexOf("webkit") === -1 && (t = "-webkit-" + t), + (i[t] = e + (typeof e == "string" ? "" : "px"))); + } +} +function Nt(n, t) { + var e = ""; + if (typeof n == "string") e = n; + else + do { + var i = b(n, "transform"); + i && i !== "none" && (e = i + " " + e); + } while (!t && (n = n.parentNode)); + var o = + window.DOMMatrix || + window.WebKitCSSMatrix || + window.CSSMatrix || + window.MSCSSMatrix; + return o && new o(e); +} +function ki(n, t, e) { + if (n) { + var i = n.getElementsByTagName(t), + o = 0, + s = i.length; + if (e) for (; o < s; o++) e(i[o], o); + return i; + } + return []; +} +function dt() { + var n = document.scrollingElement; + return n || document.documentElement; +} +function k(n, t, e, i, o) { + if (!(!n.getBoundingClientRect && n !== window)) { + var s, r, a, l, c, f, d; + if ( + (n !== window && n.parentNode && n !== dt() + ? ((s = n.getBoundingClientRect()), + (r = s.top), + (a = s.left), + (l = s.bottom), + (c = s.right), + (f = s.height), + (d = s.width)) + : ((r = 0), + (a = 0), + (l = window.innerHeight), + (c = window.innerWidth), + (f = window.innerHeight), + (d = window.innerWidth)), + (t || e) && n !== window && ((o = o || n.parentNode), !mt)) + ) + do + if ( + o && + o.getBoundingClientRect && + (b(o, "transform") !== "none" || + (e && b(o, "position") !== "static")) + ) { + var p = o.getBoundingClientRect(); + ((r -= p.top + parseInt(b(o, "border-top-width"))), + (a -= p.left + parseInt(b(o, "border-left-width"))), + (l = r + s.height), + (c = a + s.width)); + break; + } + while ((o = o.parentNode)); + if (i && n !== window) { + var u = Nt(o || n), + g = u && u.a, + m = u && u.d; + u && + ((r /= m), + (a /= g), + (d /= g), + (f /= m), + (l = r + f), + (c = a + d)); + } + return { top: r, left: a, bottom: l, right: c, width: d, height: f }; + } +} +function Ci(n, t, e) { + for (var i = xt(n, !0), o = k(n)[t]; i; ) { + var s = k(i)[e], + r = void 0; + if ((e === "top" || e === "left" ? (r = o >= s) : (r = o <= s), !r)) + return i; + if (i === dt()) break; + i = xt(i, !1); + } + return !1; +} +function kt(n, t, e, i) { + for (var o = 0, s = 0, r = n.children; s < r.length; ) { + if ( + r[s].style.display !== "none" && + r[s] !== v.ghost && + (i || r[s] !== v.dragged) && + lt(r[s], e.draggable, n, !1) + ) { + if (o === t) return r[s]; + o++; + } + s++; + } + return null; +} +function Ke(n, t) { + for ( + var e = n.lastElementChild; + e && (e === v.ghost || b(e, "display") === "none" || (t && !ve(e, t))); + ) + e = e.previousElementSibling; + return e || null; +} +function ot(n, t) { + var e = 0; + if (!n || !n.parentNode) return -1; + for (; (n = n.previousElementSibling); ) + n.nodeName.toUpperCase() !== "TEMPLATE" && + n !== v.clone && + (!t || ve(n, t)) && + e++; + return e; +} +function Li(n) { + var t = 0, + e = 0, + i = dt(); + if (n) + do { + var o = Nt(n), + s = o.a, + r = o.d; + ((t += n.scrollLeft * s), (e += n.scrollTop * r)); + } while (n !== i && (n = n.parentNode)); + return [t, e]; +} +function _n(n, t) { + for (var e in n) + if (n.hasOwnProperty(e)) { + for (var i in t) + if (t.hasOwnProperty(i) && t[i] === n[e][i]) return Number(e); + } + return -1; +} +function xt(n, t) { + if (!n || !n.getBoundingClientRect) return dt(); + var e = n, + i = !1; + do + if (e.clientWidth < e.scrollWidth || e.clientHeight < e.scrollHeight) { + var o = b(e); + if ( + (e.clientWidth < e.scrollWidth && + (o.overflowX == "auto" || o.overflowX == "scroll")) || + (e.clientHeight < e.scrollHeight && + (o.overflowY == "auto" || o.overflowY == "scroll")) + ) { + if (!e.getBoundingClientRect || e === document.body) + return dt(); + if (i || t) return e; + i = !0; + } + } + while ((e = e.parentNode)); + return dt(); +} +function Rn(n, t) { + if (n && t) for (var e in t) t.hasOwnProperty(e) && (n[e] = t[e]); + return n; +} +function _e(n, t) { + return ( + Math.round(n.top) === Math.round(t.top) && + Math.round(n.left) === Math.round(t.left) && + Math.round(n.height) === Math.round(t.height) && + Math.round(n.width) === Math.round(t.width) + ); +} +var jt; +function Bi(n, t) { + return function () { + if (!jt) { + var e = arguments, + i = this; + (e.length === 1 ? n.call(i, e[0]) : n.apply(i, e), + (jt = setTimeout(function () { + jt = void 0; + }, t))); + } + }; +} +function Pn() { + (clearTimeout(jt), (jt = void 0)); +} +function Fi(n, t, e) { + ((n.scrollLeft += t), (n.scrollTop += e)); +} +function Hi(n) { + var t = window.Polymer, + e = window.jQuery || window.Zepto; + return t && t.dom + ? t.dom(n).cloneNode(!0) + : e + ? e(n).clone(!0)[0] + : n.cloneNode(!0); +} +function Vi(n, t, e) { + var i = {}; + return ( + Array.from(n.children).forEach(function (o) { + var s, r, a, l; + if (!(!lt(o, t.draggable, n, !1) || o.animated || o === e)) { + var c = k(o); + ((i.left = Math.min( + (s = i.left) !== null && s !== void 0 ? s : 1 / 0, + c.left, + )), + (i.top = Math.min( + (r = i.top) !== null && r !== void 0 ? r : 1 / 0, + c.top, + )), + (i.right = Math.max( + (a = i.right) !== null && a !== void 0 ? a : -1 / 0, + c.right, + )), + (i.bottom = Math.max( + (l = i.bottom) !== null && l !== void 0 ? l : -1 / 0, + c.bottom, + ))); + } + }), + (i.width = i.right - i.left), + (i.height = i.bottom - i.top), + (i.x = i.left), + (i.y = i.top), + i + ); +} +var j = "Sortable" + new Date().getTime(); +function Mn() { + var n = [], + t; + return { + captureAnimationState: function () { + if (((n = []), !!this.options.animation)) { + var i = [].slice.call(this.el.children); + i.forEach(function (o) { + if (!(b(o, "display") === "none" || o === v.ghost)) { + n.push({ target: o, rect: k(o) }); + var s = ft({}, n[n.length - 1].rect); + if (o.thisAnimationDuration) { + var r = Nt(o, !0); + r && ((s.top -= r.f), (s.left -= r.e)); + } + o.fromRect = s; + } + }); + } + }, + addAnimationState: function (i) { + n.push(i); + }, + removeAnimationState: function (i) { + n.splice(_n(n, { target: i }), 1); + }, + animateAll: function (i) { + var o = this; + if (!this.options.animation) { + (clearTimeout(t), typeof i == "function" && i()); + return; + } + var s = !1, + r = 0; + (n.forEach(function (a) { + var l = 0, + c = a.target, + f = c.fromRect, + d = k(c), + p = c.prevFromRect, + u = c.prevToRect, + g = a.rect, + m = Nt(c, !0); + (m && ((d.top -= m.f), (d.left -= m.e)), + (c.toRect = d), + c.thisAnimationDuration && + _e(p, d) && + !_e(f, d) && + (g.top - d.top) / (g.left - d.left) === + (f.top - d.top) / (f.left - d.left) && + (l = kn(g, p, u, o.options)), + _e(d, f) || + ((c.prevFromRect = f), + (c.prevToRect = d), + l || (l = o.options.animation), + o.animate(c, g, d, l)), + l && + ((s = !0), + (r = Math.max(r, l)), + clearTimeout(c.animationResetTimer), + (c.animationResetTimer = setTimeout(function () { + ((c.animationTime = 0), + (c.prevFromRect = null), + (c.fromRect = null), + (c.prevToRect = null), + (c.thisAnimationDuration = null)); + }, l)), + (c.thisAnimationDuration = l))); + }), + clearTimeout(t), + s + ? (t = setTimeout(function () { + typeof i == "function" && i(); + }, r)) + : typeof i == "function" && i(), + (n = [])); + }, + animate: function (i, o, s, r) { + if (r) { + (b(i, "transition", ""), b(i, "transform", "")); + var a = Nt(this.el), + l = a && a.a, + c = a && a.d, + f = (o.left - s.left) / (l || 1), + d = (o.top - s.top) / (c || 1); + ((i.animatingX = !!f), + (i.animatingY = !!d), + b(i, "transform", "translate3d(" + f + "px," + d + "px,0)"), + (this.forRepaintDummy = Nn(i)), + b( + i, + "transition", + "transform " + + r + + "ms" + + (this.options.easing + ? " " + this.options.easing + : ""), + ), + b(i, "transform", "translate3d(0,0,0)"), + typeof i.animated == "number" && clearTimeout(i.animated), + (i.animated = setTimeout(function () { + (b(i, "transition", ""), + b(i, "transform", ""), + (i.animated = !1), + (i.animatingX = !1), + (i.animatingY = !1)); + }, r))); + } + }, + }; +} +function Nn(n) { + return n.offsetWidth; +} +function kn(n, t, e, i) { + return ( + (Math.sqrt(Math.pow(t.top - n.top, 2) + Math.pow(t.left - n.left, 2)) / + Math.sqrt( + Math.pow(t.top - e.top, 2) + Math.pow(t.left - e.left, 2), + )) * + i.animation + ); +} +var _t = [], + Re = { initializeByDefault: !0 }, + te = { + mount: function (t) { + for (var e in Re) + Re.hasOwnProperty(e) && !(e in t) && (t[e] = Re[e]); + (_t.forEach(function (i) { + if (i.pluginName === t.pluginName) + throw "Sortable: Cannot mount plugin ".concat( + t.pluginName, + " more than once", + ); + }), + _t.push(t)); + }, + pluginEvent: function (t, e, i) { + var o = this; + ((this.eventCanceled = !1), + (i.cancel = function () { + o.eventCanceled = !0; + })); + var s = t + "Global"; + _t.forEach(function (r) { + e[r.pluginName] && + (e[r.pluginName][s] && + e[r.pluginName][s](ft({ sortable: e }, i)), + e.options[r.pluginName] && + e[r.pluginName][t] && + e[r.pluginName][t](ft({ sortable: e }, i))); + }); + }, + initializePlugins: function (t, e, i, o) { + _t.forEach(function (a) { + var l = a.pluginName; + if (!(!t.options[l] && !a.initializeByDefault)) { + var c = new a(t, e, t.options); + ((c.sortable = t), + (c.options = t.options), + (t[l] = c), + gt(i, c.defaults)); + } + }); + for (var s in t.options) + if (t.options.hasOwnProperty(s)) { + var r = this.modifyOption(t, s, t.options[s]); + typeof r < "u" && (t.options[s] = r); + } + }, + getEventProperties: function (t, e) { + var i = {}; + return ( + _t.forEach(function (o) { + typeof o.eventProperties == "function" && + gt(i, o.eventProperties.call(e[o.pluginName], t)); + }), + i + ); + }, + modifyOption: function (t, e, i) { + var o; + return ( + _t.forEach(function (s) { + t[s.pluginName] && + s.optionListeners && + typeof s.optionListeners[e] == "function" && + (o = s.optionListeners[e].call(t[s.pluginName], i)); + }), + o + ); + }, + }; +function Bn(n) { + var t = n.sortable, + e = n.rootEl, + i = n.name, + o = n.targetEl, + s = n.cloneEl, + r = n.toEl, + a = n.fromEl, + l = n.oldIndex, + c = n.newIndex, + f = n.oldDraggableIndex, + d = n.newDraggableIndex, + p = n.originalEvent, + u = n.putSortable, + g = n.extraEventProperties; + if (((t = t || (e && e[j])), !!t)) { + var m, + S = t.options, + E = "on" + i.charAt(0).toUpperCase() + i.substr(1); + (window.CustomEvent && !mt && !Zt + ? (m = new CustomEvent(i, { bubbles: !0, cancelable: !0 })) + : ((m = document.createEvent("Event")), m.initEvent(i, !0, !0)), + (m.to = r || e), + (m.from = a || e), + (m.item = o || e), + (m.clone = s), + (m.oldIndex = l), + (m.newIndex = c), + (m.oldDraggableIndex = f), + (m.newDraggableIndex = d), + (m.originalEvent = p), + (m.pullMode = u ? u.lastPutMode : void 0)); + var y = ft(ft({}, g), te.getEventProperties(i, t)); + for (var D in y) m[D] = y[D]; + (e && e.dispatchEvent(m), S[E] && S[E].call(t, m)); + } +} +var Fn = ["evt"], + G = function (t, e) { + var i = + arguments.length > 2 && arguments[2] !== void 0 + ? arguments[2] + : {}, + o = i.evt, + s = In(i, Fn); + te.pluginEvent.bind(v)( + t, + e, + ft( + { + dragEl: h, + parentEl: R, + ghostEl: w, + rootEl: I, + nextEl: Lt, + lastDownEl: pe, + cloneEl: T, + cloneHidden: St, + dragStarted: Kt, + putSortable: V, + activeSortable: v.active, + originalEvent: o, + oldIndex: Mt, + oldDraggableIndex: qt, + newIndex: Z, + newDraggableIndex: yt, + hideGhostForTarget: Xi, + unhideGhostForTarget: Ki, + cloneNowHidden: function () { + St = !0; + }, + cloneNowShown: function () { + St = !1; + }, + dispatchSortableEvent: function (a) { + K({ sortable: e, name: a, originalEvent: o }); + }, + }, + s, + ), + ); + }; +function K(n) { + Bn( + ft( + { + putSortable: V, + cloneEl: T, + targetEl: h, + rootEl: I, + oldIndex: Mt, + oldDraggableIndex: qt, + newIndex: Z, + newDraggableIndex: yt, + }, + n, + ), + ); +} +var h, + R, + w, + I, + Lt, + pe, + T, + St, + Mt, + Z, + qt, + yt, + ce, + V, + Pt = !1, + we = !1, + ye = [], + At, + at, + Pe, + Me, + Ii, + Ti, + Kt, + Rt, + Jt, + Qt = !1, + de = !1, + ge, + $, + Ne = [], + Ve = !1, + Se = [], + Oe = typeof document < "u", + fe = Xe, + _i = Zt || mt ? "cssFloat" : "float", + Hn = Oe && !Pi && !Xe && "draggable" in document.createElement("div"), + Wi = (function () { + if (Oe) { + if (mt) return !1; + var n = document.createElement("x"); + return ( + (n.style.cssText = "pointer-events:auto"), + n.style.pointerEvents === "auto" + ); + } + })(), + zi = function (t, e) { + var i = b(t), + o = + parseInt(i.width) - + parseInt(i.paddingLeft) - + parseInt(i.paddingRight) - + parseInt(i.borderLeftWidth) - + parseInt(i.borderRightWidth), + s = kt(t, 0, e), + r = kt(t, 1, e), + a = s && b(s), + l = r && b(r), + c = + a && + parseInt(a.marginLeft) + parseInt(a.marginRight) + k(s).width, + f = + l && + parseInt(l.marginLeft) + parseInt(l.marginRight) + k(r).width; + if (i.display === "flex") + return i.flexDirection === "column" || + i.flexDirection === "column-reverse" + ? "vertical" + : "horizontal"; + if (i.display === "grid") + return i.gridTemplateColumns.split(" ").length <= 1 + ? "vertical" + : "horizontal"; + if (s && a.float && a.float !== "none") { + var d = a.float === "left" ? "left" : "right"; + return r && (l.clear === "both" || l.clear === d) + ? "vertical" + : "horizontal"; + } + return s && + (a.display === "block" || + a.display === "flex" || + a.display === "table" || + a.display === "grid" || + (c >= o && i[_i] === "none") || + (r && i[_i] === "none" && c + f > o)) + ? "vertical" + : "horizontal"; + }, + Vn = function (t, e, i) { + var o = i ? t.left : t.top, + s = i ? t.right : t.bottom, + r = i ? t.width : t.height, + a = i ? e.left : e.top, + l = i ? e.right : e.bottom, + c = i ? e.width : e.height; + return o === a || s === l || o + r / 2 === a + c / 2; + }, + Wn = function (t, e) { + var i; + return ( + ye.some(function (o) { + var s = o[j].options.emptyInsertThreshold; + if (!(!s || Ke(o))) { + var r = k(o), + a = t >= r.left - s && t <= r.right + s, + l = e >= r.top - s && e <= r.bottom + s; + if (a && l) return (i = o); + } + }), + i + ); + }, + $i = function (t) { + function e(s, r) { + return function (a, l, c, f) { + var d = + a.options.group.name && + l.options.group.name && + a.options.group.name === l.options.group.name; + if (s == null && (r || d)) return !0; + if (s == null || s === !1) return !1; + if (r && s === "clone") return s; + if (typeof s == "function") + return e(s(a, l, c, f), r)(a, l, c, f); + var p = (r ? a : l).options.group.name; + return ( + s === !0 || + (typeof s == "string" && s === p) || + (s.join && s.indexOf(p) > -1) + ); + }; + } + var i = {}, + o = t.group; + ((!o || ue(o) != "object") && (o = { name: o }), + (i.name = o.name), + (i.checkPull = e(o.pull, !0)), + (i.checkPut = e(o.put)), + (i.revertClone = o.revertClone), + (t.group = i)); + }, + Xi = function () { + !Wi && w && b(w, "display", "none"); + }, + Ki = function () { + !Wi && w && b(w, "display", ""); + }; +Oe && + !Pi && + document.addEventListener( + "click", + function (n) { + if (we) + return ( + n.preventDefault(), + n.stopPropagation && n.stopPropagation(), + n.stopImmediatePropagation && n.stopImmediatePropagation(), + (we = !1), + !1 + ); + }, + !0, + ); +var Ct = function (t) { + if (h) { + t = t.touches ? t.touches[0] : t; + var e = Wn(t.clientX, t.clientY); + if (e) { + var i = {}; + for (var o in t) t.hasOwnProperty(o) && (i[o] = t[o]); + ((i.target = i.rootEl = e), + (i.preventDefault = void 0), + (i.stopPropagation = void 0), + e[j]._onDragOver(i)); + } + } + }, + zn = function (t) { + h && h.parentNode[j]._isOutsideThisEl(t.target); + }; +function v(n, t) { + if (!(n && n.nodeType && n.nodeType === 1)) + throw "Sortable: `el` must be an HTMLElement, not ".concat( + {}.toString.call(n), + ); + ((this.el = n), (this.options = t = gt({}, t)), (n[j] = this)); + var e = { + group: null, + sort: !0, + disabled: !1, + store: null, + handle: null, + draggable: /^[uo]l$/i.test(n.nodeName) ? ">li" : ">*", + swapThreshold: 1, + invertSwap: !1, + invertedSwapThreshold: null, + removeCloneOnHide: !0, + direction: function () { + return zi(n, this.options); + }, + ghostClass: "sortable-ghost", + chosenClass: "sortable-chosen", + dragClass: "sortable-drag", + ignore: "a, img", + filter: null, + preventOnFilter: !0, + animation: 0, + easing: null, + setData: function (r, a) { + r.setData("Text", a.textContent); + }, + dropBubble: !1, + dragoverBubble: !1, + dataIdAttr: "data-id", + delay: 0, + delayOnTouchOnly: !1, + touchStartThreshold: + (Number.parseInt ? Number : window).parseInt( + window.devicePixelRatio, + 10, + ) || 1, + forceFallback: !1, + fallbackClass: "sortable-fallback", + fallbackOnBody: !1, + fallbackTolerance: 0, + fallbackOffset: { x: 0, y: 0 }, + supportPointer: + v.supportPointer !== !1 && "PointerEvent" in window && (!Gt || Xe), + emptyInsertThreshold: 5, + }; + te.initializePlugins(this, n, e); + for (var i in e) !(i in t) && (t[i] = e[i]); + $i(t); + for (var o in this) + o.charAt(0) === "_" && + typeof this[o] == "function" && + (this[o] = this[o].bind(this)); + ((this.nativeDraggable = t.forceFallback ? !1 : Hn), + this.nativeDraggable && (this.options.touchStartThreshold = 1), + t.supportPointer + ? O(n, "pointerdown", this._onTapStart) + : (O(n, "mousedown", this._onTapStart), + O(n, "touchstart", this._onTapStart)), + this.nativeDraggable && + (O(n, "dragover", this), O(n, "dragenter", this)), + ye.push(this.el), + t.store && t.store.get && this.sort(t.store.get(this) || []), + gt(this, Mn())); +} +v.prototype = { + constructor: v, + _isOutsideThisEl: function (t) { + !this.el.contains(t) && t !== this.el && (Rt = null); + }, + _getDirection: function (t, e) { + return typeof this.options.direction == "function" + ? this.options.direction.call(this, t, e, h) + : this.options.direction; + }, + _onTapStart: function (t) { + if (t.cancelable) { + var e = this, + i = this.el, + o = this.options, + s = o.preventOnFilter, + r = t.type, + a = + (t.touches && t.touches[0]) || + (t.pointerType && t.pointerType === "touch" && t), + l = (a || t).target, + c = + (t.target.shadowRoot && + ((t.path && t.path[0]) || + (t.composedPath && t.composedPath()[0]))) || + l, + f = o.filter; + if ( + (qn(i), + !h && + !( + (/mousedown|pointerdown/.test(r) && t.button !== 0) || + o.disabled + ) && + !c.isContentEditable && + !( + !this.nativeDraggable && + Gt && + l && + l.tagName.toUpperCase() === "SELECT" + ) && + ((l = lt(l, o.draggable, i, !1)), + !(l && l.animated) && pe !== l)) + ) { + if ( + ((Mt = ot(l)), + (qt = ot(l, o.draggable)), + typeof f == "function") + ) { + if (f.call(this, t, l, this)) { + (K({ + sortable: e, + rootEl: c, + name: "filter", + targetEl: l, + toEl: i, + fromEl: i, + }), + G("filter", e, { evt: t }), + s && t.preventDefault()); + return; + } + } else if ( + f && + ((f = f.split(",").some(function (d) { + if (((d = lt(c, d.trim(), i, !1)), d)) + return ( + K({ + sortable: e, + rootEl: d, + name: "filter", + targetEl: l, + fromEl: i, + toEl: i, + }), + G("filter", e, { evt: t }), + !0 + ); + })), + f) + ) { + s && t.preventDefault(); + return; + } + (o.handle && !lt(c, o.handle, i, !1)) || + this._prepareDragStart(t, a, l); + } + } + }, + _prepareDragStart: function (t, e, i) { + var o = this, + s = o.el, + r = o.options, + a = s.ownerDocument, + l; + if (i && !h && i.parentNode === s) { + var c = k(i); + if ( + ((I = s), + (h = i), + (R = h.parentNode), + (Lt = h.nextSibling), + (pe = i), + (ce = r.group), + (v.dragged = h), + (At = { + target: h, + clientX: (e || t).clientX, + clientY: (e || t).clientY, + }), + (Ii = At.clientX - c.left), + (Ti = At.clientY - c.top), + (this._lastX = (e || t).clientX), + (this._lastY = (e || t).clientY), + (h.style["will-change"] = "all"), + (l = function () { + if ((G("delayEnded", o, { evt: t }), v.eventCanceled)) { + o._onDrop(); + return; + } + (o._disableDelayedDragEvents(), + !Di && o.nativeDraggable && (h.draggable = !0), + o._triggerDragStart(t, e), + K({ sortable: o, name: "choose", originalEvent: t }), + Q(h, r.chosenClass, !0)); + }), + r.ignore.split(",").forEach(function (f) { + ki(h, f.trim(), ke); + }), + O(a, "dragover", Ct), + O(a, "mousemove", Ct), + O(a, "touchmove", Ct), + r.supportPointer + ? (O(a, "pointerup", o._onDrop), + !this.nativeDraggable && O(a, "pointercancel", o._onDrop)) + : (O(a, "mouseup", o._onDrop), + O(a, "touchend", o._onDrop), + O(a, "touchcancel", o._onDrop)), + Di && + this.nativeDraggable && + ((this.options.touchStartThreshold = 4), + (h.draggable = !0)), + G("delayStart", this, { evt: t }), + r.delay && + (!r.delayOnTouchOnly || e) && + (!this.nativeDraggable || !(Zt || mt))) + ) { + if (v.eventCanceled) { + this._onDrop(); + return; + } + (r.supportPointer + ? (O(a, "pointerup", o._disableDelayedDrag), + O(a, "pointercancel", o._disableDelayedDrag)) + : (O(a, "mouseup", o._disableDelayedDrag), + O(a, "touchend", o._disableDelayedDrag), + O(a, "touchcancel", o._disableDelayedDrag)), + O(a, "mousemove", o._delayedDragTouchMoveHandler), + O(a, "touchmove", o._delayedDragTouchMoveHandler), + r.supportPointer && + O(a, "pointermove", o._delayedDragTouchMoveHandler), + (o._dragStartTimer = setTimeout(l, r.delay))); + } else l(); + } + }, + _delayedDragTouchMoveHandler: function (t) { + var e = t.touches ? t.touches[0] : t; + Math.max( + Math.abs(e.clientX - this._lastX), + Math.abs(e.clientY - this._lastY), + ) >= + Math.floor( + this.options.touchStartThreshold / + ((this.nativeDraggable && window.devicePixelRatio) || 1), + ) && this._disableDelayedDrag(); + }, + _disableDelayedDrag: function () { + (h && ke(h), + clearTimeout(this._dragStartTimer), + this._disableDelayedDragEvents()); + }, + _disableDelayedDragEvents: function () { + var t = this.el.ownerDocument; + (x(t, "mouseup", this._disableDelayedDrag), + x(t, "touchend", this._disableDelayedDrag), + x(t, "touchcancel", this._disableDelayedDrag), + x(t, "pointerup", this._disableDelayedDrag), + x(t, "pointercancel", this._disableDelayedDrag), + x(t, "mousemove", this._delayedDragTouchMoveHandler), + x(t, "touchmove", this._delayedDragTouchMoveHandler), + x(t, "pointermove", this._delayedDragTouchMoveHandler)); + }, + _triggerDragStart: function (t, e) { + ((e = e || (t.pointerType == "touch" && t)), + !this.nativeDraggable || e + ? this.options.supportPointer + ? O(document, "pointermove", this._onTouchMove) + : e + ? O(document, "touchmove", this._onTouchMove) + : O(document, "mousemove", this._onTouchMove) + : (O(h, "dragend", this), + O(I, "dragstart", this._onDragStart))); + try { + document.selection + ? me(function () { + document.selection.empty(); + }) + : window.getSelection().removeAllRanges(); + } catch {} + }, + _dragStarted: function (t, e) { + if (((Pt = !1), I && h)) { + (G("dragStarted", this, { evt: e }), + this.nativeDraggable && O(document, "dragover", zn)); + var i = this.options; + (!t && Q(h, i.dragClass, !1), + Q(h, i.ghostClass, !0), + (v.active = this), + t && this._appendGhost(), + K({ sortable: this, name: "start", originalEvent: e })); + } else this._nulling(); + }, + _emulateDragOver: function () { + if (at) { + ((this._lastX = at.clientX), (this._lastY = at.clientY), Xi()); + for ( + var t = document.elementFromPoint(at.clientX, at.clientY), + e = t; + t && + t.shadowRoot && + ((t = t.shadowRoot.elementFromPoint(at.clientX, at.clientY)), + t !== e); + ) + e = t; + if ((h.parentNode[j]._isOutsideThisEl(t), e)) + do { + if (e[j]) { + var i = void 0; + if ( + ((i = e[j]._onDragOver({ + clientX: at.clientX, + clientY: at.clientY, + target: t, + rootEl: e, + })), + i && !this.options.dragoverBubble) + ) + break; + } + t = e; + } while ((e = Ni(e))); + Ki(); + } + }, + _onTouchMove: function (t) { + if (At) { + var e = this.options, + i = e.fallbackTolerance, + o = e.fallbackOffset, + s = t.touches ? t.touches[0] : t, + r = w && Nt(w, !0), + a = w && r && r.a, + l = w && r && r.d, + c = fe && $ && Li($), + f = + (s.clientX - At.clientX + o.x) / (a || 1) + + (c ? c[0] - Ne[0] : 0) / (a || 1), + d = + (s.clientY - At.clientY + o.y) / (l || 1) + + (c ? c[1] - Ne[1] : 0) / (l || 1); + if (!v.active && !Pt) { + if ( + i && + Math.max( + Math.abs(s.clientX - this._lastX), + Math.abs(s.clientY - this._lastY), + ) < i + ) + return; + this._onDragStart(t, !0); + } + if (w) { + r + ? ((r.e += f - (Pe || 0)), (r.f += d - (Me || 0))) + : (r = { a: 1, b: 0, c: 0, d: 1, e: f, f: d }); + var p = "matrix(" + .concat(r.a, ",") + .concat(r.b, ",") + .concat(r.c, ",") + .concat(r.d, ",") + .concat(r.e, ",") + .concat(r.f, ")"); + (b(w, "webkitTransform", p), + b(w, "mozTransform", p), + b(w, "msTransform", p), + b(w, "transform", p), + (Pe = f), + (Me = d), + (at = s)); + } + t.cancelable && t.preventDefault(); + } + }, + _appendGhost: function () { + if (!w) { + var t = this.options.fallbackOnBody ? document.body : I, + e = k(h, !0, fe, !0, t), + i = this.options; + if (fe) { + for ( + $ = t; + b($, "position") === "static" && + b($, "transform") === "none" && + $ !== document; + ) + $ = $.parentNode; + ($ !== document.body && $ !== document.documentElement + ? ($ === document && ($ = dt()), + (e.top += $.scrollTop), + (e.left += $.scrollLeft)) + : ($ = dt()), + (Ne = Li($))); + } + ((w = h.cloneNode(!0)), + Q(w, i.ghostClass, !1), + Q(w, i.fallbackClass, !0), + Q(w, i.dragClass, !0), + b(w, "transition", ""), + b(w, "transform", ""), + b(w, "box-sizing", "border-box"), + b(w, "margin", 0), + b(w, "top", e.top), + b(w, "left", e.left), + b(w, "width", e.width), + b(w, "height", e.height), + b(w, "opacity", "0.8"), + b(w, "position", fe ? "absolute" : "fixed"), + b(w, "zIndex", "100000"), + b(w, "pointerEvents", "none"), + (v.ghost = w), + t.appendChild(w), + b( + w, + "transform-origin", + (Ii / parseInt(w.style.width)) * 100 + + "% " + + (Ti / parseInt(w.style.height)) * 100 + + "%", + )); + } + }, + _onDragStart: function (t, e) { + var i = this, + o = t.dataTransfer, + s = i.options; + if ((G("dragStart", this, { evt: t }), v.eventCanceled)) { + this._onDrop(); + return; + } + (G("setupClone", this), + v.eventCanceled || + ((T = Hi(h)), + T.removeAttribute("id"), + (T.draggable = !1), + (T.style["will-change"] = ""), + this._hideClone(), + Q(T, this.options.chosenClass, !1), + (v.clone = T)), + (i.cloneId = me(function () { + (G("clone", i), + !v.eventCanceled && + (i.options.removeCloneOnHide || I.insertBefore(T, h), + i._hideClone(), + K({ sortable: i, name: "clone" }))); + })), + !e && Q(h, s.dragClass, !0), + e + ? ((we = !0), (i._loopId = setInterval(i._emulateDragOver, 50))) + : (x(document, "mouseup", i._onDrop), + x(document, "touchend", i._onDrop), + x(document, "touchcancel", i._onDrop), + o && + ((o.effectAllowed = "move"), + s.setData && s.setData.call(i, o, h)), + O(document, "drop", i), + b(h, "transform", "translateZ(0)")), + (Pt = !0), + (i._dragStartId = me(i._dragStarted.bind(i, e, t))), + O(document, "selectstart", i), + (Kt = !0), + window.getSelection().removeAllRanges(), + Gt && b(document.body, "user-select", "none")); + }, + _onDragOver: function (t) { + var e = this.el, + i = t.target, + o, + s, + r, + a = this.options, + l = a.group, + c = v.active, + f = ce === l, + d = a.sort, + p = V || c, + u, + g = this, + m = !1; + if (Ve) return; + function S(B, et) { + G( + B, + g, + ft( + { + evt: t, + isOwner: f, + axis: u ? "vertical" : "horizontal", + revert: r, + dragRect: o, + targetRect: s, + canSort: d, + fromSortable: p, + target: i, + completed: y, + onMove: function (Ge, Gi) { + return he(I, e, h, o, Ge, k(Ge), t, Gi); + }, + changed: D, + }, + et, + ), + ); + } + function E() { + (S("dragOverAnimationCapture"), + g.captureAnimationState(), + g !== p && p.captureAnimationState()); + } + function y(B) { + return ( + S("dragOverCompleted", { insertion: B }), + B && + (f ? c._hideClone() : c._showClone(g), + g !== p && + (Q( + h, + V ? V.options.ghostClass : c.options.ghostClass, + !1, + ), + Q(h, a.ghostClass, !0)), + V !== g && g !== v.active + ? (V = g) + : g === v.active && V && (V = null), + p === g && (g._ignoreWhileAnimating = i), + g.animateAll(function () { + (S("dragOverAnimationComplete"), + (g._ignoreWhileAnimating = null)); + }), + g !== p && + (p.animateAll(), (p._ignoreWhileAnimating = null))), + ((i === h && !h.animated) || (i === e && !i.animated)) && + (Rt = null), + !a.dragoverBubble && + !t.rootEl && + i !== document && + (h.parentNode[j]._isOutsideThisEl(t.target), !B && Ct(t)), + !a.dragoverBubble && t.stopPropagation && t.stopPropagation(), + (m = !0) + ); + } + function D() { + ((Z = ot(h)), + (yt = ot(h, a.draggable)), + K({ + sortable: g, + name: "change", + toEl: e, + newIndex: Z, + newDraggableIndex: yt, + originalEvent: t, + })); + } + if ( + (t.preventDefault !== void 0 && t.cancelable && t.preventDefault(), + (i = lt(i, a.draggable, e, !0)), + S("dragOver"), + v.eventCanceled) + ) + return m; + if ( + h.contains(t.target) || + (i.animated && i.animatingX && i.animatingY) || + g._ignoreWhileAnimating === i + ) + return y(!1); + if ( + ((we = !1), + c && + !a.disabled && + (f + ? d || (r = R !== I) + : V === this || + ((this.lastPutMode = ce.checkPull(this, c, h, t)) && + l.checkPut(this, c, h, t)))) + ) { + if ( + ((u = this._getDirection(t, i) === "vertical"), + (o = k(h)), + S("dragOverValid"), + v.eventCanceled) + ) + return m; + if (r) + return ( + (R = I), + E(), + this._hideClone(), + S("revert"), + v.eventCanceled || + (Lt ? I.insertBefore(h, Lt) : I.appendChild(h)), + y(!0) + ); + var A = Ke(e, a.draggable); + if (!A || (Yn(t, u, this) && !A.animated)) { + if (A === h) return y(!1); + if ( + (A && e === t.target && (i = A), + i && (s = k(i)), + he(I, e, h, o, i, s, t, !!i) !== !1) + ) + return ( + E(), + A && A.nextSibling + ? e.insertBefore(h, A.nextSibling) + : e.appendChild(h), + (R = e), + D(), + y(!0) + ); + } else if (A && Kn(t, u, this)) { + var C = kt(e, 0, a, !0); + if (C === h) return y(!1); + if (((i = C), (s = k(i)), he(I, e, h, o, i, s, t, !1) !== !1)) + return (E(), e.insertBefore(h, C), (R = e), D(), y(!0)); + } else if (i.parentNode === e) { + s = k(i); + var F = 0, + q, + J = h.parentNode !== e, + _ = !Vn( + (h.animated && h.toRect) || o, + (i.animated && i.toRect) || s, + u, + ), + W = u ? "top" : "left", + L = Ci(i, "top", "top") || Ci(h, "top", "top"), + X = L ? L.scrollTop : void 0; + (Rt !== i && + ((q = s[W]), (Qt = !1), (de = (!_ && a.invertSwap) || J)), + (F = Un( + t, + i, + s, + u, + _ ? 1 : a.swapThreshold, + a.invertedSwapThreshold == null + ? a.swapThreshold + : a.invertedSwapThreshold, + de, + Rt === i, + ))); + var M; + if (F !== 0) { + var H = ot(h); + do ((H -= F), (M = R.children[H])); + while (M && (b(M, "display") === "none" || M === w)); + } + if (F === 0 || M === i) return y(!1); + ((Rt = i), (Jt = F)); + var tt = i.nextElementSibling, + z = !1; + z = F === 1; + var Y = he(I, e, h, o, i, s, t, z); + if (Y !== !1) + return ( + (Y === 1 || Y === -1) && (z = Y === 1), + (Ve = !0), + setTimeout(Xn, 30), + E(), + z && !tt + ? e.appendChild(h) + : i.parentNode.insertBefore(h, z ? tt : i), + L && Fi(L, 0, X - L.scrollTop), + (R = h.parentNode), + q !== void 0 && !de && (ge = Math.abs(q - k(i)[W])), + D(), + y(!0) + ); + } + if (e.contains(h)) return y(!1); + } + return !1; + }, + _ignoreWhileAnimating: null, + _offMoveEvents: function () { + (x(document, "mousemove", this._onTouchMove), + x(document, "touchmove", this._onTouchMove), + x(document, "pointermove", this._onTouchMove), + x(document, "dragover", Ct), + x(document, "mousemove", Ct), + x(document, "touchmove", Ct)); + }, + _offUbEvents: function () { + var t = this.el.ownerDocument; + (x(t, "mouseup", this._onDrop), + x(t, "touchend", this._onDrop), + x(t, "pointerup", this._onDrop), + x(t, "pointercancel", this._onDrop), + x(t, "touchcancel", this._onDrop), + x(document, "selectstart", this)); + }, + _onDrop: function (t) { + var e = this.el, + i = this.options; + if ( + ((Z = ot(h)), + (yt = ot(h, i.draggable)), + G("drop", this, { evt: t }), + (R = h && h.parentNode), + (Z = ot(h)), + (yt = ot(h, i.draggable)), + v.eventCanceled) + ) { + this._nulling(); + return; + } + ((Pt = !1), + (de = !1), + (Qt = !1), + clearInterval(this._loopId), + clearTimeout(this._dragStartTimer), + We(this.cloneId), + We(this._dragStartId), + this.nativeDraggable && + (x(document, "drop", this), + x(e, "dragstart", this._onDragStart)), + this._offMoveEvents(), + this._offUbEvents(), + Gt && b(document.body, "user-select", ""), + b(h, "transform", ""), + t && + (Kt && + (t.cancelable && t.preventDefault(), + !i.dropBubble && t.stopPropagation()), + w && w.parentNode && w.parentNode.removeChild(w), + (I === R || (V && V.lastPutMode !== "clone")) && + T && + T.parentNode && + T.parentNode.removeChild(T), + h && + (this.nativeDraggable && x(h, "dragend", this), + ke(h), + (h.style["will-change"] = ""), + Kt && + !Pt && + Q( + h, + V ? V.options.ghostClass : this.options.ghostClass, + !1, + ), + Q(h, this.options.chosenClass, !1), + K({ + sortable: this, + name: "unchoose", + toEl: R, + newIndex: null, + newDraggableIndex: null, + originalEvent: t, + }), + I !== R + ? (Z >= 0 && + (K({ + rootEl: R, + name: "add", + toEl: R, + fromEl: I, + originalEvent: t, + }), + K({ + sortable: this, + name: "remove", + toEl: R, + originalEvent: t, + }), + K({ + rootEl: R, + name: "sort", + toEl: R, + fromEl: I, + originalEvent: t, + }), + K({ + sortable: this, + name: "sort", + toEl: R, + originalEvent: t, + })), + V && V.save()) + : Z !== Mt && + Z >= 0 && + (K({ + sortable: this, + name: "update", + toEl: R, + originalEvent: t, + }), + K({ + sortable: this, + name: "sort", + toEl: R, + originalEvent: t, + })), + v.active && + ((Z == null || Z === -1) && ((Z = Mt), (yt = qt)), + K({ + sortable: this, + name: "end", + toEl: R, + originalEvent: t, + }), + this.save()))), + this._nulling()); + }, + _nulling: function () { + (G("nulling", this), + (I = + h = + R = + w = + Lt = + T = + pe = + St = + At = + at = + Kt = + Z = + yt = + Mt = + qt = + Rt = + Jt = + V = + ce = + v.dragged = + v.ghost = + v.clone = + v.active = + null), + Se.forEach(function (t) { + t.checked = !0; + }), + (Se.length = Pe = Me = 0)); + }, + handleEvent: function (t) { + switch (t.type) { + case "drop": + case "dragend": + this._onDrop(t); + break; + case "dragenter": + case "dragover": + h && (this._onDragOver(t), $n(t)); + break; + case "selectstart": + t.preventDefault(); + break; + } + }, + toArray: function () { + for ( + var t = [], + e, + i = this.el.children, + o = 0, + s = i.length, + r = this.options; + o < s; + o++ + ) + ((e = i[o]), + lt(e, r.draggable, this.el, !1) && + t.push(e.getAttribute(r.dataIdAttr) || jn(e))); + return t; + }, + sort: function (t, e) { + var i = {}, + o = this.el; + (this.toArray().forEach(function (s, r) { + var a = o.children[r]; + lt(a, this.options.draggable, o, !1) && (i[s] = a); + }, this), + e && this.captureAnimationState(), + t.forEach(function (s) { + i[s] && (o.removeChild(i[s]), o.appendChild(i[s])); + }), + e && this.animateAll()); + }, + save: function () { + var t = this.options.store; + t && t.set && t.set(this); + }, + closest: function (t, e) { + return lt(t, e || this.options.draggable, this.el, !1); + }, + option: function (t, e) { + var i = this.options; + if (e === void 0) return i[t]; + var o = te.modifyOption(this, t, e); + (typeof o < "u" ? (i[t] = o) : (i[t] = e), t === "group" && $i(i)); + }, + destroy: function () { + G("destroy", this); + var t = this.el; + ((t[j] = null), + x(t, "mousedown", this._onTapStart), + x(t, "touchstart", this._onTapStart), + x(t, "pointerdown", this._onTapStart), + this.nativeDraggable && + (x(t, "dragover", this), x(t, "dragenter", this)), + Array.prototype.forEach.call( + t.querySelectorAll("[draggable]"), + function (e) { + e.removeAttribute("draggable"); + }, + ), + this._onDrop(), + this._disableDelayedDragEvents(), + ye.splice(ye.indexOf(this.el), 1), + (this.el = t = null)); + }, + _hideClone: function () { + if (!St) { + if ((G("hideClone", this), v.eventCanceled)) return; + (b(T, "display", "none"), + this.options.removeCloneOnHide && + T.parentNode && + T.parentNode.removeChild(T), + (St = !0)); + } + }, + _showClone: function (t) { + if (t.lastPutMode !== "clone") { + this._hideClone(); + return; + } + if (St) { + if ((G("showClone", this), v.eventCanceled)) return; + (h.parentNode == I && !this.options.group.revertClone + ? I.insertBefore(T, h) + : Lt + ? I.insertBefore(T, Lt) + : I.appendChild(T), + this.options.group.revertClone && this.animate(h, T), + b(T, "display", ""), + (St = !1)); + } + }, +}; +function $n(n) { + (n.dataTransfer && (n.dataTransfer.dropEffect = "move"), + n.cancelable && n.preventDefault()); +} +function he(n, t, e, i, o, s, r, a) { + var l, + c = n[j], + f = c.options.onMove, + d; + return ( + window.CustomEvent && !mt && !Zt + ? (l = new CustomEvent("move", { bubbles: !0, cancelable: !0 })) + : ((l = document.createEvent("Event")), + l.initEvent("move", !0, !0)), + (l.to = t), + (l.from = n), + (l.dragged = e), + (l.draggedRect = i), + (l.related = o || t), + (l.relatedRect = s || k(t)), + (l.willInsertAfter = a), + (l.originalEvent = r), + n.dispatchEvent(l), + f && (d = f.call(c, l, r)), + d + ); +} +function ke(n) { + n.draggable = !1; +} +function Xn() { + Ve = !1; +} +function Kn(n, t, e) { + var i = k(kt(e.el, 0, e.options, !0)), + o = Vi(e.el, e.options, w), + s = 10; + return t + ? n.clientX < o.left - s || (n.clientY < i.top && n.clientX < i.right) + : n.clientY < o.top - s || (n.clientY < i.bottom && n.clientX < i.left); +} +function Yn(n, t, e) { + var i = k(Ke(e.el, e.options.draggable)), + o = Vi(e.el, e.options, w), + s = 10; + return t + ? n.clientX > o.right + s || + (n.clientY > i.bottom && n.clientX > i.left) + : n.clientY > o.bottom + s || + (n.clientX > i.right && n.clientY > i.top); +} +function Un(n, t, e, i, o, s, r, a) { + var l = i ? n.clientY : n.clientX, + c = i ? e.height : e.width, + f = i ? e.top : e.left, + d = i ? e.bottom : e.right, + p = !1; + if (!r) { + if (a && ge < c * o) { + if ( + (!Qt && + (Jt === 1 ? l > f + (c * s) / 2 : l < d - (c * s) / 2) && + (Qt = !0), + Qt) + ) + p = !0; + else if (Jt === 1 ? l < f + ge : l > d - ge) return -Jt; + } else if (l > f + (c * (1 - o)) / 2 && l < d - (c * (1 - o)) / 2) + return Gn(t); + } + return ( + (p = p || r), + p && (l < f + (c * s) / 2 || l > d - (c * s) / 2) + ? l > f + c / 2 + ? 1 + : -1 + : 0 + ); +} +function Gn(n) { + return ot(h) < ot(n) ? 1 : -1; +} +function jn(n) { + for ( + var t = n.tagName + n.className + n.src + n.href + n.textContent, + e = t.length, + i = 0; + e--; + ) + i += t.charCodeAt(e); + return i.toString(36); +} +function qn(n) { + Se.length = 0; + for (var t = n.getElementsByTagName("input"), e = t.length; e--; ) { + var i = t[e]; + i.checked && Se.push(i); + } +} +function me(n) { + return setTimeout(n, 0); +} +function We(n) { + return clearTimeout(n); +} +Oe && + O(document, "touchmove", function (n) { + (v.active || Pt) && n.cancelable && n.preventDefault(); + }); +v.utils = { + on: O, + off: x, + css: b, + find: ki, + is: function (t, e) { + return !!lt(t, e, t, !1); + }, + extend: Rn, + throttle: Bi, + closest: lt, + toggleClass: Q, + clone: Hi, + index: ot, + nextTick: me, + cancelNextTick: We, + detectDirection: zi, + getChild: kt, + expando: j, +}; +v.get = function (n) { + return n[j]; +}; +v.mount = function () { + for (var n = arguments.length, t = new Array(n), e = 0; e < n; e++) + t[e] = arguments[e]; + (t[0].constructor === Array && (t = t[0]), + t.forEach(function (i) { + if (!i.prototype || !i.prototype.constructor) + throw "Sortable: Mounted plugin must be a constructor function, not ".concat( + {}.toString.call(i), + ); + (i.utils && (v.utils = ft(ft({}, v.utils), i.utils)), te.mount(i)); + })); +}; +v.create = function (n, t) { + return new v(n, t); +}; +v.version = Tn; +var N = [], + Yt, + ze, + $e = !1, + Be, + Fe, + xe, + Ut; +function Jn() { + function n() { + this.defaults = { + scroll: !0, + forceAutoScrollFallback: !1, + scrollSensitivity: 30, + scrollSpeed: 10, + bubbleScroll: !0, + }; + for (var t in this) + t.charAt(0) === "_" && + typeof this[t] == "function" && + (this[t] = this[t].bind(this)); + } + return ( + (n.prototype = { + dragStarted: function (e) { + var i = e.originalEvent; + this.sortable.nativeDraggable + ? O(document, "dragover", this._handleAutoScroll) + : this.options.supportPointer + ? O( + document, + "pointermove", + this._handleFallbackAutoScroll, + ) + : i.touches + ? O( + document, + "touchmove", + this._handleFallbackAutoScroll, + ) + : O( + document, + "mousemove", + this._handleFallbackAutoScroll, + ); + }, + dragOverCompleted: function (e) { + var i = e.originalEvent; + !this.options.dragOverBubble && + !i.rootEl && + this._handleAutoScroll(i); + }, + drop: function () { + (this.sortable.nativeDraggable + ? x(document, "dragover", this._handleAutoScroll) + : (x( + document, + "pointermove", + this._handleFallbackAutoScroll, + ), + x(document, "touchmove", this._handleFallbackAutoScroll), + x(document, "mousemove", this._handleFallbackAutoScroll)), + Ri(), + be(), + Pn()); + }, + nulling: function () { + ((xe = ze = Yt = $e = Ut = Be = Fe = null), (N.length = 0)); + }, + _handleFallbackAutoScroll: function (e) { + this._handleAutoScroll(e, !0); + }, + _handleAutoScroll: function (e, i) { + var o = this, + s = (e.touches ? e.touches[0] : e).clientX, + r = (e.touches ? e.touches[0] : e).clientY, + a = document.elementFromPoint(s, r); + if ( + ((xe = e), + i || this.options.forceAutoScrollFallback || Zt || mt || Gt) + ) { + He(e, this.options, a, i); + var l = xt(a, !0); + $e && + (!Ut || s !== Be || r !== Fe) && + (Ut && Ri(), + (Ut = setInterval(function () { + var c = xt(document.elementFromPoint(s, r), !0); + (c !== l && ((l = c), be()), + He(e, o.options, c, i)); + }, 10)), + (Be = s), + (Fe = r)); + } else { + if (!this.options.bubbleScroll || xt(a, !0) === dt()) { + be(); + return; + } + He(e, this.options, xt(a, !1), !1); + } + }, + }), + gt(n, { pluginName: "scroll", initializeByDefault: !0 }) + ); +} +function be() { + (N.forEach(function (n) { + clearInterval(n.pid); + }), + (N = [])); +} +function Ri() { + clearInterval(Ut); +} +var He = Bi(function (n, t, e, i) { + if (t.scroll) { + var o = (n.touches ? n.touches[0] : n).clientX, + s = (n.touches ? n.touches[0] : n).clientY, + r = t.scrollSensitivity, + a = t.scrollSpeed, + l = dt(), + c = !1, + f; + ze !== e && + ((ze = e), + be(), + (Yt = t.scroll), + (f = t.scrollFn), + Yt === !0 && (Yt = xt(e, !0))); + var d = 0, + p = Yt; + do { + var u = p, + g = k(u), + m = g.top, + S = g.bottom, + E = g.left, + y = g.right, + D = g.width, + A = g.height, + C = void 0, + F = void 0, + q = u.scrollWidth, + J = u.scrollHeight, + _ = b(u), + W = u.scrollLeft, + L = u.scrollTop; + u === l + ? ((C = + D < q && + (_.overflowX === "auto" || + _.overflowX === "scroll" || + _.overflowX === "visible")), + (F = + A < J && + (_.overflowY === "auto" || + _.overflowY === "scroll" || + _.overflowY === "visible"))) + : ((C = + D < q && + (_.overflowX === "auto" || _.overflowX === "scroll")), + (F = + A < J && + (_.overflowY === "auto" || + _.overflowY === "scroll"))); + var X = + C && + (Math.abs(y - o) <= r && W + D < q) - + (Math.abs(E - o) <= r && !!W), + M = + F && + (Math.abs(S - s) <= r && L + A < J) - + (Math.abs(m - s) <= r && !!L); + if (!N[d]) for (var H = 0; H <= d; H++) N[H] || (N[H] = {}); + ((N[d].vx != X || N[d].vy != M || N[d].el !== u) && + ((N[d].el = u), + (N[d].vx = X), + (N[d].vy = M), + clearInterval(N[d].pid), + (X != 0 || M != 0) && + ((c = !0), + (N[d].pid = setInterval( + function () { + i && + this.layer === 0 && + v.active._onTouchMove(xe); + var tt = N[this.layer].vy + ? N[this.layer].vy * a + : 0, + z = N[this.layer].vx + ? N[this.layer].vx * a + : 0; + (typeof f == "function" && + f.call( + v.dragged.parentNode[j], + z, + tt, + n, + xe, + N[this.layer].el, + ) !== "continue") || + Fi(N[this.layer].el, z, tt); + }.bind({ layer: d }), + 24, + )))), + d++); + } while (t.bubbleScroll && p !== l && (p = xt(p, !1))); + $e = c; + } + }, 30), + Yi = function (t) { + var e = t.originalEvent, + i = t.putSortable, + o = t.dragEl, + s = t.activeSortable, + r = t.dispatchSortableEvent, + a = t.hideGhostForTarget, + l = t.unhideGhostForTarget; + if (e) { + var c = i || s; + a(); + var f = + e.changedTouches && e.changedTouches.length + ? e.changedTouches[0] + : e, + d = document.elementFromPoint(f.clientX, f.clientY); + (l(), + c && + !c.el.contains(d) && + (r("spill"), this.onSpill({ dragEl: o, putSortable: i }))); + } + }; +function Ye() {} +Ye.prototype = { + startIndex: null, + dragStart: function (t) { + var e = t.oldDraggableIndex; + this.startIndex = e; + }, + onSpill: function (t) { + var e = t.dragEl, + i = t.putSortable; + (this.sortable.captureAnimationState(), i && i.captureAnimationState()); + var o = kt(this.sortable.el, this.startIndex, this.options); + (o + ? this.sortable.el.insertBefore(e, o) + : this.sortable.el.appendChild(e), + this.sortable.animateAll(), + i && i.animateAll()); + }, + drop: Yi, +}; +gt(Ye, { pluginName: "revertOnSpill" }); +function Ue() {} +Ue.prototype = { + onSpill: function (t) { + var e = t.dragEl, + i = t.putSortable, + o = i || this.sortable; + (o.captureAnimationState(), + e.parentNode && e.parentNode.removeChild(e), + o.animateAll()); + }, + drop: Yi, +}; +gt(Ue, { pluginName: "removeOnSpill" }); +v.mount(new Jn()); +v.mount(Ue, Ye); +var Ui = v; +function bt(n) { + return n == null || n === "" || (typeof n == "string" && n.trim() === ""); +} +function P(n) { + return !bt(n); +} +var Ee = class { + constructor({ + canOptionLabelsWrap: t = !0, + canSelectPlaceholder: e = !0, + element: i, + getOptionLabelUsing: o = null, + getOptionLabelsUsing: s = null, + getOptionsUsing: r = null, + getSearchResultsUsing: a = null, + hasDynamicOptions: l = !1, + hasDynamicSearchResults: c = !0, + hasInitialNoOptionsMessage: f = !1, + initialOptionLabel: d = null, + initialOptionLabels: p = null, + initialState: u = null, + isAutofocused: g = !1, + isDisabled: m = !1, + isHtmlAllowed: S = !1, + isMultiple: E = !1, + isReorderable: y = !1, + isSearchable: D = !1, + livewireId: A = null, + loadingMessage: C = "Loading...", + maxItems: F = null, + maxItemsMessage: q = "Maximum number of items selected", + noOptionsMessage: J = "No options available", + noSearchResultsMessage: _ = "No results found", + onStateChange: W = () => {}, + options: L, + optionsLimit: X = null, + placeholder: M, + position: H = null, + searchableOptionFields: tt = ["label"], + searchDebounce: z = 1e3, + searchingMessage: Y = "Searching...", + searchPrompt: B = "Search...", + state: et, + statePath: ee = null, + }) { + ((this.canOptionLabelsWrap = t), + (this.canSelectPlaceholder = e), + (this.element = i), + (this.getOptionLabelUsing = o), + (this.getOptionLabelsUsing = s), + (this.getOptionsUsing = r), + (this.getSearchResultsUsing = a), + (this.hasDynamicOptions = l), + (this.hasDynamicSearchResults = c), + (this.hasInitialNoOptionsMessage = f), + (this.initialOptionLabel = d), + (this.initialOptionLabels = p), + (this.initialState = u), + (this.isAutofocused = g), + (this.isDisabled = m), + (this.isHtmlAllowed = S), + (this.isMultiple = E), + (this.isReorderable = y), + (this.isSearchable = D), + (this.livewireId = A), + (this.loadingMessage = C), + (this.maxItems = F), + (this.maxItemsMessage = q), + (this.noOptionsMessage = J), + (this.noSearchResultsMessage = _), + (this.onStateChange = W), + (this.options = L), + (this.optionsLimit = X), + (this.originalOptions = JSON.parse(JSON.stringify(L))), + (this.placeholder = M), + (this.position = H), + (this.searchableOptionFields = Array.isArray(tt) ? tt : ["label"]), + (this.searchDebounce = z), + (this.searchingMessage = Y), + (this.searchPrompt = B), + (this.state = et), + (this.statePath = ee), + (this.activeSearchId = 0), + (this.labelRepository = {}), + (this.isOpen = !1), + (this.selectedIndex = -1), + (this.searchQuery = ""), + (this.searchTimeout = null), + (this.isSearching = !1), + (this.selectedDisplayVersion = 0), + this.render(), + this.setUbEventListeners(), + this.isAutofocused && this.selectButton.focus()); + } + populateLabelRepositoryFromOptions(t) { + if (!(!t || !Array.isArray(t))) + for (let e of t) + e.options && Array.isArray(e.options) + ? this.populateLabelRepositoryFromOptions(e.options) + : e.value !== void 0 && + e.label !== void 0 && + (this.labelRepository[e.value] = e.label); + } + render() { + (this.populateLabelRepositoryFromOptions(this.options), + (this.container = document.createElement("div")), + (this.container.className = "fi-select-input-ctn"), + this.canOptionLabelsWrap || + this.container.classList.add( + "fi-select-input-ctn-option-labels-not-wrapped", + ), + this.container.setAttribute("aria-haspopup", "listbox"), + (this.selectButton = document.createElement("button")), + (this.selectButton.className = "fi-select-input-btn"), + (this.selectButton.type = "button"), + this.selectButton.setAttribute("aria-expanded", "false"), + (this.selectedDisplay = document.createElement("div")), + (this.selectedDisplay.className = "fi-select-input-value-ctn"), + this.updateSelectedDisplay(), + this.selectButton.appendChild(this.selectedDisplay), + (this.dropdown = document.createElement("div")), + (this.dropdown.className = "fi-dropdown-panel fi-scrollable"), + this.dropdown.setAttribute("role", "listbox"), + this.dropdown.setAttribute("tabindex", "-1"), + (this.dropdown.style.display = "none"), + (this.dropdownId = `fi-select-input-dropdown-${Math.random().toString(36).substring(2, 11)}`), + (this.dropdown.id = this.dropdownId), + this.isMultiple && + this.dropdown.setAttribute("aria-multiselectable", "true"), + this.isSearchable && + ((this.searchContainer = document.createElement("div")), + (this.searchContainer.className = "fi-select-input-search-ctn"), + (this.searchInput = document.createElement("input")), + (this.searchInput.className = "fi-input"), + (this.searchInput.type = "text"), + (this.searchInput.placeholder = this.searchPrompt), + this.searchInput.setAttribute("aria-label", "Search"), + this.searchContainer.appendChild(this.searchInput), + this.dropdown.appendChild(this.searchContainer), + this.searchInput.addEventListener("input", (t) => { + this.isDisabled || this.handleSearch(t); + }), + this.searchInput.addEventListener("keydown", (t) => { + if (!this.isDisabled) { + if (t.key === "Tab") { + t.preventDefault(); + let e = this.getVisibleOptions(); + if (e.length === 0) return; + (t.shiftKey + ? (this.selectedIndex = e.length - 1) + : (this.selectedIndex = 0), + e.forEach((i) => { + i.classList.remove("fi-selected"); + }), + e[this.selectedIndex].classList.add( + "fi-selected", + ), + e[this.selectedIndex].focus()); + } else if (t.key === "ArrowDown") { + if ( + (t.preventDefault(), + t.stopPropagation(), + this.getVisibleOptions().length === 0) + ) + return; + ((this.selectedIndex = -1), + this.searchInput.blur(), + this.focusNextOption()); + } else if (t.key === "ArrowUp") { + (t.preventDefault(), t.stopPropagation()); + let e = this.getVisibleOptions(); + if (e.length === 0) return; + ((this.selectedIndex = e.length - 1), + this.searchInput.blur(), + e[this.selectedIndex].classList.add( + "fi-selected", + ), + e[this.selectedIndex].focus(), + e[this.selectedIndex].id && + this.dropdown.setAttribute( + "aria-activedescendant", + e[this.selectedIndex].id, + ), + this.scrollOptionIntoView( + e[this.selectedIndex], + )); + } else if (t.key === "Enter") { + if ( + (t.preventDefault(), + t.stopPropagation(), + this.isSearching) + ) + return; + let e = this.getVisibleOptions(); + if (e.length === 0) return; + let i = e.find((s) => { + let r = + s.getAttribute("aria-disabled") === + "true", + a = s.classList.contains("fi-disabled"), + l = s.offsetParent === null; + return !(r || a || l); + }); + if (!i) return; + let o = i.getAttribute("data-value"); + if (o === null) return; + this.selectOption(o); + } + } + })), + (this.optionsList = document.createElement("ul")), + this.renderOptions(), + this.container.appendChild(this.selectButton), + this.container.appendChild(this.dropdown), + this.element.appendChild(this.container), + this.applyDisabledState()); + } + renderOptions() { + this.optionsList.innerHTML = ""; + let t = 0, + e = this.options, + i = 0, + o = !1; + (this.options.forEach((a) => { + a.options && Array.isArray(a.options) + ? ((i += a.options.length), (o = !0)) + : i++; + }), + o + ? (this.optionsList.className = "fi-select-input-options-ctn") + : i > 0 && (this.optionsList.className = "fi-dropdown-list")); + let s = o ? null : this.optionsList, + r = 0; + for (let a of e) { + if (this.optionsLimit > 0 && r >= this.optionsLimit) break; + if (a.options && Array.isArray(a.options)) { + let l = a.options; + if ( + (this.isMultiple && + Array.isArray(this.state) && + this.state.length > 0 && + (l = a.options.filter( + (c) => !this.state.includes(c.value), + )), + l.length > 0) + ) { + if (this.optionsLimit > 0) { + let c = this.optionsLimit - r; + c < l.length && (l = l.slice(0, c)); + } + (this.renderOptionGroup(a.label, l), + (r += l.length), + (t += l.length)); + } + } else { + if ( + this.isMultiple && + Array.isArray(this.state) && + this.state.includes(a.value) + ) + continue; + !s && + o && + ((s = document.createElement("ul")), + (s.className = "fi-dropdown-list"), + this.optionsList.appendChild(s)); + let l = this.createOptionElement(a.value, a); + (s.appendChild(l), r++, t++); + } + } + t === 0 + ? (this.searchQuery + ? this.showNoResultsMessage() + : this.hasInitialNoOptionsMessage || this.hasDynamicOptions + ? this.showNoOptionsMessage() + : this.isMultiple && + this.isOpen && + !this.isSearchable && + this.closeDropdown(), + this.optionsList.parentNode === this.dropdown && + this.dropdown.removeChild(this.optionsList)) + : (this.hideLoadingState(), + this.optionsList.parentNode !== this.dropdown && + this.dropdown.appendChild(this.optionsList)); + } + renderOptionGroup(t, e) { + if (e.length === 0) return; + let i = document.createElement("li"); + i.className = "fi-select-input-option-group"; + let o = document.createElement("div"); + ((o.className = "fi-dropdown-header"), (o.textContent = t)); + let s = document.createElement("ul"); + ((s.className = "fi-dropdown-list"), + e.forEach((r) => { + let a = this.createOptionElement(r.value, r); + s.appendChild(a); + }), + i.appendChild(o), + i.appendChild(s), + this.optionsList.appendChild(i)); + } + createOptionElement(t, e) { + let i = t, + o = e, + s = !1; + typeof e == "object" && + e !== null && + "label" in e && + "value" in e && + ((i = e.value), (o = e.label), (s = e.isDisabled || !1)); + let r = document.createElement("li"); + ((r.className = "fi-dropdown-list-item fi-select-input-option"), + s && r.classList.add("fi-disabled")); + let a = `fi-select-input-option-${Math.random().toString(36).substring(2, 11)}`; + if ( + ((r.id = a), + r.setAttribute("role", "option"), + r.setAttribute("data-value", i), + r.setAttribute("tabindex", "0"), + s && r.setAttribute("aria-disabled", "true"), + this.isHtmlAllowed && typeof o == "string") + ) { + let f = document.createElement("div"); + f.innerHTML = o; + let d = f.textContent || f.innerText || o; + r.setAttribute("aria-label", d); + } + let l = this.isMultiple + ? Array.isArray(this.state) && this.state.includes(i) + : this.state === i; + (r.setAttribute("aria-selected", l ? "true" : "false"), + l && r.classList.add("fi-selected")); + let c = document.createElement("span"); + return ( + this.isHtmlAllowed ? (c.innerHTML = o) : (c.textContent = o), + r.appendChild(c), + s || + r.addEventListener("click", (f) => { + (f.preventDefault(), + f.stopPropagation(), + this.selectOption(i), + this.isMultiple && + (this.isSearchable && this.searchInput + ? setTimeout(() => { + this.searchInput.focus(); + }, 0) + : setTimeout(() => { + r.focus(); + }, 0))); + }), + r + ); + } + async updateSelectedDisplay() { + this.selectedDisplayVersion = this.selectedDisplayVersion + 1; + let t = this.selectedDisplayVersion, + e = document.createDocumentFragment(); + if (this.isMultiple) { + if (!Array.isArray(this.state) || this.state.length === 0) { + let o = document.createElement("span"); + ((o.textContent = this.placeholder), + o.classList.add("fi-select-input-placeholder"), + e.appendChild(o)); + } else { + let o = await this.getLabelsForMultipleSelection(); + if (t !== this.selectedDisplayVersion) return; + this.addBadgesForSelectedOptions(o, e); + } + t === this.selectedDisplayVersion && + (this.selectedDisplay.replaceChildren(e), + this.isOpen && this.deferPositionDropdown()); + return; + } + if (this.state === null || this.state === "") { + let o = document.createElement("span"); + if ( + ((o.textContent = this.placeholder), + o.classList.add("fi-select-input-placeholder"), + e.appendChild(o), + t === this.selectedDisplayVersion) + ) { + this.selectedDisplay.replaceChildren(e); + let s = this.container.querySelector( + ".fi-select-input-value-remove-btn", + ); + (s && s.remove(), + this.container.classList.remove( + "fi-select-input-ctn-clearable", + )); + } + return; + } + let i = await this.getLabelForSingleSelection(); + t === this.selectedDisplayVersion && + (this.addSingleSelectionDisplay(i, e), + t === this.selectedDisplayVersion && + this.selectedDisplay.replaceChildren(e)); + } + async getLabelsForMultipleSelection() { + let t = this.getSelectedOptionLabels(), + e = []; + if (Array.isArray(this.state)) { + for (let o of this.state) + if (!P(this.labelRepository[o])) { + if (P(t[o])) { + this.labelRepository[o] = t[o]; + continue; + } + e.push(o.toString()); + } + } + if ( + e.length > 0 && + P(this.initialOptionLabels) && + JSON.stringify(this.state) === JSON.stringify(this.initialState) + ) { + if (Array.isArray(this.initialOptionLabels)) + for (let o of this.initialOptionLabels) + P(o) && + o.value !== void 0 && + o.label !== void 0 && + e.includes(o.value) && + (this.labelRepository[o.value] = o.label); + } else if (e.length > 0 && this.getOptionLabelsUsing) + try { + let o = await this.getOptionLabelsUsing(); + for (let s of o) + P(s) && + s.value !== void 0 && + s.label !== void 0 && + (this.labelRepository[s.value] = s.label); + } catch (o) { + console.error("Error fetching option labels:", o); + } + let i = []; + if (Array.isArray(this.state)) + for (let o of this.state) + P(this.labelRepository[o]) + ? i.push(this.labelRepository[o]) + : P(t[o]) + ? i.push(t[o]) + : i.push(o); + return i; + } + createBadgeElement(t, e) { + let i = document.createElement("span"); + ((i.className = + "fi-badge fi-size-md fi-color fi-color-primary fi-text-color-600 dark:fi-text-color-200"), + P(t) && i.setAttribute("data-value", t)); + let o = document.createElement("span"); + o.className = "fi-badge-label-ctn"; + let s = document.createElement("span"); + ((s.className = "fi-badge-label"), + this.canOptionLabelsWrap && s.classList.add("fi-wrapped"), + this.isHtmlAllowed ? (s.innerHTML = e) : (s.textContent = e), + o.appendChild(s), + i.appendChild(o)); + let r = this.createRemoveButton(t, e); + return (i.appendChild(r), i); + } + createRemoveButton(t, e) { + let i = document.createElement("button"); + return ( + (i.type = "button"), + (i.className = "fi-badge-delete-btn"), + (i.innerHTML = + ''), + i.setAttribute( + "aria-label", + "Remove " + + (this.isHtmlAllowed ? e.replace(/<[^>]*>/g, "") : e), + ), + i.addEventListener("click", (o) => { + (o.stopPropagation(), P(t) && this.selectOption(t)); + }), + i.addEventListener("keydown", (o) => { + (o.key === " " || o.key === "Enter") && + (o.preventDefault(), + o.stopPropagation(), + P(t) && this.selectOption(t)); + }), + i + ); + } + addBadgesForSelectedOptions(t, e = this.selectedDisplay) { + let i = document.createElement("div"); + ((i.className = "fi-select-input-value-badges-ctn"), + t.forEach((o, s) => { + let r = Array.isArray(this.state) ? this.state[s] : null, + a = this.createBadgeElement(r, o); + i.appendChild(a); + }), + e.appendChild(i), + this.isReorderable && + (i.addEventListener("click", (o) => { + o.stopPropagation(); + }), + i.addEventListener("mousedown", (o) => { + o.stopPropagation(); + }), + new Ui(i, { + animation: 150, + onEnd: () => { + let o = []; + (i.querySelectorAll("[data-value]").forEach((s) => { + o.push(s.getAttribute("data-value")); + }), + (this.state = o), + this.onStateChange(this.state)); + }, + }))); + } + async getLabelForSingleSelection() { + let t = this.labelRepository[this.state]; + if ( + (bt(t) && (t = this.getSelectedOptionLabel(this.state)), + bt(t) && + P(this.initialOptionLabel) && + this.state === this.initialState) + ) + ((t = this.initialOptionLabel), + P(this.state) && (this.labelRepository[this.state] = t)); + else if (bt(t) && this.getOptionLabelUsing) + try { + ((t = await this.getOptionLabelUsing()), + P(t) && + P(this.state) && + (this.labelRepository[this.state] = t)); + } catch (e) { + (console.error("Error fetching option label:", e), + (t = this.state)); + } + else bt(t) && (t = this.state); + return t; + } + addSingleSelectionDisplay(t, e = this.selectedDisplay) { + let i = document.createElement("span"); + if ( + ((i.className = "fi-select-input-value-label"), + this.isHtmlAllowed ? (i.innerHTML = t) : (i.textContent = t), + e.appendChild(i), + !this.canSelectPlaceholder || + this.container.querySelector( + ".fi-select-input-value-remove-btn", + )) + ) + return; + let o = document.createElement("button"); + ((o.type = "button"), + (o.className = "fi-select-input-value-remove-btn"), + (o.innerHTML = + ''), + o.setAttribute("aria-label", "Clear selection"), + o.addEventListener("click", (s) => { + (s.stopPropagation(), this.selectOption("")); + }), + o.addEventListener("keydown", (s) => { + (s.key === " " || s.key === "Enter") && + (s.preventDefault(), + s.stopPropagation(), + this.selectOption("")); + }), + this.container.appendChild(o), + this.container.classList.add("fi-select-input-ctn-clearable")); + } + getSelectedOptionLabel(t) { + if (P(this.labelRepository[t])) return this.labelRepository[t]; + let e = ""; + for (let i of this.options) + if (i.options && Array.isArray(i.options)) { + for (let o of i.options) + if (o.value === t) { + ((e = o.label), (this.labelRepository[t] = e)); + break; + } + } else if (i.value === t) { + ((e = i.label), (this.labelRepository[t] = e)); + break; + } + return e; + } + setUbEventListeners() { + ((this.buttonClickListener = () => { + this.toggleDropdown(); + }), + (this.documentClickListener = (t) => { + !this.container.contains(t.target) && + this.isOpen && + this.closeDropdown(); + }), + (this.buttonKeydownListener = (t) => { + this.isDisabled || this.handleSelectButtonKeydown(t); + }), + (this.dropdownKeydownListener = (t) => { + this.isDisabled || + (this.isSearchable && + document.activeElement === this.searchInput && + !["Tab", "Escape"].includes(t.key)) || + this.handleDropdownKeydown(t); + }), + this.selectButton.addEventListener( + "click", + this.buttonClickListener, + ), + document.addEventListener("click", this.documentClickListener), + this.selectButton.addEventListener( + "keydown", + this.buttonKeydownListener, + ), + this.dropdown.addEventListener( + "keydown", + this.dropdownKeydownListener, + ), + !this.isMultiple && + this.livewireId && + this.statePath && + this.getOptionLabelUsing && + ((this.refreshOptionLabelListener = async (t) => { + if ( + t.detail.livewireId === this.livewireId && + t.detail.statePath === this.statePath && + P(this.state) + ) + try { + delete this.labelRepository[this.state]; + let e = await this.getOptionLabelUsing(); + P(e) && (this.labelRepository[this.state] = e); + let i = this.selectedDisplay.querySelector( + ".fi-select-input-value-label", + ); + (P(i) && + (this.isHtmlAllowed + ? (i.innerHTML = e) + : (i.textContent = e)), + this.updateOptionLabelInList(this.state, e)); + } catch (e) { + console.error("Error refreshing option label:", e); + } + }), + window.addEventListener( + "filament-forms::select.refreshSelectedOptionLabel", + this.refreshOptionLabelListener, + ))); + } + updateOptionLabelInList(t, e) { + this.labelRepository[t] = e; + let i = this.getVisibleOptions(); + for (let o of i) + if (o.getAttribute("data-value") === String(t)) { + if (((o.innerHTML = ""), this.isHtmlAllowed)) { + let s = document.createElement("span"); + ((s.innerHTML = e), o.appendChild(s)); + } else o.appendChild(document.createTextNode(e)); + break; + } + for (let o of this.options) + if (o.options && Array.isArray(o.options)) { + for (let s of o.options) + if (s.value === t) { + s.label = e; + break; + } + } else if (o.value === t) { + o.label = e; + break; + } + for (let o of this.originalOptions) + if (o.options && Array.isArray(o.options)) { + for (let s of o.options) + if (s.value === t) { + s.label = e; + break; + } + } else if (o.value === t) { + o.label = e; + break; + } + } + handleSelectButtonKeydown(t) { + switch (t.key) { + case "ArrowDown": + (t.preventDefault(), + t.stopPropagation(), + this.isOpen ? this.focusNextOption() : this.openDropdown()); + break; + case "ArrowUp": + (t.preventDefault(), + t.stopPropagation(), + this.isOpen + ? this.focusPreviousOption() + : this.openDropdown()); + break; + case " ": + if ((t.preventDefault(), this.isOpen)) { + if (this.selectedIndex >= 0) { + let e = this.getVisibleOptions()[this.selectedIndex]; + e && e.click(); + } + } else this.openDropdown(); + break; + case "Enter": + break; + case "Escape": + this.isOpen && (t.preventDefault(), this.closeDropdown()); + break; + case "Tab": + this.isOpen && this.closeDropdown(); + break; + default: + if ( + this.isSearchable && + !t.ctrlKey && + !t.metaKey && + !t.altKey && + typeof t.key == "string" && + t.key.length === 1 + ) { + t.preventDefault(); + let e = t.key; + (this.isOpen || this.openDropdown(), + this.searchInput && + (this.searchInput.focus(), + (this.searchInput.value = + (this.searchInput.value || "") + e), + this.searchInput.dispatchEvent( + new Event("input", { bubbles: !0 }), + ))); + } + break; + } + } + handleDropdownKeydown(t) { + switch (t.key) { + case "ArrowDown": + (t.preventDefault(), + t.stopPropagation(), + this.focusNextOption()); + break; + case "ArrowUp": + (t.preventDefault(), + t.stopPropagation(), + this.focusPreviousOption()); + break; + case " ": + if ((t.preventDefault(), this.selectedIndex >= 0)) { + let e = this.getVisibleOptions()[this.selectedIndex]; + e && e.click(); + } + break; + case "Enter": + if ((t.preventDefault(), this.selectedIndex >= 0)) { + let e = this.getVisibleOptions()[this.selectedIndex]; + e && e.click(); + } else { + let e = this.element.closest("form"); + e && e.submit(); + } + break; + case "Escape": + (t.preventDefault(), + this.closeDropdown(), + this.selectButton.focus()); + break; + case "Tab": + this.closeDropdown(); + break; + default: + if ( + this.isSearchable && + !t.ctrlKey && + !t.metaKey && + !t.altKey && + typeof t.key == "string" && + t.key.length === 1 + ) { + t.preventDefault(); + let e = t.key; + this.searchInput && + (this.searchInput.focus(), + (this.searchInput.value = + (this.searchInput.value || "") + e), + this.searchInput.dispatchEvent( + new Event("input", { bubbles: !0 }), + )); + } + break; + } + } + toggleDropdown() { + if (!this.isDisabled) { + if (this.isOpen) { + this.closeDropdown(); + return; + } + (this.isMultiple && + !this.isSearchable && + !this.hasAvailableOptions()) || + this.openDropdown(); + } + } + hasAvailableOptions() { + for (let t of this.options) + if (t.options && Array.isArray(t.options)) { + for (let e of t.options) + if ( + !Array.isArray(this.state) || + !this.state.includes(e.value) + ) + return !0; + } else if ( + !Array.isArray(this.state) || + !this.state.includes(t.value) + ) + return !0; + return !1; + } + async openDropdown() { + ((this.dropdown.style.display = "block"), + (this.dropdown.style.opacity = "0")); + let t = + this.selectButton.closest(".fi-fixed-positioning-context") !== + null && + this.selectButton.closest(".fi-absolute-positioning-context") === + null; + if ( + ((this.dropdown.style.position = t ? "fixed" : "absolute"), + (this.dropdown.style.width = `${this.selectButton.offsetWidth}px`), + this.selectButton.setAttribute("aria-expanded", "true"), + (this.isOpen = !0), + this.positionDropdown(), + this.resizeListener || + ((this.resizeListener = () => { + ((this.dropdown.style.width = `${this.selectButton.offsetWidth}px`), + this.positionDropdown()); + }), + window.addEventListener("resize", this.resizeListener)), + this.scrollListener || + ((this.scrollListener = () => this.positionDropdown()), + window.addEventListener("scroll", this.scrollListener, !0)), + (this.dropdown.style.opacity = "1"), + this.isSearchable && + this.searchInput && + ((this.searchInput.value = ""), + (this.searchQuery = ""), + this.hasDynamicOptions || + ((this.options = JSON.parse( + JSON.stringify(this.originalOptions), + )), + this.renderOptions())), + this.hasDynamicOptions && this.getOptionsUsing) + ) { + this.showLoadingState(!1); + try { + let e = await this.getOptionsUsing(), + i = Array.isArray(e) + ? e + : e && Array.isArray(e.options) + ? e.options + : []; + if ( + ((this.options = i), + (this.originalOptions = JSON.parse(JSON.stringify(i))), + this.populateLabelRepositoryFromOptions(i), + this.isSearchable && + this.searchInput && + ((this.searchInput.value && + this.searchInput.value.trim() !== "") || + (this.searchQuery && + this.searchQuery.trim() !== ""))) + ) { + let o = (this.searchInput.value || this.searchQuery || "") + .trim() + .toLowerCase(); + (this.hideLoadingState(), this.filterOptions(o)); + } else this.renderOptions(); + } catch (e) { + (console.error("Error fetching options:", e), + this.hideLoadingState()); + } + } else + (!this.hasInitialNoOptionsMessage || this.searchQuery) && + this.hideLoadingState(); + if (this.isSearchable && this.searchInput) this.searchInput.focus(); + else { + this.selectedIndex = -1; + let e = this.getVisibleOptions(); + if (this.isMultiple) { + if (Array.isArray(this.state) && this.state.length > 0) { + for (let i = 0; i < e.length; i++) + if ( + this.state.includes(e[i].getAttribute("data-value")) + ) { + this.selectedIndex = i; + break; + } + } + } else + for (let i = 0; i < e.length; i++) + if (e[i].getAttribute("data-value") === this.state) { + this.selectedIndex = i; + break; + } + (this.selectedIndex === -1 && + e.length > 0 && + (this.selectedIndex = 0), + this.selectedIndex >= 0 && + (e[this.selectedIndex].classList.add("fi-selected"), + e[this.selectedIndex].focus())); + } + } + positionDropdown() { + let t = this.position === "top" ? "top-start" : "bottom-start", + e = [yi(4), Si({ padding: 5 })]; + this.position !== "top" && this.position !== "bottom" && e.push(xi()); + let i = + this.selectButton.closest(".fi-fixed-positioning-context") !== + null && + this.selectButton.closest(".fi-absolute-positioning-context") === + null; + Oi(this.selectButton, this.dropdown, { + placement: t, + middleware: e, + strategy: i ? "fixed" : "absolute", + }).then(({ x: o, y: s }) => { + Object.assign(this.dropdown.style, { + left: `${o}px`, + top: `${s}px`, + }); + }); + } + deferPositionDropdown() { + this.isOpen && + (this.positioningRequestAnimationFrame && + (cancelAnimationFrame(this.positioningRequestAnimationFrame), + (this.positioningRequestAnimationFrame = null)), + (this.positioningRequestAnimationFrame = requestAnimationFrame( + () => { + (this.positionDropdown(), + (this.positioningRequestAnimationFrame = null)); + }, + ))); + } + closeDropdown() { + ((this.dropdown.style.display = "none"), + this.selectButton.setAttribute("aria-expanded", "false"), + (this.isOpen = !1), + this.searchTimeout && + (clearTimeout(this.searchTimeout), (this.searchTimeout = null)), + this.activeSearchId++, + (this.isSearching = !1), + this.hideLoadingState(), + this.resizeListener && + (window.removeEventListener("resize", this.resizeListener), + (this.resizeListener = null)), + this.scrollListener && + (window.removeEventListener("scroll", this.scrollListener, !0), + (this.scrollListener = null)), + this.getVisibleOptions().forEach((e) => { + e.classList.remove("fi-selected"); + }), + this.dropdown.removeAttribute("aria-activedescendant")); + } + focusNextOption() { + let t = this.getVisibleOptions(); + if (t.length !== 0) { + if ( + (this.selectedIndex >= 0 && + this.selectedIndex < t.length && + t[this.selectedIndex].classList.remove("fi-selected"), + this.selectedIndex === t.length - 1 && + this.isSearchable && + this.searchInput) + ) { + ((this.selectedIndex = -1), + this.searchInput.focus(), + this.dropdown.removeAttribute("aria-activedescendant")); + return; + } + ((this.selectedIndex = (this.selectedIndex + 1) % t.length), + t[this.selectedIndex].classList.add("fi-selected"), + t[this.selectedIndex].focus(), + t[this.selectedIndex].id && + this.dropdown.setAttribute( + "aria-activedescendant", + t[this.selectedIndex].id, + ), + this.scrollOptionIntoView(t[this.selectedIndex])); + } + } + focusPreviousOption() { + let t = this.getVisibleOptions(); + if (t.length !== 0) { + if ( + (this.selectedIndex >= 0 && + this.selectedIndex < t.length && + t[this.selectedIndex].classList.remove("fi-selected"), + (this.selectedIndex === 0 || this.selectedIndex === -1) && + this.isSearchable && + this.searchInput) + ) { + ((this.selectedIndex = -1), + this.searchInput.focus(), + this.dropdown.removeAttribute("aria-activedescendant")); + return; + } + ((this.selectedIndex = + (this.selectedIndex - 1 + t.length) % t.length), + t[this.selectedIndex].classList.add("fi-selected"), + t[this.selectedIndex].focus(), + t[this.selectedIndex].id && + this.dropdown.setAttribute( + "aria-activedescendant", + t[this.selectedIndex].id, + ), + this.scrollOptionIntoView(t[this.selectedIndex])); + } + } + scrollOptionIntoView(t) { + if (!t) return; + let e = this.dropdown.getBoundingClientRect(), + i = t.getBoundingClientRect(); + i.bottom > e.bottom + ? (this.dropdown.scrollTop += i.bottom - e.bottom) + : i.top < e.top && (this.dropdown.scrollTop -= e.top - i.top); + } + getVisibleOptions() { + let t = []; + this.optionsList.classList.contains("fi-dropdown-list") + ? (t = Array.from( + this.optionsList.querySelectorAll( + ':scope > li[role="option"]', + ), + )) + : (t = Array.from( + this.optionsList.querySelectorAll( + ':scope > ul.fi-dropdown-list > li[role="option"]', + ), + )); + let e = Array.from( + this.optionsList.querySelectorAll( + 'li.fi-select-input-option-group > ul > li[role="option"]', + ), + ); + return [...t, ...e]; + } + getSelectedOptionLabels() { + if (!Array.isArray(this.state) || this.state.length === 0) return {}; + let t = {}; + for (let e of this.state) { + let i = !1; + for (let o of this.options) + if (o.options && Array.isArray(o.options)) { + for (let s of o.options) + if (s.value === e) { + ((t[e] = s.label), (i = !0)); + break; + } + if (i) break; + } else if (o.value === e) { + ((t[e] = o.label), (i = !0)); + break; + } + } + return t; + } + handleSearch(t) { + let e = t.target.value.trim(); + if ( + ((this.searchQuery = e), + this.searchTimeout && clearTimeout(this.searchTimeout), + e === "") + ) { + ((this.options = JSON.parse(JSON.stringify(this.originalOptions))), + this.renderOptions()); + return; + } + if ( + !this.getSearchResultsUsing || + typeof this.getSearchResultsUsing != "function" || + !this.hasDynamicSearchResults + ) { + this.filterOptions(e); + return; + } + this.searchTimeout = setTimeout(async () => { + this.searchTimeout = null; + let i = ++this.activeSearchId; + this.isSearching = !0; + try { + this.showLoadingState(!0); + let o = await this.getSearchResultsUsing(e); + if (i !== this.activeSearchId || !this.isOpen) return; + let s = Array.isArray(o) + ? o + : o && Array.isArray(o.options) + ? o.options + : []; + ((this.options = s), + this.populateLabelRepositoryFromOptions(s), + this.hideLoadingState(), + this.renderOptions(), + this.isOpen && this.deferPositionDropdown(), + this.options.length === 0 && this.showNoResultsMessage()); + } catch (o) { + i === this.activeSearchId && + (console.error("Error fetching search results:", o), + this.hideLoadingState(), + (this.options = JSON.parse( + JSON.stringify(this.originalOptions), + )), + this.renderOptions()); + } finally { + i === this.activeSearchId && (this.isSearching = !1); + } + }, this.searchDebounce); + } + showLoadingState(t = !1) { + (this.optionsList.parentNode === this.dropdown && + this.dropdown.removeChild(this.optionsList), + this.hideLoadingState()); + let e = document.createElement("div"); + ((e.className = "fi-select-input-message"), + (e.textContent = t ? this.searchingMessage : this.loadingMessage), + this.dropdown.appendChild(e), + this.isOpen && this.deferPositionDropdown()); + } + hideLoadingState() { + let t = this.dropdown.querySelector(".fi-select-input-message"); + t && t.remove(); + } + showNoOptionsMessage() { + (this.optionsList.parentNode === this.dropdown && + this.dropdown.removeChild(this.optionsList), + this.hideLoadingState()); + let t = document.createElement("div"); + ((t.className = "fi-select-input-message"), + (t.textContent = this.noOptionsMessage), + this.dropdown.appendChild(t), + this.isOpen && this.deferPositionDropdown()); + } + showNoResultsMessage() { + (this.optionsList.parentNode === this.dropdown && + this.dropdown.removeChild(this.optionsList), + this.hideLoadingState()); + let t = document.createElement("div"); + ((t.className = "fi-select-input-message"), + (t.textContent = this.noSearchResultsMessage), + this.dropdown.appendChild(t), + this.isOpen && this.deferPositionDropdown()); + } + filterOptions(t) { + let e = this.searchableOptionFields.includes("label"), + i = this.searchableOptionFields.includes("value"); + t = t.toLowerCase(); + let o = []; + for (let s of this.originalOptions) + if (s.options && Array.isArray(s.options)) { + let r = s.options.filter( + (a) => + (e && a.label.toLowerCase().includes(t)) || + (i && String(a.value).toLowerCase().includes(t)), + ); + r.length > 0 && o.push({ label: s.label, options: r }); + } else + ((e && s.label.toLowerCase().includes(t)) || + (i && String(s.value).toLowerCase().includes(t))) && + o.push(s); + ((this.options = o), + this.renderOptions(), + this.options.length === 0 && this.showNoResultsMessage(), + this.isOpen && this.positionDropdown()); + } + selectOption(t) { + if (this.isDisabled) return; + if (!this.isMultiple) { + ((this.state = t), + this.updateSelectedDisplay(), + this.renderOptions(), + this.closeDropdown(), + this.selectButton.focus(), + this.onStateChange(this.state)); + return; + } + let e = Array.isArray(this.state) ? [...this.state] : []; + if (e.includes(t)) { + let o = this.selectedDisplay.querySelector(`[data-value="${t}"]`); + if (P(o)) { + let s = o.parentElement; + P(s) && s.children.length === 1 + ? ((e = e.filter((r) => r !== t)), + (this.state = e), + this.updateSelectedDisplay()) + : (o.remove(), + (e = e.filter((r) => r !== t)), + (this.state = e)); + } else + ((e = e.filter((s) => s !== t)), + (this.state = e), + this.updateSelectedDisplay()); + (this.renderOptions(), + this.isOpen && this.deferPositionDropdown(), + this.maintainFocusInMultipleMode(), + this.onStateChange(this.state)); + return; + } + if (this.maxItems && e.length >= this.maxItems) { + this.maxItemsMessage && alert(this.maxItemsMessage); + return; + } + (e.push(t), (this.state = e)); + let i = this.selectedDisplay.querySelector( + ".fi-select-input-value-badges-ctn", + ); + (bt(i) ? this.updateSelectedDisplay() : this.addSingleBadge(t, i), + this.renderOptions(), + this.isOpen && this.deferPositionDropdown(), + this.maintainFocusInMultipleMode(), + this.onStateChange(this.state)); + } + async addSingleBadge(t, e) { + let i = this.labelRepository[t]; + if ( + (bt(i) && + ((i = this.getSelectedOptionLabel(t)), + P(i) && (this.labelRepository[t] = i)), + bt(i) && this.getOptionLabelsUsing) + ) + try { + let s = await this.getOptionLabelsUsing(); + for (let r of s) + if (P(r) && r.value === t && r.label !== void 0) { + ((i = r.label), (this.labelRepository[t] = i)); + break; + } + } catch (s) { + console.error("Error fetching option label:", s); + } + bt(i) && (i = t); + let o = this.createBadgeElement(t, i); + e.appendChild(o); + } + maintainFocusInMultipleMode() { + if (this.isSearchable && this.searchInput) { + this.searchInput.focus(); + return; + } + let t = this.getVisibleOptions(); + if (t.length !== 0) { + if ( + ((this.selectedIndex = -1), + Array.isArray(this.state) && this.state.length > 0) + ) { + for (let e = 0; e < t.length; e++) + if (this.state.includes(t[e].getAttribute("data-value"))) { + this.selectedIndex = e; + break; + } + } + (this.selectedIndex === -1 && (this.selectedIndex = 0), + t[this.selectedIndex].classList.add("fi-selected"), + t[this.selectedIndex].focus()); + } + } + disable() { + this.isDisabled || + ((this.isDisabled = !0), + this.applyDisabledState(), + this.isOpen && this.closeDropdown()); + } + enable() { + this.isDisabled && ((this.isDisabled = !1), this.applyDisabledState()); + } + applyDisabledState() { + if (this.isDisabled) { + if ( + (this.selectButton.setAttribute("disabled", "disabled"), + this.selectButton.setAttribute("aria-disabled", "true"), + this.selectButton.classList.add("fi-disabled"), + this.isMultiple && + this.container + .querySelectorAll(".fi-select-input-badge-remove") + .forEach((e) => { + (e.setAttribute("disabled", "disabled"), + e.classList.add("fi-disabled")); + }), + !this.isMultiple && this.canSelectPlaceholder) + ) { + let t = this.container.querySelector( + ".fi-select-input-value-remove-btn", + ); + t && + (t.setAttribute("disabled", "disabled"), + t.classList.add("fi-disabled")); + } + this.isSearchable && + this.searchInput && + (this.searchInput.setAttribute("disabled", "disabled"), + this.searchInput.classList.add("fi-disabled")); + } else { + if ( + (this.selectButton.removeAttribute("disabled"), + this.selectButton.removeAttribute("aria-disabled"), + this.selectButton.classList.remove("fi-disabled"), + this.isMultiple && + this.container + .querySelectorAll(".fi-select-input-badge-remove") + .forEach((e) => { + (e.removeAttribute("disabled"), + e.classList.remove("fi-disabled")); + }), + !this.isMultiple && this.canSelectPlaceholder) + ) { + let t = this.container.querySelector( + ".fi-select-input-value-remove-btn", + ); + t && + (t.removeAttribute("disabled"), + t.classList.add("fi-disabled")); + } + this.isSearchable && + this.searchInput && + (this.searchInput.removeAttribute("disabled"), + this.searchInput.classList.remove("fi-disabled")); + } + } + destroy() { + (this.selectButton && + this.buttonClickListener && + this.selectButton.removeEventListener( + "click", + this.buttonClickListener, + ), + this.documentClickListener && + document.removeEventListener( + "click", + this.documentClickListener, + ), + this.selectButton && + this.buttonKeydownListener && + this.selectButton.removeEventListener( + "keydown", + this.buttonKeydownListener, + ), + this.dropdown && + this.dropdownKeydownListener && + this.dropdown.removeEventListener( + "keydown", + this.dropdownKeydownListener, + ), + this.resizeListener && + (window.removeEventListener("resize", this.resizeListener), + (this.resizeListener = null)), + this.scrollListener && + (window.removeEventListener("scroll", this.scrollListener, !0), + (this.scrollListener = null)), + this.refreshOptionLabelListener && + window.removeEventListener( + "filament-forms::select.refreshSelectedOptionLabel", + this.refreshOptionLabelListener, + ), + this.isOpen && this.closeDropdown(), + this.searchTimeout && + (clearTimeout(this.searchTimeout), (this.searchTimeout = null)), + this.container && this.container.remove()); + } +}; +function Qn({ + canOptionLabelsWrap: n, + canSelectPlaceholder: t, + getOptionLabelUsing: e, + getOptionsUsing: i, + getSearchResultsUsing: o, + hasDynamicOptions: s, + hasDynamicSearchResults: r, + hasInitialNoOptionsMessage: a, + initialOptionLabel: l, + isDisabled: c, + isHtmlAllowed: f, + isNative: d, + isSearchable: p, + loadingMessage: u, + name: g, + noOptionsMessage: m, + noSearchResultsMessage: S, + options: E, + optionsLimit: y, + placeholder: D, + position: A, + recordKey: C, + searchableOptionFields: F, + searchDebounce: q, + searchingMessage: J, + searchPrompt: _, + state: W, +}) { + return { + error: void 0, + isLoading: !1, + select: null, + state: W, + unsubscribeLivewireHook: null, + init() { + (d || + (this.select = new Ee({ + canOptionLabelsWrap: n, + canSelectPlaceholder: t, + element: this.$refs.select, + getOptionLabelUsing: e, + getOptionsUsing: i, + getSearchResultsUsing: o, + hasDynamicOptions: s, + hasDynamicSearchResults: r, + hasInitialNoOptionsMessage: a, + initialOptionLabel: l, + isDisabled: c, + isHtmlAllowed: f, + isSearchable: p, + loadingMessage: u, + noOptionsMessage: m, + noSearchResultsMessage: S, + onStateChange: (L) => { + this.state = L; + }, + options: E, + optionsLimit: y, + placeholder: D, + position: A, + searchableOptionFields: F, + searchDebounce: q, + searchingMessage: J, + searchPrompt: _, + state: this.state, + })), + (this.unsubscribeLivewireHook = Livewire.interceptMessage( + ({ message: L, onSuccess: X }) => { + X(() => { + this.$nextTick(() => { + if ( + this.isLoading || + L.component.id !== + this.$root.closest("[wire\\:id]") + ?.attributes["wire:id"].value + ) + return; + let M = this.getServerState(); + M === void 0 || + this.getNormalizedState() === M || + (this.state = M); + }); + }); + }, + )), + this.$watch("state", async (L) => { + !d && + this.select && + this.select.state !== L && + ((this.select.state = L), + this.select.updateSelectedDisplay(), + this.select.renderOptions()); + let X = this.getServerState(); + if (X === void 0 || this.getNormalizedState() === X) return; + this.isLoading = !0; + let M = await this.$wire.updateTableColumnState( + g, + C, + this.state, + ); + ((this.error = M?.error ?? void 0), + !this.error && + this.$refs.serverState && + (this.$refs.serverState.value = + this.getNormalizedState()), + (this.isLoading = !1)); + })); + }, + getServerState() { + if (this.$refs.serverState) + return [null, void 0].includes(this.$refs.serverState.value) + ? "" + : this.$refs.serverState.value.replaceAll('\\"', '"'); + }, + getNormalizedState() { + let L = Alpine.raw(this.state); + return [null, void 0].includes(L) ? "" : L; + }, + destroy() { + (this.unsubscribeLivewireHook?.(), + this.select && (this.select.destroy(), (this.select = null))); + }, + }; +} +export { Qn as default }; /*! Bundled license information: sortablejs/modular/sortable.esm.js: