diff --git a/.gitattributes b/.gitattributes index 3383d44..b37039a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,13 +1,8 @@ +* text=auto -# Path-based git attributes -# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html +*.md diff=markdown -# Ignore all test and documentation with "export-ignore". -/.gitattributes export-ignore -/.gitignore export-ignore -/.travis.yml export-ignore -/phpunit.xml.dist export-ignore -/.scrutinizer.yml export-ignore -/.styleci.yml export-ignore -/tests export-ignore -/.editorconfig export-ignore +/.github export-ignore +/.gitattributes export-ignore +/.gitignore export-ignore +/.editorconfig export-ignore diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md deleted file mode 100644 index b4ae1c4..0000000 --- a/.github/CONTRIBUTING.md +++ /dev/null @@ -1,55 +0,0 @@ -# Contributing - -Contributions are **welcome** and will be fully **credited**. - -Please read and understand the contribution guide before creating an issue or pull request. - -## Etiquette - -This project is open source, and as such, the maintainers give their free time to build and maintain the source code -held within. They make the code freely available in the hope that it will be of use to other developers. It would be -extremely unfair for them to suffer abuse or anger for their hard work. - -Please be considerate towards maintainers when raising issues or presenting pull requests. Let's show the -world that developers are civilized and selfless people. - -It's the duty of the maintainer to ensure that all submissions to the project are of sufficient -quality to benefit the project. Many developers have different skillsets, strengths, and weaknesses. Respect the maintainer's decision, and do not be upset or abusive if your submission is not used. - -## Viability - -When requesting or submitting new features, first consider whether it might be useful to others. Open -source projects are used by many developers, who may have entirely different needs to your own. Think about -whether or not your feature is likely to be used by other users of the project. - -## Procedure - -Before filing an issue: - -- Attempt to replicate the problem, to ensure that it wasn't a coincidental incident. -- Check to make sure your feature suggestion isn't already present within the project. -- Check the pull requests tab to ensure that the bug doesn't have a fix in progress. -- Check the pull requests tab to ensure that the feature isn't already in progress. - -Before submitting a pull request: - -- Check the codebase to ensure that your feature doesn't already exist. -- Check the pull requests to ensure that another person hasn't already submitted the feature or fix. - -## Requirements - -If the project maintainer has any additional requirements, you will find them listed here. - -- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](https://pear.php.net/package/PHP_CodeSniffer). - -- **Add tests!** - Your patch won't be accepted if it doesn't have tests. - -- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date. - -- **Consider our release cycle** - We try to follow [SemVer v2.0.0](https://semver.org/). Randomly breaking public APIs is not an option. - -- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests. - -- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](https://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting. - -**Happy coding**! diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index c386363..895dabf 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,5 +1,2 @@ github: yoeunes -patreon: yoeunes -ko_fi: yoeunes -open_collective: php-flasher custom: https://www.paypal.com/paypalme/yoeunes diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 7f9e94c..0000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: '' -labels: '' -assignees: '' - ---- - -**Describe the bug** -A clear and concise description of what the bug is. - -**To Reproduce** -Steps to reproduce the behavior: -1. Go to '...' -2. Click on '....' -3. Scroll down to '....' -4. See error - -**Expected behavior** -A clear and concise description of what you expected to happen. - -**Screenshots** -If applicable, add screenshots to help explain your problem. - -**Desktop (please complete the following information):** - - OS: [e.g. Windows 10, iOS] - - Browser [e.g. chrome, safari] - - Version [e.g. 22] - -**Smartphone (please complete the following information):** - - Device: [e.g. iPhone6] - - OS: [e.g. iOS8.1] - - Browser [e.g. stock browser, safari] - - Version [e.g. 22] - -**Severity** -- [ ] High -- [ ] Medium -- [ ] Low - -**Related Issues** -- # - -**Additional context** - - Provide version of the yoeunes/toastr. - - Provide the error log or any other relevant debugging information. - - Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index 2d67493..0000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: '' -labels: '' -assignees: '' - ---- - -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - -**Describe the solution you'd like** -A clear and concise description of what you want to happen. - -**Describe the benefit of the solution** -A clear and concise description of the benefit of the solution. - -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered and why they are not suitable. - -**User Impact** -- [ ] High -- [ ] Medium -- [ ] Low - -**Related Issues** -- # - -**Additional context** -- Provide examples of how the feature will be used in the real world. -- Provide any relevant user stories or use cases. -- Add any other context or screenshots about the feature request here. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index ac78416..0000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,23 +0,0 @@ -## What does this PR do? -- [ ] Summarize the changes made in a sentence or two -- [ ] List the affected files or modules -- [ ] Describe any notable features or improvements - -## Description of Task to be completed -- [ ] Provide a detailed description of the task or issue that this PR addresses - -## How should this be manually tested? -- [ ] Provide a step-by-step guide for how to test the changes -- [ ] List any test data or prerequisites that are needed - -## Relevant Issues -- # - -## Background context -- [ ] Add any relevant information that will help reviewers understand the context of this PR - -## Screenshots (Optional) -- [ ] Add screenshots of the changes made (if applicable) - -## Dependencies -- [ ] List any dependencies or external libraries that are required for the changes diff --git a/.github/SECURITY.md b/.github/SECURITY.md deleted file mode 100644 index d9b55dd..0000000 --- a/.github/SECURITY.md +++ /dev/null @@ -1,3 +0,0 @@ -# Security Policy - -If you discover any security related issues, please email younes.khoubza@gmail.com instead of using the issue tracker. diff --git a/.github/workflows/issues.yml b/.github/workflows/issues.yml deleted file mode 100644 index 7d58ca7..0000000 --- a/.github/workflows/issues.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: issues - -on: - workflow_call: - -jobs: - help-wanted: - if: github.event.label.name == 'help wanted' - - runs-on: ubuntu-latest - - steps: - - name: Add comment - uses: peter-evans/create-or-update-comment@v2 - with: - issue-number: ${{ github.event.issue.number }} - body: | - Thank you for reporting this issue! - - As yoeunes/toastr is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub. - - If possible, please make a pull request fixing the issue you have described, along with corresponding tests. All pull requests are promptly reviewed. - - Thank you! diff --git a/.gitignore b/.gitignore index cc20fcc..4f38912 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,3 @@ .idea vendor composer.lock -.phpunit.result.cache -.phpcs-cache -.php-cs-fixer.cache diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php deleted file mode 100644 index 9e4c562..0000000 --- a/.php-cs-fixer.dist.php +++ /dev/null @@ -1,28 +0,0 @@ - - */ - -$header = <<<'EOF' -This file is part of the yoeunes/toastr package. -(c) Younes KHOUBZA -EOF; - -$rules = array( - '@Symfony' => true, - 'header_comment' => array('header' => $header), - 'array_syntax' => array('syntax' => 'long'), - 'visibility_required' => array('elements' => array('property', 'method')), -); - -$finder = new PhpCsFixer\Finder(); -$finder->in(__DIR__)->exclude(__DIR__.'/vendor'); - -$config = new PhpCsFixer\Config(); - -return $config->setFinder($finder) - ->setUsingCache(false) - ->setRiskyAllowed(true) - ->setRules($rules); diff --git a/.phpstorm.meta.php b/.phpstorm.meta.php deleted file mode 100644 index 37fac18..0000000 --- a/.phpstorm.meta.php +++ /dev/null @@ -1,16 +0,0 @@ - \Flasher\Toastr\Prime\ToastrFactory::class -]); - -override(\Flasher\Prime\FlasherInterface::create(), map($mapping)); -override(\Flasher\Prime\FlasherInterface::using(), map($mapping)); diff --git a/LICENSE b/LICENSE index 0291dab..0d555f4 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2017 yoeunes +Copyright (c) 2024 yoeunes Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 263fe7a..06a093c 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,10 @@

toastr

+## Version 3 Update + +With the release of version 3, `yoeunes/toastr` is now powered by [PHPFlasher](https://github.com/php-flasher/php-flasher). When you install this package, it automatically utilizes [PHPFlasher](https://packagist.org/packages/php-flasher/flasher-toastr-laravel) under the hood. For those who are already using [PHPFlasher](https://php-flasher.io/library/toastr/) or are interested in a more direct implementation, you might consider using [PHPFlasher](https://php-flasher.io/library/toastr/) directly as it offers the same API and additional features. + ## Install You can install the package using composer @@ -19,15 +23,21 @@ You can install the package using composer composer require yoeunes/toastr ``` +After installation, publish the assets using: + +```bash +php artisan flasher:install +``` + ## Usage: The usage of this package is very simple and straightforward. it only required one step to use it : -Use `toastr()` helper function inside your controller to set a toast notification for info, success, warning or error +Use `toastr()` helper function inside your controller to set a toast notification for `info`, `success`, `warning` or `error` ```php -// Display an error toast with no title -toastr()->error('Oops! Something went wrong!'); +// Display a success toast with no title +flash()->success('Operation completed successfully.'); ``` As an example: @@ -60,119 +70,6 @@ class PostController extends Controller } ``` -### Other Options - -```php -// Set a warning toast, with no title -toastr()->warning('Are you sure you want to proceed ?'); - -// Set a success toast, with a title -toastr()->success('Data has been saved successfully!', 'Congrats'); - -// Set an error toast, with a title -toastr()->error('Oops! Something went wrong!', 'Oops!'); - -// Override global config options from 'config/toastr.php' -toastr()->success('Data has been saved successfully!', 'Congrats', ['timeOut' => 5000]); -``` - -### Other api methods: - -You can also chain multiple messages together using method chaining - -```php -toastr() - ->info('Welcome back') - ->success('Data has been saved successfully!') - ->warning('Are you sure you want to proceed ?'); -``` - -You can use `toastr('')` instead of `toastr()->success()` - -```php -function toastr(string $message = null, string $type = 'success', string $title = '', array $options = []); -``` - -So - -* `toastr($message)` is equivalent to `toastr()->success($message)` -* `toastr($message, 'info')` is equivalent to `toastr()->info($message)` -* `toastr($message, 'warning')` is equivalent to `toastr()->warning($message)` -* `toastr($message, 'error') ` is equivalent to `toastr()->error($message)` - -### configuration: - -As optional if you want to modify the default configuration, you can publish the configuration file: - -```sh -php artisan vendor:publish --provider="Yoeunes\Toastr\ToastrServiceProvider" -``` - -```php -// config/toastr.php - [ - 'closeButton' => true, - 'closeClass' => 'toast-close-button', - 'closeDuration' => 300, - 'closeEasing' => 'swing', - 'closeHtml' => '', - 'closeMethod' => 'fadeOut', - 'closeOnHover' => true, - 'containerId' => 'toast-container', - 'debug' => false, - 'escapeHtml' => false, - 'extendedTimeOut' => 10000, - 'hideDuration' => 1000, - 'hideEasing' => 'linear', - 'hideMethod' => 'fadeOut', - 'iconClass' => 'toast-info', - 'iconClasses' => [ - 'error' => 'toast-error', - 'info' => 'toast-info', - 'success' => 'toast-success', - 'warning' => 'toast-warning', - ], - 'messageClass' => 'toast-message', - 'newestOnTop' => false, - 'onHidden' => null, - 'onShown' => null, - 'positionClass' => 'toast-top-right', - 'preventDuplicates' => true, - 'progressBar' => true, - 'progressClass' => 'toast-progress', - 'rtl' => false, - 'showDuration' => 300, - 'showEasing' => 'swing', - 'showMethod' => 'fadeIn', - 'tapToDismiss' => true, - 'target' => 'body', - 'timeOut' => 5000, - 'titleClass' => 'toast-title', - 'toastClass' => 'toast', - ], -]; -``` -For a list of available options, see [toastr.js' documentation](https://github.com/CodeSeven/toastr). - -## Credits - -- [Younes Khoubza](https://github.com/yoeunes) -- [All Contributors](../../contributors) - ## License MIT diff --git a/composer.json b/composer.json index 1564524..414a63b 100644 --- a/composer.json +++ b/composer.json @@ -4,69 +4,36 @@ "license": "MIT", "type": "library", "keywords": [ + "laravel", "toastr", - "toastr js", - "php-flasher", - "flash-messages", - "notification-system", + "flash-notifications", + "dynamic-notifications", + "phpflasher", "user-feedback", - "sweetalert", - "pnotify", - "noty", - "notyf", - "desktop-notifications", - "php", - "laravel", - "symfony", - "javascript", - "yoeunes", - "framework-agnostic", - "phpstorm-auto-complete", - "custom-adapter", - "user-experience", - "rtl", - "dark-mode" + "open-source" ], "authors": [ { - "name": "Younes KHOUBZA", - "email": "younes.khoubza@gmail.com", - "homepage": "https://www.linkedin.com/in/younes-khoubza", + "name": "Younes ENNAJI", + "email": "younes.ennaji.pro@gmail.com", + "homepage": "https://www.linkedin.com/in/younes--ennaji/", "role": "Developer" } ], "homepage": "https://github.com/yoeunes/toastr", "support": { - "email": "younes.khoubza@gmail.com", - "issues": "https://github.com/yoeunes/toastr/issues", - "source": "https://github.com/yoeunes/toastr", - "docs": "https://github.com/yoeunes/toastr/README.md" + "email": "younes.ennaji.pro@gmail.com", + "issues": "https://github.com/php-flasher/php-flasher/issues", + "source": "https://github.com/php-flasher/php-flasher", + "docs": "https://php-flasher.io" }, "require": { - "php": ">=5.3", - "php-flasher/flasher-laravel": "^1.15.14" + "php": ">=8.2", + "php-flasher/flasher-toastr-laravel": "^2.0" }, "minimum-stability": "dev", "prefer-stable": true, - "autoload": { - "psr-4": { - "Yoeunes\\Toastr\\": "src" - }, - "files": [ - "src/helpers.php" - ] - }, "config": { "sort-packages": true - }, - "extra": { - "laravel": { - "aliases": { - "Toastr": "Yoeunes\\Toastr\\Facades\\Toastr" - }, - "providers": [ - "Yoeunes\\Toastr\\ToastrServiceProvider" - ] - } } } diff --git a/config/toastr.php b/config/toastr.php deleted file mode 100644 index ef227a8..0000000 --- a/config/toastr.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ - -return array( - /* - |-------------------------------------------------------------------------- - | Toastr options - |-------------------------------------------------------------------------- - | - | Here you can specify the options that will be passed to the toastr.js - | library. For a full list of options, visit the documentation. - | - | Example: - | 'options' => [ - | 'closeButton' => true, - | 'debug' => false, - | 'newestOnTop' => false, - | 'progressBar' => true, - | ], - */ - - 'options' => array(), -); diff --git a/src/Facades/Toastr.php b/src/Facades/Toastr.php deleted file mode 100644 index 74baf4e..0000000 --- a/src/Facades/Toastr.php +++ /dev/null @@ -1,30 +0,0 @@ - - */ - -namespace Yoeunes\Toastr\Facades; - -use Illuminate\Support\Facades\Facade; - -/** - * @method static \Yoeunes\Toastr\Toastr error(string $message, string $title = '', array $options = []) - * @method static \Yoeunes\Toastr\Toastr info(string $message, string $title = '', array $options = []) - * @method static \Yoeunes\Toastr\Toastr success(string $message, string $title = '', array $options = []) - * @method static \Yoeunes\Toastr\Toastr warning(string $message, string $title = '', array $options = []) - * @method static \Yoeunes\Toastr\Toastr addNotification(string $type, string $message, string $title = '', array $options = []) - */ -class Toastr extends Facade -{ - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() - { - return 'toastr'; - } -} diff --git a/src/Resources/assets/flasher-toastr.min.js b/src/Resources/assets/flasher-toastr.min.js deleted file mode 100644 index 5f181ec..0000000 --- a/src/Resources/assets/flasher-toastr.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("@flasher/flasher"),require("jquery")):"function"==typeof define&&define.amd?define(["@flasher/flasher","jquery"],e):((t="undefined"!=typeof globalThis?globalThis:t||self).flasher=t.flasher||{},t.flasher.toastr=e(t.flasher,t.jQuery))}(this,(function(t,e){"use strict";var o=function(){return o=Object.assign||function(t){for(var e,o=1,i=arguments.length;o=0;n--)l(t(i[n]),o)}(n)},remove:function(o){var i=u();e||p(i),o&&0===t(":focus",o).length?f(o):e.children().length&&e.remove()},error:function(t,e,o){return g({type:a,iconClass:u().iconClasses.error,message:t,optionsOverride:o,title:e})},getContainer:p,info:function(t,e,o){return g({type:s,iconClass:u().iconClasses.info,message:t,optionsOverride:o,title:e})},options:{},subscribe:function(t){o=t},success:function(t,e,o){return g({type:r,iconClass:u().iconClasses.success,message:t,optionsOverride:o,title:e})},version:"2.1.4",warning:function(t,e,o){return g({type:c,iconClass:u().iconClasses.warning,message:t,optionsOverride:o,title:e})}};return d;function p(o,i){return o||(o=u()),(e=t("#"+o.containerId)).length||i&&(e=function(o){return(e=t("
").attr("id",o.containerId).addClass(o.positionClass)).appendTo(t(o.target)),e}(o)),e}function l(e,o,i){var n=!(!i||!i.force)&&i.force;return!(!e||!n&&0!==t(":focus",e).length||(e[o.hideMethod]({duration:o.hideDuration,easing:o.hideEasing,complete:function(){f(e)}}),0))}function A(t){o&&o(t)}function g(o){var a=u(),s=o.iconClass||a.iconClass;if(void 0!==o.optionsOverride&&(a=t.extend(a,o.optionsOverride),s=o.optionsOverride.iconClass||s),!function(t,e){if(t.preventDuplicates){if(e.message===i)return!0;i=e.message}return!1}(a,o)){n++,e=p(a,!0);var r=null,c=t("
"),d=t("
"),l=t("
"),g=t("
"),h=t(a.closeHtml),m={intervalId:null,hideEta:null,maxHideTime:null},b={toastId:n,state:"visible",startTime:new Date,options:a,map:o};return o.iconClass&&c.addClass(a.toastClass).addClass(s),function(){if(o.title){var t=o.title;a.escapeHtml&&(t=x(o.title)),d.append(t).addClass(a.titleClass),c.append(d)}}(),function(){if(o.message){var t=o.message;a.escapeHtml&&(t=x(o.message)),l.append(t).addClass(a.messageClass),c.append(l)}}(),a.closeButton&&(h.addClass(a.closeClass).attr("role","button"),c.prepend(h)),a.progressBar&&(g.addClass(a.progressClass),c.prepend(g)),a.rtl&&c.addClass("rtl"),a.newestOnTop?e.prepend(c):e.append(c),function(){var t="";switch(o.iconClass){case"toast-success":case"toast-info":t="polite";break;default:t="assertive"}c.attr("aria-live",t)}(),c.hide(),c[a.showMethod]({duration:a.showDuration,easing:a.showEasing,complete:a.onShown}),a.timeOut>0&&(r=setTimeout(w,a.timeOut),m.maxHideTime=parseFloat(a.timeOut),m.hideEta=(new Date).getTime()+m.maxHideTime,a.progressBar&&(m.intervalId=setInterval(y,10))),a.closeOnHover&&c.hover(C,v),!a.onclick&&a.tapToDismiss&&c.click(w),a.closeButton&&h&&h.click((function(t){t.stopPropagation?t.stopPropagation():void 0!==t.cancelBubble&&!0!==t.cancelBubble&&(t.cancelBubble=!0),a.onCloseClick&&a.onCloseClick(t),w(!0)})),a.onclick&&c.click((function(t){a.onclick(t),w()})),A(b),a.debug&&console&&console.log(b),c}function x(t){return null==t&&(t=""),t.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function w(e){var o=e&&!1!==a.closeMethod?a.closeMethod:a.hideMethod,i=e&&!1!==a.closeDuration?a.closeDuration:a.hideDuration,n=e&&!1!==a.closeEasing?a.closeEasing:a.hideEasing;if(!t(":focus",c).length||e)return clearTimeout(m.intervalId),c[o]({duration:i,easing:n,complete:function(){f(c),clearTimeout(r),a.onHidden&&"hidden"!==b.state&&a.onHidden(),b.state="hidden",b.endTime=new Date,A(b)}})}function v(){(a.timeOut>0||a.extendedTimeOut>0)&&(r=setTimeout(w,a.extendedTimeOut),m.maxHideTime=parseFloat(a.extendedTimeOut),m.hideEta=(new Date).getTime()+m.maxHideTime)}function C(){clearTimeout(r),m.hideEta=0,c.stop(!0,!0)[a.showMethod]({duration:a.showDuration,easing:a.showEasing})}function y(){var t=(m.hideEta-(new Date).getTime())/m.maxHideTime*100;g.width(t+"%")}}function u(){return t.extend({},{tapToDismiss:!0,toastClass:"toast",containerId:"toast-container",debug:!1,showMethod:"fadeIn",showDuration:300,showEasing:"swing",onShown:void 0,hideMethod:"fadeOut",hideDuration:1e3,hideEasing:"swing",onHidden:void 0,closeMethod:!1,closeDuration:!1,closeEasing:!1,closeOnHover:!0,extendedTimeOut:1e3,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},iconClass:"toast-info",positionClass:"toast-top-right",timeOut:5e3,titleClass:"toast-title",messageClass:"toast-message",escapeHtml:!1,target:"body",closeHtml:'',closeClass:"toast-close-button",newestOnTop:!0,preventDuplicates:!1,progressBar:!1,progressClass:"toast-progress",rtl:!1},d.options)}function f(t){e||(e=p()),t.is(":visible")||(t.remove(),t=null,0===e.children().length&&(e.remove(),i=void 0))}}()},t.exports?t.exports=o(e):window.toastr=o(window.jQuery)}({get exports(){return i},set exports(t){i=t}});var n=i,a=[],s=[];!function(t,e){if(t&&"undefined"!=typeof document){var o,i=!0===e.prepend?"prepend":"append",n=!0===e.singleTag,r="string"==typeof e.container?document.querySelector(e.container):document.getElementsByTagName("head")[0];if(n){var c=a.indexOf(r);-1===c&&(c=a.push(r)-1,s[c]={}),o=s[c]&&s[c][i]?s[c][i]:s[c][i]=d()}else o=d();65279===t.charCodeAt(0)&&(t=t.substring(1)),o.styleSheet?o.styleSheet.cssText+=t:o.appendChild(document.createTextNode(t))}function d(){var t=document.createElement("style");if(t.setAttribute("type","text/css"),e.attributes)for(var o=Object.keys(e.attributes),n=0;ndiv{background-position:15px;background-repeat:no-repeat;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;-moz-box-shadow:0 0 12px #999;-webkit-box-shadow:0 0 12px #999;box-shadow:0 0 12px #999;color:#fff;-ms-filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=80);filter:alpha(opacity=80);margin:0 0 6px;opacity:.8;overflow:hidden;padding:15px 15px 15px 50px;pointer-events:auto;position:relative;width:300px}#toast-container>div.rtl{background-position:right 15px center;direction:rtl;padding:15px 50px 15px 15px}#toast-container>div:hover{-moz-box-shadow:0 0 12px #000;-webkit-box-shadow:0 0 12px #000;box-shadow:0 0 12px #000;cursor:pointer;-ms-filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=100);filter:alpha(opacity=100);opacity:1}#toast-container>.toast-info{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGwSURBVEhLtZa9SgNBEMc9sUxxRcoUKSzSWIhXpFMhhYWFhaBg4yPYiWCXZxBLERsLRS3EQkEfwCKdjWJAwSKCgoKCcudv4O5YLrt7EzgXhiU3/4+b2ckmwVjJSpKkQ6wAi4gwhT+z3wRBcEz0yjSseUTrcRyfsHsXmD0AmbHOC9Ii8VImnuXBPglHpQ5wwSVM7sNnTG7Za4JwDdCjxyAiH3nyA2mtaTJufiDZ5dCaqlItILh1NHatfN5skvjx9Z38m69CgzuXmZgVrPIGE763Jx9qKsRozWYw6xOHdER+nn2KkO+Bb+UV5CBN6WC6QtBgbRVozrahAbmm6HtUsgtPC19tFdxXZYBOfkbmFJ1VaHA1VAHjd0pp70oTZzvR+EVrx2Ygfdsq6eu55BHYR8hlcki+n+kERUFG8BrA0BwjeAv2M8WLQBtcy+SD6fNsmnB3AlBLrgTtVW1c2QN4bVWLATaIS60J2Du5y1TiJgjSBvFVZgTmwCU+dAZFoPxGEEs8nyHC9Bwe2GvEJv2WXZb0vjdyFT4Cxk3e/kIqlOGoVLwwPevpYHT+00T+hWwXDf4AJAOUqWcDhbwAAAAASUVORK5CYII=)!important}#toast-container>.toast-error{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHOSURBVEhLrZa/SgNBEMZzh0WKCClSCKaIYOED+AAKeQQLG8HWztLCImBrYadgIdY+gIKNYkBFSwu7CAoqCgkkoGBI/E28PdbLZmeDLgzZzcx83/zZ2SSXC1j9fr+I1Hq93g2yxH4iwM1vkoBWAdxCmpzTxfkN2RcyZNaHFIkSo10+8kgxkXIURV5HGxTmFuc75B2RfQkpxHG8aAgaAFa0tAHqYFfQ7Iwe2yhODk8+J4C7yAoRTWI3w/4klGRgR4lO7Rpn9+gvMyWp+uxFh8+H+ARlgN1nJuJuQAYvNkEnwGFck18Er4q3egEc/oO+mhLdKgRyhdNFiacC0rlOCbhNVz4H9FnAYgDBvU3QIioZlJFLJtsoHYRDfiZoUyIxqCtRpVlANq0EU4dApjrtgezPFad5S19Wgjkc0hNVnuF4HjVA6C7QrSIbylB+oZe3aHgBsqlNqKYH48jXyJKMuAbiyVJ8KzaB3eRc0pg9VwQ4niFryI68qiOi3AbjwdsfnAtk0bCjTLJKr6mrD9g8iq/S/B81hguOMlQTnVyG40wAcjnmgsCNESDrjme7wfftP4P7SP4N3CJZdvzoNyGq2c/HWOXJGsvVg+RA/k2MC/wN6I2YA2Pt8GkAAAAASUVORK5CYII=)!important}#toast-container>.toast-success{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADsSURBVEhLY2AYBfQMgf///3P8+/evAIgvA/FsIF+BavYDDWMBGroaSMMBiE8VC7AZDrIFaMFnii3AZTjUgsUUWUDA8OdAH6iQbQEhw4HyGsPEcKBXBIC4ARhex4G4BsjmweU1soIFaGg/WtoFZRIZdEvIMhxkCCjXIVsATV6gFGACs4Rsw0EGgIIH3QJYJgHSARQZDrWAB+jawzgs+Q2UO49D7jnRSRGoEFRILcdmEMWGI0cm0JJ2QpYA1RDvcmzJEWhABhD/pqrL0S0CWuABKgnRki9lLseS7g2AlqwHWQSKH4oKLrILpRGhEQCw2LiRUIa4lwAAAABJRU5ErkJggg==)!important}#toast-container>.toast-warning{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGYSURBVEhL5ZSvTsNQFMbXZGICMYGYmJhAQIJAICYQPAACiSDB8AiICQQJT4CqQEwgJvYASAQCiZiYmJhAIBATCARJy+9rTsldd8sKu1M0+dLb057v6/lbq/2rK0mS/TRNj9cWNAKPYIJII7gIxCcQ51cvqID+GIEX8ASG4B1bK5gIZFeQfoJdEXOfgX4QAQg7kH2A65yQ87lyxb27sggkAzAuFhbbg1K2kgCkB1bVwyIR9m2L7PRPIhDUIXgGtyKw575yz3lTNs6X4JXnjV+LKM/m3MydnTbtOKIjtz6VhCBq4vSm3ncdrD2lk0VgUXSVKjVDJXJzijW1RQdsU7F77He8u68koNZTz8Oz5yGa6J3H3lZ0xYgXBK2QymlWWA+RWnYhskLBv2vmE+hBMCtbA7KX5drWyRT/2JsqZ2IvfB9Y4bWDNMFbJRFmC9E74SoS0CqulwjkC0+5bpcV1CZ8NMej4pjy0U+doDQsGyo1hzVJttIjhQ7GnBtRFN1UarUlH8F3xict+HY07rEzoUGPlWcjRFRr4/gChZgc3ZL2d8oAAAAASUVORK5CYII=)!important}#toast-container.toast-bottom-center>div,#toast-container.toast-top-center>div{margin-left:auto;margin-right:auto;width:300px}#toast-container.toast-bottom-full-width>div,#toast-container.toast-top-full-width>div{margin-left:auto;margin-right:auto;width:96%}.toast{background-color:#030303}.toast-success{background-color:#51a351}.toast-error{background-color:#bd362f}.toast-info{background-color:#2f96b4}.toast-warning{background-color:#f89406}.toast-progress{background-color:#000;bottom:0;-ms-filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=40);filter:alpha(opacity=40);height:4px;left:0;opacity:.4;position:absolute}@media (max-width:240px){#toast-container>div{padding:8px 8px 8px 50px;width:11em}#toast-container>div.rtl{padding:8px 50px 8px 8px}#toast-container .toast-close-button{right:-.2em;top:-.2em}#toast-container .rtl .toast-close-button{left:-.2em;right:.2em}}@media (min-width:241px) and (max-width:480px){#toast-container>div{padding:8px 8px 8px 50px;width:18em}#toast-container>div.rtl{padding:8px 50px 8px 8px}#toast-container .toast-close-button{right:-.2em;top:-.2em}#toast-container .rtl .toast-close-button{left:-.2em;right:.2em}}@media (min-width:481px) and (max-width:768px){#toast-container>div{padding:15px 15px 15px 50px;width:25em}#toast-container>div.rtl{padding:15px 50px 15px 15px}}",{});var r=new(function(){function t(){}return t.prototype.success=function(t,e,o){this.flash("success",t,e,o)},t.prototype.info=function(t,e,o){this.flash("info",t,e,o)},t.prototype.warning=function(t,e,o){this.flash("warning",t,e,o)},t.prototype.error=function(t,e,o){this.flash("error",t,e,o)},t.prototype.flash=function(t,e,o,i){var n=this.createNotification(t,e,o,i);this.renderOptions({}),this.render({notification:n})},t.prototype.createNotification=function(t,e,o,i){if("object"==typeof t?(t=(i=t).type,e=i.message,o=i.title):"object"==typeof e?(e=(i=e).message,o=i.title):"object"==typeof o&&(o=(i=o).title),void 0===e)throw new Error("message option is required");return{type:t||"info",message:e,title:o,options:i}},t.prototype.render=function(t){var e=t.notification,o=e.message,i=e.title,a=e.options,s=e.type||"info";n[s](o,i,a).parent().attr("data-turbo-cache","false")},t.prototype.renderOptions=function(t){n.options=o({timeOut:t.timeOut||5e3,progressBar:t.progressBar||5e3},t)},t}());return t.addFactory("toastr",r),r})); diff --git a/src/Resources/assets/jquery.min.js b/src/Resources/assets/jquery.min.js deleted file mode 100644 index b5329e9..0000000 --- a/src/Resources/assets/jquery.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! jQuery v3.6.3 | (c) OpenJS Foundation and other contributors | jquery.org/license */ -!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,y=n.hasOwnProperty,a=y.toString,l=a.call(Object),v={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},S=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||S).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.6.3",E=function(e,t){return new E.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,S)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&v(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!y||!y.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ve(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=E)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{if(d.cssSupportsSelector&&!CSS.supports("selector(:is("+c+"))"))throw new Error;return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===E&&e.removeAttribute("id")}}}return g(t.replace(B,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[E]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ye(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ve(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,S=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.cssSupportsSelector=ce(function(){return CSS.supports("selector(*)")&&C.querySelectorAll(":is(:jqfake)")&&!CSS.supports("selector(:is(*,:jqfake))")}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=E,!C.getElementsByName||!C.getElementsByName(E).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&S){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&S){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&S)return t.getElementsByClassName(e)},s=[],y=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&y.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||y.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+E+"-]").length||y.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||y.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||y.push(":checked"),e.querySelectorAll("a#"+E+"+*").length||y.push(".#.+[+~]"),e.querySelectorAll("\\\f"),y.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&y.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&y.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&y.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),y.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),d.cssSupportsSelector||y.push(":has"),y=y.length&&new RegExp(y.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),v=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType&&e.documentElement||e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&v(p,e)?-1:t==C||t.ownerDocument==p&&v(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&S&&!N[t+" "]&&(!s||!s.test(t))&&(!y||!y.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?E.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?E.grep(e,function(e){return e===n!==r}):"string"!=typeof n?E.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(E.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof E?t[0]:t,E.merge(this,E.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:S,!0)),N.test(r[1])&&E.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=S.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(E):E.makeArray(e,this)}).prototype=E.fn,D=E(S);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}E.fn.extend({has:function(e){var t=E(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=S.createDocumentFragment().appendChild(S.createElement("div")),(fe=S.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),v.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",v.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",v.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ye(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?E.merge([e],n):n}function ve(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&E(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),S.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;E.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||E.expando+"_"+Ct.guid++;return this[e]=!0,e}}),E.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(St.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||E.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?E(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),v.createHTMLDocument=((Ut=S.implementation.createHTMLDocument("").body).innerHTML="
",2===Ut.childNodes.length),E.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(v.createHTMLDocument?((r=(t=S.implementation.createHTMLDocument("")).createElement("base")).href=S.location.href,t.head.appendChild(r)):t=S),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&E(o).remove(),E.merge([],i.childNodes)));var r,i,o},E.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(E.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},E.expr.pseudos.animated=function(t){return E.grep(E.timers,function(e){return t===e.elem}).length},E.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=E.css(e,"position"),c=E(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=E.css(e,"top"),u=E.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,E.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},E.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){E.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===E.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===E.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=E(e).offset()).top+=E.css(e,"borderTopWidth",!0),i.left+=E.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-E.css(r,"marginTop",!0),left:t.left-i.left-E.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===E.css(e,"position"))e=e.offsetParent;return e||re})}}),E.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;E.fn[t]=function(e){return B(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),E.each(["top","left"],function(e,n){E.cssHooks[n]=_e(v.pixelPosition,function(e,t){if(t)return t=Be(e,n),Pe.test(t)?E(e).position()[n]+"px":t})}),E.each({Height:"height",Width:"width"},function(a,s){E.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){E.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return B(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?E.css(e,t,i):E.style(e,t,n,i)},s,n?e:void 0,n)}})}),E.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){E.fn[t]=function(e){return this.on(t,e)}}),E.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),E.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){E.fn[n]=function(e,t){return 0 - */ - -return array( - 'scripts' => array( - 'cdn' => array( - 'https://cdn.jsdelivr.net/npm/jquery@3.6.3/dist/jquery.min.js', - 'https://cdn.jsdelivr.net/npm/@flasher/flasher-toastr@1.2.4/dist/flasher-toastr.min.js', - ), - 'local' => array( - '/vendor/flasher/jquery.min.js', - '/vendor/flasher/flasher-toastr.min.js', - ), - ), -); diff --git a/src/Toastr.php b/src/Toastr.php deleted file mode 100644 index c3dee1c..0000000 --- a/src/Toastr.php +++ /dev/null @@ -1,110 +0,0 @@ - - */ - -namespace Yoeunes\Toastr; - -class Toastr -{ - const ERROR = 'error'; - const INFO = 'info'; - const SUCCESS = 'success'; - const WARNING = 'warning'; - - /** - * @var ToastrFactory - */ - private $toastrFactory; - - /** - * @var array - */ - private $options; - - /** - * @param array $options - */ - public function __construct(ToastrFactory $toastrFactory, array $options = array()) - { - $this->toastrFactory = $toastrFactory; - $this->options = $options; - } - - /** - * Shortcut for adding an error notification. - * - * @param string $message The notification's message - * @param string $title The notification's title - * @param array $options The notification's options - * - * @return Toastr - */ - public function error($message, $title = '', array $options = array()) - { - return $this->addNotification(self::ERROR, $message, $title, $options); - } - - /** - * Shortcut for adding an info notification. - * - * @param string $message The notification's message - * @param string $title The notification's title - * @param array $options The notification's options - * - * @return Toastr - */ - public function info($message, $title = '', array $options = array()) - { - return $this->addNotification(self::INFO, $message, $title, $options); - } - - /** - * Shortcut for adding a success notification. - * - * @param string $message The notification's message - * @param string $title The notification's title - * @param array $options The notification's options - * - * @return Toastr - */ - public function success($message, $title = '', array $options = array()) - { - return $this->addNotification(self::SUCCESS, $message, $title, $options); - } - - /** - * Shortcut for adding a warning notification. - * - * @param string $message The notification's message - * @param string $title The notification's title - * @param array $options The notification's options - * - * @return Toastr - */ - public function warning($message, $title = '', array $options = array()) - { - return $this->addNotification(self::WARNING, $message, $title, $options); - } - - /** - * Add a notification. - * - * @param string $type could be error, info, success, or warning - * @param string $message The notification's message - * @param string $title The notification's title - * @param array $options The notification's options - * - * @return Toastr - */ - public function addNotification($type, $message, $title = '', array $options = array()) - { - $options = array_merge($this->options, $options); - - $this->toastrFactory->addFlash($type, $message, $title, $options); - - return $this; - } -} diff --git a/src/ToastrBuilder.php b/src/ToastrBuilder.php deleted file mode 100644 index 53a8e81..0000000 --- a/src/ToastrBuilder.php +++ /dev/null @@ -1,454 +0,0 @@ - - */ - -namespace Yoeunes\Toastr; - -use Flasher\Prime\Notification\NotificationBuilder; - -/** - * @SuppressWarnings(PHPMD.TooManyMethods) - * @SuppressWarnings(PHPMD.TooManyPublicMethods) - */ -final class ToastrBuilder extends NotificationBuilder -{ - /** - * Enable a close button. - * - * @param bool $closeButton - * - * @return static - */ - public function closeButton($closeButton = true) - { - $this->option('closeButton', $closeButton); - - return $this; - } - - /** - * @param string $closeClass - * - * @return static - */ - public function closeClass($closeClass) - { - $this->closeButton(); - - $this->option('closeClass', $closeClass); - - return $this; - } - - /** - * @param int $closeDuration - * - * @return static - */ - public function closeDuration($closeDuration) - { - $this->option('closeDuration', $closeDuration); - - return $this; - } - - /** - * @param string $closeEasing - * - * @return static - */ - public function closeEasing($closeEasing) - { - $this->option('closeEasing', $closeEasing); - - return $this; - } - - /** - * Override the close button's HTML. - * - * @param string $closeHtml - * - * @return static - */ - public function closeHtml($closeHtml) - { - $this->option('closeHtml', $closeHtml); - - return $this; - } - - /** - * @param string $closeMethod - * - * @return static - */ - public function closeMethod($closeMethod) - { - $this->option('closeMethod', $closeMethod); - - return $this; - } - - /** - * @param bool $closeOnHover - * - * @return static - */ - public function closeOnHover($closeOnHover = true) - { - $this->option('closeOnHover', $closeOnHover); - - return $this; - } - - /** - * @param string $containerId - * - * @return static - */ - public function containerId($containerId) - { - $this->option('containerId', $containerId); - - return $this; - } - - /** - * @param bool $debug - * - * @return static - */ - public function debug($debug = true) - { - $this->option('debug', $debug); - - return $this; - } - - /** - * In case you want to escape HTML characters in title and message. - * - * @param bool $escapeHtml - * - * @return static - */ - public function escapeHtml($escapeHtml = true) - { - $this->option('escapeHtml', $escapeHtml); - - return $this; - } - - /** - * How long the toast will display after a user hovers over it. - * - * @param int $extendedTimeOut - * - * @return static - */ - public function extendedTimeOut($extendedTimeOut) - { - $this->option('extendedTimeOut', $extendedTimeOut); - - return $this; - } - - /** - * Specifies the time during which the pop-up closes in ms. - * - * @param int $hideDuration - * - * @return static - */ - public function hideDuration($hideDuration) - { - $this->option('hideDuration', $hideDuration); - - return $this; - } - - /** - * Indicates the entry transition of the pop-up. - * - * @param string $hideEasing - * - * @return static - */ - public function hideEasing($hideEasing) - { - $this->option('hideEasing', $hideEasing); - - return $this; - } - - /** - * Indicates the opening animation of the pop-up. - * - * @param string $hideMethod - * - * @return static - */ - public function hideMethod($hideMethod) - { - $this->option('hideMethod', $hideMethod); - - return $this; - } - - /** - * @param string $iconClass - * - * @return static - */ - public function iconClass($iconClass) - { - $this->option('iconClass', $iconClass); - - return $this; - } - - /** - * @param string $messageClass - * - * @return static - */ - public function messageClass($messageClass) - { - $this->option('messageClass', $messageClass); - - return $this; - } - - /** - * Show newest toast at bottom (top is default). - * - * @param bool $newestOnTop - * - * @return static - */ - public function newestOnTop($newestOnTop = true) - { - $this->option('newestOnTop', $newestOnTop); - - return $this; - } - - /** - * @param string $onHidden - * - * @return static - */ - public function onHidden($onHidden) - { - $this->option('onHidden', $onHidden); - - return $this; - } - - /** - * @param string $onShown - * - * @return static - */ - public function onShown($onShown) - { - $this->option('onShown', $onShown); - - return $this; - } - - /** - * @param string $positionClass - * - * @return static - */ - public function positionClass($positionClass) - { - $this->option('positionClass', $positionClass); - - return $this; - } - - /** - * Rather than having identical toasts stack, set the preventDuplicates property to true. Duplicates are matched to - * the previous toast based on their message content. - * - * @param bool $preventDuplicates - * - * @return static - */ - public function preventDuplicates($preventDuplicates = true) - { - $this->option('preventDuplicates', $preventDuplicates); - - return $this; - } - - /** - * Visually indicate how long before a toast expires. - * - * @param bool $progressBar - * - * @return static - */ - public function progressBar($progressBar = true) - { - $this->option('progressBar', $progressBar); - - return $this; - } - - /** - * @param string $progressClass - * - * @return static - */ - public function progressClass($progressClass) - { - $this->option('progressClass', $progressClass); - - return $this; - } - - /** - * Flip the toastr to be displayed properly for right-to-left languages. - * - * @param bool $rtl - * - * @return static - */ - public function rtl($rtl = true) - { - $this->option('rtl', $rtl); - - return $this; - } - - /** - * Specifies the time during which the pop-up opens in ms. - * - * @param int $showDuration - * - * @return static - */ - public function showDuration($showDuration) - { - $this->option('showDuration', $showDuration); - - return $this; - } - - /** - * Indicates the entry transition of the pop-up. - * - * @param string $showEasing - * - * @return static - */ - public function showEasing($showEasing) - { - $this->option('showEasing', $showEasing); - - return $this; - } - - /** - * Indicates the opening animation of the pop-up. - * - * @param string $showMethod - * - * @return static - */ - public function showMethod($showMethod) - { - $this->option('showMethod', $showMethod); - - return $this; - } - - /** - * Forces the user to validate the pop-up before closing. - * - * @param bool $tapToDismiss - * - * @return static - */ - public function tapToDismiss($tapToDismiss = true) - { - $this->option('tapToDismiss', $tapToDismiss); - - return $this; - } - - /** - * @param string $target - * - * @return static - */ - public function target($target) - { - $this->option('target', $target); - - return $this; - } - - /** - * How long the toast will display without user interaction. - * - * @param int $timeOut - * @param int $extendedTimeOut - * - * @return static - */ - public function timeOut($timeOut, $extendedTimeOut = null) - { - $this->option('timeOut', $timeOut); - - if (null !== $extendedTimeOut) { - $this->extendedTimeOut($extendedTimeOut); - } - - return $this; - } - - /** - * @param string $titleClass - * - * @return static - */ - public function titleClass($titleClass) - { - $this->option('titleClass', $titleClass); - - return $this; - } - - /** - * @param string $toastClass - * - * @return static - */ - public function toastClass($toastClass) - { - $this->option('toastClass', $toastClass); - - return $this; - } - - /** - * Prevent from Auto Hiding. - * - * @return static - */ - public function persistent() - { - $this->timeOut(0); - $this->extendedTimeOut(0); - - return $this; - } -} diff --git a/src/ToastrFactory.php b/src/ToastrFactory.php deleted file mode 100644 index 9094866..0000000 --- a/src/ToastrFactory.php +++ /dev/null @@ -1,25 +0,0 @@ - - */ - -namespace Yoeunes\Toastr; - -use Flasher\Prime\Factory\NotificationFactory; -use Flasher\Prime\Notification\Notification; - -/** - * @mixin ToastrBuilder - */ -final class ToastrFactory extends NotificationFactory -{ - /** - * {@inheritdoc} - */ - public function createNotificationBuilder() - { - return new ToastrBuilder($this->getStorageManager(), new Notification(), 'toastr'); - } -} diff --git a/src/ToastrPlugin.php b/src/ToastrPlugin.php deleted file mode 100644 index 654e040..0000000 --- a/src/ToastrPlugin.php +++ /dev/null @@ -1,30 +0,0 @@ - - */ - -namespace Yoeunes\Toastr; - -use Flasher\Prime\Plugin\Plugin; - -class ToastrPlugin extends Plugin -{ - /** - * {@inheritdoc} - */ - public function getScripts() - { - return array( - 'cdn' => array( - 'https://cdn.jsdelivr.net/npm/jquery@3.6.3/dist/jquery.min.js', - 'https://cdn.jsdelivr.net/npm/@flasher/flasher-toastr@1.2.4/dist/flasher-toastr.min.js', - ), - 'local' => array( - '/vendor/flasher/jquery.min.js', - '/vendor/flasher/flasher-toastr.min.js', - ), - ); - } -} diff --git a/src/ToastrServiceProvider.php b/src/ToastrServiceProvider.php deleted file mode 100644 index 394bab9..0000000 --- a/src/ToastrServiceProvider.php +++ /dev/null @@ -1,74 +0,0 @@ - - */ - -namespace Yoeunes\Toastr; - -use Flasher\Laravel\Support\ServiceProvider; - -class ToastrServiceProvider extends ServiceProvider -{ - /** - * Bootstrap the application events. - * - * @return void - */ - public function afterBoot() - { - $this->publishes(array( - __DIR__.'/../config/toastr.php' => config_path('toastr.php'), - )); - } - - /** - * Register the service provider. - * - * @return void - */ - public function afterRegister() - { - $this->mergeConfigFrom( - __DIR__.'/../config/toastr.php', - 'toastr' - ); - - $this->registerToastr(); - } - - /** - * Get the services provided by the provider. - * - * @return string[] - */ - public function provides() - { - return array( - 'toastr', - ); - } - - /** - * @return ToastrPlugin - */ - public function createPlugin() - { - return new ToastrPlugin(); - } - - /** - * @return void - */ - private function registerToastr() - { - $this->app->singleton('toastr', function ($app) { - $options = $app['config']->get('toastr.options', array()); - - return new Toastr($app['flasher.toastr'], $options); - }); - - $this->app->alias('toastr', 'Yoeunes\Toastr\Toastr'); - } -} diff --git a/src/helpers.php b/src/helpers.php deleted file mode 100644 index b5fe37f..0000000 --- a/src/helpers.php +++ /dev/null @@ -1,29 +0,0 @@ - - */ - -use Yoeunes\Toastr\Toastr; - -if (!function_exists('toastr')) { - /** - * @see https://php-flasher.io/ - * - * @param string $message The notification's message - * @param string $type could be error, info, success, or warning - * @param string $title The notification's title - * @param array $options The notification's options - * - * @return Toastr - */ - function toastr($message = null, $type = 'success', $title = '', array $options = array()) - { - if (null === $message) { - return app('toastr'); - } - - return app('toastr')->addNotification($type, $message, $title, $options); - } -}