├── src ├── web │ └── assets │ │ ├── src │ │ ├── js │ │ │ ├── @types │ │ │ │ └── shims.d.ts │ │ │ ├── app.ts │ │ │ └── welcome.ts │ │ ├── css │ │ │ ├── vendor.css │ │ │ ├── components │ │ │ │ ├── global.css │ │ │ │ ├── webfonts.css │ │ │ │ └── typography.css │ │ │ ├── pages │ │ │ │ ├── welcome.css │ │ │ │ └── settings.css │ │ │ └── app.css │ │ └── vue │ │ │ ├── App.vue │ │ │ ├── @types │ │ │ ├── shims-vue.d.ts │ │ │ └── confetti.d.ts │ │ │ └── ConfettiParty.vue │ │ ├── dist │ │ ├── assets │ │ │ ├── app.f1fcf373.css │ │ │ ├── app.9353cce9.js │ │ │ ├── app.9353cce9.js.map │ │ │ ├── vendor.a4d540da.js.gz │ │ │ ├── vendor.a4d540da.js.map.gz │ │ │ ├── welcome.38ed5ff5.js │ │ │ ├── welcome.38ed5ff5.js.map │ │ │ ├── vendor.a4d540da.js.map │ │ │ └── vendor.a4d540da.js │ │ ├── manifest.json │ │ └── img │ │ │ ├── RichVariables-icon.svg │ │ │ └── RichVariables-menu-icon.svg │ │ └── public │ │ └── img │ │ └── RichVariables-icon.svg ├── templates │ ├── _includes │ │ └── macros.twig │ ├── _layouts │ │ └── richvariables-cp.twig │ ├── settings.twig │ └── welcome.twig ├── redactor │ └── plugins │ │ ├── v1 │ │ ├── richvariables.css │ │ └── richvariables.js │ │ └── v2 │ │ ├── richvariables.css │ │ └── richvariables.js ├── variables │ └── RichVariablesVariable.php ├── assetbundles │ └── richvariables │ │ ├── RichVariablesWelcomeAsset.php │ │ └── RichVariablesAsset.php ├── models │ └── Settings.php ├── translations │ └── en │ │ └── rich-variables.php ├── icon.svg ├── controllers │ └── DefaultController.php └── RichVariables.php ├── composer.json ├── README.md ├── LICENSE.md └── CHANGELOG.md /src/web/assets/src/js/@types/shims.d.ts: -------------------------------------------------------------------------------- 1 | declare module "app"; 2 | -------------------------------------------------------------------------------- /src/web/assets/dist/assets/app.f1fcf373.css: -------------------------------------------------------------------------------- 1 | .block{display:block} 2 | -------------------------------------------------------------------------------- /src/web/assets/src/js/app.ts: -------------------------------------------------------------------------------- 1 | // Import our CSS 2 | import '@/css/app.css'; 3 | -------------------------------------------------------------------------------- /src/web/assets/dist/assets/app.9353cce9.js: -------------------------------------------------------------------------------- 1 | 2 | //# sourceMappingURL=app.9353cce9.js.map 3 | -------------------------------------------------------------------------------- /src/web/assets/src/css/vendor.css: -------------------------------------------------------------------------------- 1 | /** 2 | * vendor.css 3 | * 4 | * All vendor CSS is imported here. 5 | * 6 | */ 7 | -------------------------------------------------------------------------------- /src/web/assets/src/css/components/global.css: -------------------------------------------------------------------------------- 1 | /** 2 | * components/global.css 3 | * 4 | * Project-wide styles 5 | * 6 | */ 7 | -------------------------------------------------------------------------------- /src/web/assets/src/css/components/webfonts.css: -------------------------------------------------------------------------------- 1 | /** 2 | * components/webfonts.css 3 | * 4 | * Project webfonts. 5 | * 6 | */ 7 | -------------------------------------------------------------------------------- /src/web/assets/src/css/pages/welcome.css: -------------------------------------------------------------------------------- 1 | /** 2 | * pages/settings.css 3 | * 4 | * Styles for the Welcome page. 5 | * 6 | */ 7 | -------------------------------------------------------------------------------- /src/web/assets/src/css/components/typography.css: -------------------------------------------------------------------------------- 1 | /** 2 | * components/typography.css 3 | * 4 | * Typography rules. 5 | * 6 | */ 7 | -------------------------------------------------------------------------------- /src/web/assets/src/css/pages/settings.css: -------------------------------------------------------------------------------- 1 | /** 2 | * pages/settings.css 3 | * 4 | * Styles for the Settings page. 5 | * 6 | */ 7 | -------------------------------------------------------------------------------- /src/web/assets/dist/assets/app.9353cce9.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"app.9353cce9.js","sources":[],"sourcesContent":[],"names":[],"mappings":""} -------------------------------------------------------------------------------- /src/web/assets/dist/assets/vendor.a4d540da.js.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nystudio107/craft-richvariables/develop/src/web/assets/dist/assets/vendor.a4d540da.js.gz -------------------------------------------------------------------------------- /src/web/assets/dist/assets/vendor.a4d540da.js.map.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nystudio107/craft-richvariables/develop/src/web/assets/dist/assets/vendor.a4d540da.js.map.gz -------------------------------------------------------------------------------- /src/web/assets/src/vue/App.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 8 | -------------------------------------------------------------------------------- /src/web/assets/src/vue/@types/shims-vue.d.ts: -------------------------------------------------------------------------------- 1 | declare module "*.vue" { 2 | import { defineComponent } from "vue"; 3 | const Component : ReturnType; 4 | export default Component; 5 | } 6 | -------------------------------------------------------------------------------- /src/templates/_includes/macros.twig: -------------------------------------------------------------------------------- 1 | {% macro configWarning(setting, file) -%} 2 | {%- set configArray = craft.app.config.getConfigFromFile(file) -%} 3 | {%- if configArray[setting] is defined -%} 4 | {{- "This is being overridden by the `#{setting}` setting in the `config/#{file}.php` file." |raw }} 5 | {%- else -%} 6 | {{ false }} 7 | {%- endif -%} 8 | {%- endmacro %} 9 | -------------------------------------------------------------------------------- /src/templates/_layouts/richvariables-cp.twig: -------------------------------------------------------------------------------- 1 | {% extends "_layouts/cp" %} 2 | 3 | {% block head %} 4 | {{ parent() }} 5 | {% set tagOptions = { 6 | 'depends': [ 7 | 'nystudio107\\richvariables\\assetbundles\\richvariables\\RichVariablesAsset' 8 | ], 9 | } %} 10 | {{ craft.richVariables.register('src/js/app.ts', false, tagOptions, tagOptions) }} 11 | {% endblock %} 12 | -------------------------------------------------------------------------------- /src/web/assets/src/js/welcome.ts: -------------------------------------------------------------------------------- 1 | import App from '@/vue/App.vue'; 2 | import { createApp } from 'vue'; 3 | 4 | // App main 5 | const main = async () => { 6 | // Create our vue instance 7 | const app = createApp(App); 8 | // Mount the app 9 | const root = app.mount('#app-container'); 10 | 11 | return root; 12 | }; 13 | 14 | // Execute async function 15 | main().then( () => { 16 | console.log(); 17 | }); 18 | -------------------------------------------------------------------------------- /src/web/assets/dist/assets/welcome.38ed5ff5.js: -------------------------------------------------------------------------------- 1 | import{d as n,C as c,o as r,a,c as s,b as l,e as p}from"./vendor.a4d540da.js";const i=n({setup(o){const e={defaultType:"rect",defaultSize:15,defaultColors:["DodgerBlue","OliveDrab","Gold","pink","SlateBlue","lightblue","Violet","PaleGreen","SteelBlue","SandyBrown","Chocolate","Crimson"]},t=new c;return r(()=>{t.start(e),setTimeout(()=>{t.stop()},5e3)}),(_,f)=>(a(),s("div"))}}),u=n({setup(o){return(e,t)=>(a(),l(i))}}),d=async()=>p(u).mount("#app-container");d().then(()=>{console.log()}); 2 | //# sourceMappingURL=welcome.38ed5ff5.js.map 3 | -------------------------------------------------------------------------------- /src/web/assets/dist/assets/welcome.38ed5ff5.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"welcome.38ed5ff5.js","sources":["../../../../../buildchain/src/js/welcome.ts"],"sourcesContent":["import App from '@/vue/App.vue';\nimport { createApp } from 'vue';\n\n// App main\nconst main = async () => {\n // Create our vue instance\n const app = createApp(App);\n // Mount the app\n const root = app.mount('#app-container');\n\n return root;\n};\n\n// Execute async function\nmain().then( () => {\n console.log();\n});\n"],"names":["App"],"mappings":"qaAIM,EAAO,SAII,AAFD,EAAUA,GAEL,MAAM,kBAM3B,IAAO,KAAM,IAAM,SACP"} -------------------------------------------------------------------------------- /src/web/assets/src/vue/ConfettiParty.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 23 | -------------------------------------------------------------------------------- /src/redactor/plugins/v1/richvariables.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Rich Variables plugin for Craft CMS 3 | * 4 | * Rich Variables CSS 5 | * 6 | * @author nystudio107 7 | * @copyright Copyright (c) 2017 nystudio107 8 | * @link https://nystudio107.com 9 | * @package RichVariables 10 | * @since 1.0.0 11 | */ 12 | 13 | /* -- Use the tag for our tokenized variables */ 14 | 15 | .redactor-layer ins, 16 | .redactor-editor ins { 17 | text-decoration: none!important; 18 | background-color: #DDDDDD; 19 | border-radius: 10px; 20 | border: 1px solid #C1C1C1; 21 | color: #29323D; 22 | padding: 1px 7px; 23 | margin: 0px 5px; 24 | text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5); 25 | font-size: 12px; 26 | line-height: 14px; 27 | } 28 | -------------------------------------------------------------------------------- /src/redactor/plugins/v2/richvariables.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Rich Variables plugin for Craft CMS 3 | * 4 | * Rich Variables CSS 5 | * 6 | * @author nystudio107 7 | * @copyright Copyright (c) 2017 nystudio107 8 | * @link https://nystudio107.com 9 | * @package RichVariables 10 | * @since 1.0.18 11 | */ 12 | 13 | /* -- Use the tag for our tokenized variables */ 14 | 15 | .redactor-layer ins, 16 | .redactor-styles ins { 17 | text-decoration: none!important; 18 | background-color: #DDDDDD; 19 | border-radius: 10px; 20 | border: 1px solid #C1C1C1; 21 | color: #29323D; 22 | padding: 1px 7px; 23 | margin: 0px 5px; 24 | text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5); 25 | font-size: 12px; 26 | line-height: 14px; 27 | } 28 | -------------------------------------------------------------------------------- /src/variables/RichVariablesVariable.php: -------------------------------------------------------------------------------- 1 | ): void, 5 | update(opts: Partial): void, 6 | stop(): void, 7 | } 8 | 9 | enum ParticlesType { 10 | circle = "circle", 11 | rect = "rect", 12 | heart = "heart", 13 | image = "image", 14 | } 15 | 16 | interface ParticlesConfig { 17 | type : ParticlesType, 18 | size : number, 19 | dropRate : number, 20 | colors : string[], 21 | url : string | null, 22 | } 23 | 24 | interface ConfettiConfig { 25 | particles : Partial[], 26 | defaultType : ParticlesType, 27 | defaultSize : number, 28 | defaultDropRate : number, 29 | defaultColors : string[], 30 | canvasId : number, 31 | particlesPerFrame : number, 32 | } 33 | -------------------------------------------------------------------------------- /src/assetbundles/richvariables/RichVariablesWelcomeAsset.php: -------------------------------------------------------------------------------- 1 | sourcePath = '@nystudio107/richvariables/web/assets/dist'; 33 | 34 | $this->depends = [ 35 | CpAsset::class, 36 | VueAsset::class, 37 | RichVariablesAsset::class, 38 | ]; 39 | 40 | parent::init(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/templates/settings.twig: -------------------------------------------------------------------------------- 1 | {# 2 | /** 3 | * Rich Variables plugin for Craft CMS 3.x 4 | * 5 | * Rich Variables Settings.twig 6 | * 7 | * @author nystudio107 8 | * @copyright Copyright (c) 2017 nystudio107 9 | * @link https://nystudio107.com 10 | * @package RichVariables 11 | * @since 1.0.0 12 | */ 13 | #} 14 | 15 | {% import "_includes/forms" as forms %} 16 | 17 | {% do view.registerAssetBundle("nystudio107\\richvariables\\assetbundles\\richvariables\\RichVariablesAsset") %} 18 | 19 | {{ forms.selectField({ 20 | first: true, 21 | label: 'Globals Set'|t('rich-variables'), 22 | instructions: 'Choose the Globals Set that should be available for insertion into Rich Text fields'|t('rich-variables'), 23 | id: 'globalSetHandle', 24 | name: 'globalSetHandle', 25 | options: globalsSets, 26 | value: settings['globalSetHandle'] 27 | }) }} 28 | 29 | {{ forms.lightswitchField({ 30 | label: 'Use Icon for Menu'|t('rich-variables'), 31 | instructions: 'Controls whether the Rich Variables menu should display itself as an icon or text'|t('rich-variables'), 32 | id: 'useIconForMenu', 33 | name: 'useIconForMenu', 34 | on: settings['useIconForMenu'], 35 | }) }} 36 | -------------------------------------------------------------------------------- /src/models/Settings.php: -------------------------------------------------------------------------------- 1 | ''], 47 | ]; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/assetbundles/richvariables/RichVariablesAsset.php: -------------------------------------------------------------------------------- 1 | sourcePath = "@nystudio107/richvariables/web/assets/dist"; 34 | 35 | $this->depends = [ 36 | CpAsset::class, 37 | VueAsset::class, 38 | RedactorAsset::class, 39 | ]; 40 | 41 | $this->js = [ 42 | ]; 43 | 44 | parent::init(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/web/assets/src/css/app.css: -------------------------------------------------------------------------------- 1 | /** 2 | * app.css 3 | * 4 | * The entry point for the css. 5 | * 6 | */ 7 | 8 | /** 9 | * This injects Tailwind's base styles, which is a combination of 10 | * Normalize.css and some additional base styles. 11 | * 12 | * You can see the styles here: 13 | * https://github.com/tailwindcss/tailwindcss/blob/master/css/preflight.css 14 | */ 15 | 16 | /** 17 | * We don't want these in the Control Panel 18 | * @import "tailwindcss/preflight"; 19 | */ 20 | 21 | /** 22 | * This injects any component classes registered by plugins. 23 | * 24 | */ 25 | @import "tailwindcss/components"; 26 | 27 | /** 28 | * Here we add custom component classes; stuff we want loaded 29 | * *before* the utilities so that the utilities can still 30 | * override them. 31 | * 32 | */ 33 | @import "./components/webfonts.css"; 34 | @import "./components/typography.css"; 35 | @import "./components/global.css"; 36 | 37 | /** 38 | * This injects all of Tailwind's utility classes, generated based on your 39 | * config file. 40 | * 41 | */ 42 | @import "tailwindcss/utilities"; 43 | 44 | /** 45 | * Include styles for individual pages 46 | * 47 | */ 48 | @import "./pages/settings.css"; 49 | @import "./pages/welcome.css"; 50 | 51 | /** 52 | * Include vendor css. 53 | * 54 | */ 55 | @import "vendor.css"; 56 | -------------------------------------------------------------------------------- /src/translations/en/rich-variables.php: -------------------------------------------------------------------------------- 1 | '{name} plugin loaded', 18 | 'Use Icon for Menu' => 'Use Icon for Menu', 19 | 'Controls whether the Rich Variables menu should display itself as an icon or text' => 'Controls whether the Rich Variables menu should display itself as an icon or text', 20 | 'Choose the Globals Set that should be available for insertion into Rich Text fields' => 'Choose the Globals Set that should be available for insertion into Rich Text fields', 21 | 'Globals Set' => 'Globals Set', 22 | 'Manifest file not found at: {manifestPath}' => 'Manifest file not found at: {manifestPath}', 23 | 'Module does not exist in the manifest: {moduleName}' => 'Module does not exist in the manifest: {moduleName}' 24 | ]; 25 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nystudio107/craft-richvariables", 3 | "description": "Allows you to easily use Craft Globals as variables in Rich Text fields", 4 | "type": "craft-plugin", 5 | "version": "1.0.31", 6 | "keywords": [ 7 | "craft", 8 | "cms", 9 | "craftcms", 10 | "craft-plugin", 11 | "richvariables", 12 | "redactor", 13 | "variables" 14 | ], 15 | "support": { 16 | "docs": "https://nystudio107.com/plugins/rich-variables/documentation", 17 | "issues": "https://nystudio107.com/plugins/rich-variables/support" 18 | }, 19 | "license": "proprietary", 20 | "authors": [ 21 | { 22 | "name": "nystudio107", 23 | "homepage": "https://nystudio107.com" 24 | } 25 | ], 26 | "require": { 27 | "craftcms/cms": "^3.0.0", 28 | "nystudio107/craft-plugin-vite": "^1.0.20" 29 | }, 30 | "config": { 31 | "allow-plugins": { 32 | "craftcms/plugin-installer": true, 33 | "yiisoft/yii2-composer": true 34 | }, 35 | "optimize-autoloader": true, 36 | "sort-packages": true 37 | }, 38 | "autoload": { 39 | "psr-4": { 40 | "nystudio107\\richvariables\\": "src/" 41 | } 42 | }, 43 | "extra": { 44 | "name": "Rich Variables", 45 | "handle": "rich-variables", 46 | "changelogUrl": "https://raw.githubusercontent.com/nystudio107/craft-richvariables/v1/CHANGELOG.md", 47 | "class": "nystudio107\\richvariables\\RichVariables" 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 12 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/web/assets/dist/img/RichVariables-icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 12 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/web/assets/public/img/RichVariables-icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 12 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/redactor/plugins/v1/richvariables.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Rich Variables plugin for Craft CMS 3 | * 4 | * Rich Variables JS 5 | * 6 | * @author nystudio107 7 | * @copyright Copyright (c) 2017 nystudio107 8 | * @link https://nystudio107.com 9 | * @package RichVariables 10 | * @since 1.0.0 11 | */ 12 | 13 | if (!RedactorPlugins) var RedactorPlugins = {}; 14 | 15 | // Grab the globals set Reference Tags from our controller 16 | var request = new XMLHttpRequest(); 17 | request.open('GET', Craft.getActionUrl('rich-variables'), false); 18 | request.onload = function() { 19 | if (request.status >= 200 && request.status < 400) { 20 | } else { 21 | } 22 | }; 23 | request.send(); 24 | 25 | // Add our Redactor plugin 26 | RedactorPlugins.richvariables = function() { 27 | return { 28 | init: function() { 29 | var dropdown = {}; 30 | var responseVars = JSON.parse(request.responseText); 31 | var _this = this; 32 | 33 | // Iterate through each menu item, adding them to our dropdown 34 | responseVars.variablesList.forEach(function(menuItem, index) { 35 | var key = 'point' + (index + 1); 36 | dropdown[key] = { 37 | title: menuItem.title, 38 | func: function(buttonName) { 39 | this.insert.raw('' + menuItem.text + ''); 40 | }, 41 | }; 42 | }); 43 | // Handle empty menu items 44 | if (responseVars.variablesList.length === 0) { 45 | dropdown.point1 = { 46 | title: "No Globals Found", 47 | func: function(buttonName) { 48 | // NOP 49 | }, 50 | }; 51 | } 52 | // Add the button and dropdown 53 | var button = this.button.add('variables', 'Variables'); 54 | this.button.addDropdown(button, dropdown); 55 | if (responseVars.useIconForMenu) 56 | this.button.setIcon(button, ''); 57 | }, 58 | }; 59 | }; -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/nystudio107/craft-richvariables/badges/quality-score.png?b=v1)](https://scrutinizer-ci.com/g/nystudio107/craft-richvariables/?branch=v1) [![Code Coverage](https://scrutinizer-ci.com/g/nystudio107/craft-richvariables/badges/coverage.png?b=v1)](https://scrutinizer-ci.com/g/nystudio107/craft-richvariables/?branch=v1) [![Build Status](https://scrutinizer-ci.com/g/nystudio107/craft-richvariables/badges/build.png?b=v1)](https://scrutinizer-ci.com/g/nystudio107/craft-richvariables/build-status/v1) [![Code Intelligence Status](https://scrutinizer-ci.com/g/nystudio107/craft-richvariables/badges/code-intelligence.svg?b=v1)](https://scrutinizer-ci.com/code-intelligence) 2 | 3 | # Rich Variables plugin for Craft CMS 3.x 4 | 5 | Allows you to easily use Craft Globals as variables in Rich Text fields 6 | 7 | ![Screenshot](./docs/docs/resources/img/plugin-banner.jpg) 8 | 9 | Related: [Rich Variables for Craft 2.x](https://github.com/nystudio107/richvariables) 10 | 11 | **Note**: _The license fee for this plugin is $19.00 via the Craft Plugin Store._ 12 | 13 | ## Requirements 14 | 15 | This plugin requires Craft CMS 3.0.0 or later. 16 | 17 | ## Installation 18 | 19 | To install Rich Variables, follow these steps: 20 | 21 | 1. Install with Composer via `composer require nystudio107/craft-richvariables` from your project directory 22 | 2. Install the plugin via `./craft install/plugin rich-variables` via the CLI, or in the Control Panel, go to Settings → Plugins and click the “Install” button for Rich Variables. 23 | 24 | You can also install Rich Variables via the **Plugin Store** in the Craft Control Panel. 25 | 26 | Rich Variables works on Craft 3.x 27 | 28 | ## Documentation 29 | 30 | Click here -> [Rich Variables Documentation](https://nystudio107.com/plugins/rich-variables/documentation) 31 | 32 | ## Rich Variables Roadmap 33 | 34 | Some things to do, and ideas for potential features: 35 | 36 | * Rich Variables could potentially have different Global sets for different Channels 37 | * We could allow for things other than Global sets to be available for insertion, such as Entry values, Categories, etc. 38 | 39 | Brought to you by [nystudio107](https://nystudio107.com) 40 | -------------------------------------------------------------------------------- /src/templates/welcome.twig: -------------------------------------------------------------------------------- 1 | {# @var craft \craft\web\twig\variables\CraftVariable #} 2 | {% extends 'rich-variables/_layouts/richvariables-cp.twig' %} 3 | 4 | {% set title = 'Welcome to Rich Variables!' %} 5 | 6 | {% set docsUrl = "https://github.com/nystudio107/craft-richvariables/blob/v1/README.md" %} 7 | {% set linkGetStarted = url('settings/plugins/rich-variables') %} 8 | 9 | {% do view.registerAssetBundle("nystudio107\\richvariables\\assetbundles\\richvariables\\RichVariablesWelcomeAsset") %} 10 | {% set baseAssetsUrl = view.getAssetManager().getPublishedUrl('@nystudio107/richvariables/web/assets/dist', true) %} 11 | 12 | {% set crumbs = [ 13 | { label: "Rich Variables", url: url('rich-variables') }, 14 | { label: "Welcome"|t, url: url('rich-variables/welcome') }, 15 | ] %} 16 | 17 | {% block head %} 18 | {{ parent() }} 19 | {% set tagOptions = { 20 | 'depends': [ 21 | 'nystudio107\\richvariables\\assetbundles\\richvariables\\RichVariablesAsset' 22 | ], 23 | } %} 24 | {{ craft.richVariables.register('src/js/welcome.ts', false, tagOptions, tagOptions) }} 25 | {% endblock %} 26 | 27 | {% block content %} 28 |
29 |
30 |
31 | 32 |

Thanks for using Rich Variables!

33 |

Rich Variables allows you to easily use Craft Globals as variables in Rich Text fields.

34 | 35 |

For more information, please see the documentation. 36 |

37 |

38 |   39 |

40 |

41 | 42 | 43 | 44 |

45 |
46 |
47 |

48 | Brought to you by nystudio107 49 |

50 |
51 | {% endblock %} 52 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright © nystudio107 2 | 3 | Permission is hereby granted to any person obtaining a copy of this software 4 | (the “Software”) to use, copy, modify, merge, publish and/or distribute copies 5 | of the Software, and to permit persons to whom the Software is furnished to do 6 | so, subject to the following conditions: 7 | 8 | 1. **Don’t plagiarize.** The above copyright notice and this license shall be 9 | included in all copies or substantial portions of the Software. 10 | 11 | 2. **Don’t use the same license on more than one project.** Each licensed copy 12 | of the Software shall be actively installed in no more than one production 13 | environment at a time. 14 | 15 | 3. **Don’t mess with the licensing features.** Software features related to 16 | licensing shall not be altered or circumvented in any way, including (but 17 | not limited to) license validation, payment prompts, feature restrictions, 18 | and update eligibility. 19 | 20 | 4. **Pay up.** Payment shall be made immediately upon receipt of any notice, 21 | prompt, reminder, or other message indicating that a payment is owed. 22 | 23 | 5. **Follow the law.** All use of the Software shall not violate any applicable 24 | law or regulation, nor infringe the rights of any other person or entity. 25 | 26 | Failure to comply with the foregoing conditions will automatically and 27 | immediately result in termination of the permission granted hereby. This 28 | license does not include any right to receive updates to the Software or 29 | technical support. Licensees bear all risk related to the quality and 30 | performance of the Software and any modifications made or obtained to it, 31 | including liability for actual and consequential harm, such as loss or 32 | corruption of data, and any necessary service, repair, or correction. 33 | 34 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 35 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 36 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 37 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER 38 | LIABILITY, INCLUDING SPECIAL, INCIDENTAL AND CONSEQUENTIAL DAMAGES, WHETHER IN 39 | AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 40 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 41 | -------------------------------------------------------------------------------- /src/controllers/DefaultController.php: -------------------------------------------------------------------------------- 1 | getSettings(); 61 | $globalsSet = Craft::$app->getGlobals()->getSetByHandle($settings['globalSetHandle']); 62 | // Grab the first global set if they haven't specified one yet 63 | if (!$globalsSet) { 64 | $allGlobalsSetIds = Craft::$app->getGlobals()->getAllSetIds(); 65 | if (!empty($allGlobalsSetIds)) { 66 | $globalsSet = Craft::$app->globals->getSetById($allGlobalsSetIds[0]); 67 | } 68 | } 69 | if ($globalsSet) { 70 | // Get the field layout fields used for this global set 71 | $layout = $globalsSet->getFieldLayout(); 72 | if ($layout) { 73 | $fieldLayoutFields = $layout->getFields(); 74 | /** @var Field $field */ 75 | foreach ($fieldLayoutFields as $field) { 76 | foreach (self::VALID_FIELD_CLASSES as $fieldClass) { 77 | if ($field instanceof $fieldClass) { 78 | // Add the field title and Reference Tag as per https://craftcms.com/docs/reference-tags 79 | $thisVar = [ 80 | 'title' => $field->name, 81 | 'text' => '{globalset:' . $globalsSet->attributes['id'] . ':' . $field->handle . '}', 82 | ]; 83 | $variablesList[] = $thisVar; 84 | } 85 | } 86 | } 87 | } 88 | } 89 | 90 | // Get the URL to our menu icon from our resource bundle 91 | try { 92 | Craft::$app->getView()->registerAssetBundle(RichVariablesAsset::class); 93 | } catch (InvalidConfigException $e) { 94 | Craft::error($e->getMessage(), __METHOD__); 95 | } 96 | $menuIconUrl = Craft::$app->assetManager->getPublishedUrl( 97 | '@nystudio107/richvariables/web/assets/dist', 98 | true 99 | ) . '/img/RichVariables-menu-icon.svg'; 100 | 101 | // Return everything to our JavaScript encoded as JSON 102 | $result['variablesList'] = $variablesList; 103 | $result['menuIconUrl'] = $menuIconUrl; 104 | $result['useIconForMenu'] = $settings['useIconForMenu']; 105 | 106 | return Json::encode($result); 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /src/redactor/plugins/v2/richvariables.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Rich Variables plugin for Craft CMS 3 | * 4 | * Rich Variables JS 5 | * 6 | * @author nystudio107 7 | * @copyright Copyright (c) 2017 nystudio107 8 | * @link https://nystudio107.com 9 | * @package RichVariables 10 | * @since 1.0.18 11 | */ 12 | 13 | (function($R) 14 | { 15 | function setWithExpiry(key, value, ttl) { 16 | const now = new Date() 17 | // `item` is an object which contains the original value 18 | // as well as the time when it's supposed to expire 19 | const item = { 20 | value: value, 21 | expiry: now.getTime() + ttl, 22 | } 23 | localStorage.setItem(key, JSON.stringify(item)) 24 | } 25 | 26 | function getWithExpiry(key) { 27 | const itemStr = localStorage.getItem(key) 28 | // if the item doesn't exist, return null 29 | if (!itemStr) { 30 | return null 31 | } 32 | const item = JSON.parse(itemStr) 33 | const now = new Date() 34 | // compare the expiry time of the item with the current time 35 | if (now.getTime() > item.expiry) { 36 | // If the item is expired, delete the item from storage 37 | // and return null 38 | localStorage.removeItem(key) 39 | return null 40 | } 41 | return item.value 42 | } 43 | 44 | $R.add('plugin', 'richvariables', { 45 | translations: { 46 | en: { 47 | "variables": "Variables" 48 | } 49 | }, 50 | init: function(app) 51 | { 52 | this.app = app; 53 | this.lang = app.lang; 54 | this.inline = app.inline; 55 | this.toolbar = app.toolbar; 56 | this.insertion = app.insertion; 57 | 58 | // Try to grab the menu from our local storage cache if possible 59 | var cachedResponseVars = getWithExpiry('rich-variables-menu-cache'); 60 | if (cachedResponseVars === null) { 61 | // Grab the globals set Reference Tags from our controller 62 | var request = new XMLHttpRequest(); 63 | request.open('GET', Craft.getActionUrl('rich-variables'), false); 64 | request.onload = function() { 65 | if (request.status >= 200 && request.status < 400) { 66 | } else { 67 | } 68 | }; 69 | request.send(); 70 | this.request = request; 71 | } 72 | }, 73 | start: function() 74 | { 75 | var dropdown = {}; 76 | // Try to grab the menu from our local storage cache if possible 77 | var responseVars = getWithExpiry('rich-variables-menu-cache'); 78 | if (responseVars === null && this.request) { 79 | responseVars = JSON.parse(this.request.responseText); 80 | setWithExpiry('rich-variables-menu-cache', responseVars, 60 * 1000) 81 | } 82 | // Iterate through each menu item, adding them to our dropdown 83 | responseVars.variablesList.forEach(function(menuItem, index) { 84 | var key = 'point' + (index + 1); 85 | var refTag = '' + menuItem.text + ''; 86 | dropdown[key] = { 87 | title: menuItem.title, 88 | api: 'plugin.richvariables.insert', 89 | args: refTag 90 | }; 91 | }); 92 | // Handle empty menu items 93 | if (responseVars.variablesList.length === 0) { 94 | dropdown.point1 = { 95 | title: "No Globals Found", 96 | func: function(buttonName) { 97 | // NOP 98 | }, 99 | }; 100 | } 101 | // Add the button and dropdown 102 | var $button = this.toolbar.addButton('variables', { title: this.lang.get('variables') }); 103 | $button.setDropdown(dropdown); 104 | if (responseVars.useIconForMenu) { 105 | $button.setIcon(''); 106 | } 107 | }, 108 | insert: function(refTag) 109 | { 110 | this.insertion.insertRaw(refTag); 111 | } 112 | }); 113 | })(Redactor); 114 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Rich Variables Changelog 2 | 3 | ## 1.0.31 - 2022.01.24 4 | 5 | ### Fixed 6 | 7 | * Fixed an issue where `craft-plugin-vite` was not included as 8 | required ([#39](https://github.com/nystudio107/craft-richvariables/issues/39)) 9 | 10 | ## 1.0.30 - 2022.01.12 11 | 12 | ### Added 13 | 14 | * Add `.gitattributes` & `CODEOWNERS` 15 | * Add linting to build 16 | * Add compression of assets 17 | * Add bundle visualizer 18 | 19 | ## 1.0.29 - 2021.04.15 20 | 21 | ### Changed 22 | 23 | * Cache the Rich Variables menu in local storage, to increase performance for multiple rich text fields per 24 | page (https://github.com/nystudio107/craft-richvariables/issues/29) 25 | 26 | ## 1.0.28 - 2021.04.06 27 | 28 | ### Added 29 | 30 | * Added `make update` to update NPM packages 31 | * Added `make update-clean` to completely remove `node_modules/`, then update NPM packages 32 | 33 | ### Changed 34 | 35 | * More consistent `makefile` build commands 36 | * Use Tailwind CSS `^2.1.0` with JIT 37 | * Move settings from the `composer.json` “extra” to the plugin main class 38 | * Move the manifest service registration to the constructor 39 | * Remove deprecated ManifestController 40 | 41 | ## 1.0.27 - 2021.03.03 42 | 43 | ### Changed 44 | 45 | * Dockerized the buildchain, using `craft-plugin-manifest` for the webpack HMR bridge 46 | 47 | ## 1.0.26 - 2021.02.13 48 | 49 | ### Changed 50 | 51 | * Update to webpack 5 buildchain 52 | 53 | ## 1.0.25 - 2020.04.02 54 | 55 | ### Added 56 | 57 | * Added back in support for the Preparse field 58 | 59 | ### Fixed 60 | 61 | * Restored the missing icon from the drop-down menu 62 | 63 | ### Changed 64 | 65 | * Updated to latest npm dependencies via `npm audit fix` for both the primary app and the docs 66 | 67 | ## 1.0.24 - 2019.11.04 68 | 69 | ### Changed 70 | 71 | * Updated to latest npm dependencies via `npm audit fix` 72 | 73 | ## 1.0.23 - 2019.05.24 74 | 75 | ### Changed 76 | 77 | * Updated build system 78 | 79 | ## 1.0.22 - 2019.04.22 80 | 81 | ### Changed 82 | 83 | * Updated Twig namespacing to be compliant with deprecated class aliases in 2.7.x 84 | 85 | ## 1.0.21 - 2018.10.05 86 | 87 | ### Changed 88 | 89 | * Updated build process 90 | 91 | ## 1.0.20 - 2018.08.23 92 | 93 | ### Added 94 | 95 | * Added welcome screen after install 96 | * Added a new b&w menu icon to match Redactor styles 97 | 98 | ### Changed 99 | 100 | * Moved to a modern webpack build config for the Control Panel 101 | * Added install confetti 102 | 103 | ## 1.0.19 - 2018.05.19 104 | 105 | ### Changed 106 | 107 | * Fixed a regression in the Settings that caused an exception to be thrown 108 | 109 | ## 1.0.18 - 2018.05.18 110 | 111 | ### Changed 112 | 113 | * Added support for Redactor 2.x plugin from Pixel & Tonic 114 | * Refactor to load JS/CSS conditionally based on the version of the Redactor plugin 115 | * Install event handlers after all plugins have loaded 116 | * Fixed missing translations 117 | 118 | ## 1.0.17 - 2018.03.02 119 | 120 | ### Changed 121 | 122 | * Fixed the controller URL which stopped working in Craft CMS 3 RC13 123 | * Fixed deprecation errors from Craft CMS 3 RC13 124 | * Code cleanup 125 | 126 | ## 1.0.16 - 2018.02.01 127 | 128 | ### Added 129 | 130 | * Renamed the composer package name to `craft-richvariables` 131 | 132 | ## 1.0.15 - 2017.12.12 133 | 134 | ### Changed 135 | 136 | * Only load our AssetBundle on non-console Control Panel requests 137 | 138 | ## 1.0.14 - 2017.12.06 139 | 140 | ### Changed 141 | 142 | * Updated to require craftcms/cms `^3.0.0-RC1` 143 | 144 | ## 1.0.13 - 2017.10.22 145 | 146 | ### Changed 147 | 148 | * Craft 3 RC 1 compatibility 149 | 150 | ## 1.0.12 - 2017.07.15 151 | 152 | ### Changed 153 | 154 | * Craft 3 beta 20 compatibility 155 | 156 | ## 1.0.11 - 2017.04.20 157 | 158 | ### Changed 159 | 160 | * Added support for `RichText` fields to be selected as variables 161 | 162 | ## 1.0.10 - 2017.04.20 163 | 164 | ### Changed 165 | 166 | * Register the Redactor plugin via `RichText::EVENT_REGISTER_REDACTOR_PLUGIN` 167 | 168 | ## 1.0.9 - 2017.03.24 169 | 170 | ### Changed 171 | 172 | * `hasSettings` -> `hasCpSettings` for Craft 3 beta 8 compatibility 173 | 174 | ## 1.0.8 - 2017.03.13 175 | 176 | ### Fixed 177 | 178 | * The handle used for translations is now all lowercase 179 | 180 | ## 1.0.7 - 2017.03.12 181 | 182 | ### Added 183 | 184 | * Added `craft/cms` as a composer dependency 185 | * Added code inspection typehinting for the plugin 186 | 187 | ## 1.0.6 - 2017.02.24 188 | 189 | ### Fixed 190 | 191 | * Fixed a styling issue with Redactor 2.2 192 | 193 | ### Changed 194 | 195 | * Removed the unused `icon-mask.svg` file 196 | * Removed the unused `config.php` file 197 | 198 | ## 1.0.5 - 2017.02.09 199 | 200 | ### Changed 201 | 202 | * Removed `allowAnonymous` from the controller, since we only want to work for logged in users 203 | * Cleaned up `composer.json` 204 | 205 | ## 1.0.4 - 2017.02.08 206 | 207 | ### Changed 208 | 209 | * Improved how we retrieved the settings, using RichVariables::$plugin 210 | * Removed the Issues from the README.md 211 | 212 | ## 1.0.3 - 2017.02.07 213 | 214 | ### Fixed 215 | 216 | * Fixed an issue where the user might be redirected errantly to JSON settings on login 217 | 218 | ### Changed 219 | 220 | * Removed the spaces inside of the inserted `` tags 221 | 222 | ## 1.0.2 - 2017.02.06 223 | 224 | ### Added 225 | 226 | * Added a setting to control whether the Rich Variables menu should be text or an icon 227 | 228 | ### Changed 229 | 230 | * Harmonized the code with the Craft 2 version 231 | 232 | ## 1.0.1 - 2017.02.05 233 | 234 | ### Fixed 235 | 236 | - Fixed the icon by passing it in through our JavaScript response 237 | 238 | ## 1.0.0 - 2017.02.05 239 | 240 | ### Added 241 | 242 | - Initial port to Craft 3 243 | -------------------------------------------------------------------------------- /src/RichVariables.php: -------------------------------------------------------------------------------- 1 | [ 78 | 'class' => VitePluginService::class, 79 | 'assetClass' => RichVariablesAsset::class, 80 | 'useDevServer' => true, 81 | 'devServerPublic' => 'http://localhost:3001', 82 | 'serverPublic' => 'http://localhost:8000', 83 | 'errorEntry' => 'src/js/app.ts', 84 | 'devServerInternal' => 'http://craft-richvariables-buildchain:3001', 85 | 'checkDevServer' => true, 86 | ], 87 | ]; 88 | 89 | parent::__construct($id, $parent, $config); 90 | } 91 | 92 | 93 | // Public Methods 94 | // ========================================================================= 95 | 96 | /** 97 | * @inheritdoc 98 | */ 99 | public function init() 100 | { 101 | parent::init(); 102 | self::$plugin = $this; 103 | 104 | // Add in our event listeners that are needed for every request 105 | $this->installEventListeners(); 106 | // We're loaded! 107 | Craft::info( 108 | Craft::t( 109 | 'rich-variables', 110 | '{name} plugin loaded', 111 | ['name' => $this->name] 112 | ), 113 | __METHOD__ 114 | ); 115 | } 116 | 117 | // Protected Methods 118 | // ========================================================================= 119 | 120 | /** 121 | * Install our event listeners 122 | */ 123 | protected function installEventListeners() 124 | { 125 | Event::on( 126 | CraftVariable::class, 127 | CraftVariable::EVENT_INIT, 128 | function (Event $event) { 129 | /** @var CraftVariable $variable */ 130 | $variable = $event->sender; 131 | $variable->set('richVariables', [ 132 | 'class' => RichVariablesVariable::class, 133 | 'viteService' => $this->vite, 134 | ]); 135 | } 136 | ); 137 | // Handler: Plugins::EVENT_AFTER_INSTALL_PLUGIN 138 | Event::on( 139 | Plugins::class, 140 | Plugins::EVENT_AFTER_INSTALL_PLUGIN, 141 | function (PluginEvent $event) { 142 | if ($event->plugin === $this) { 143 | $request = Craft::$app->getRequest(); 144 | if ($request->isCpRequest) { 145 | Craft::$app->getResponse()->redirect(UrlHelper::cpUrl('rich-variables/welcome'))->send(); 146 | } 147 | } 148 | } 149 | ); 150 | $request = Craft::$app->getRequest(); 151 | // Install only for non-console site requests 152 | if ($request->getIsSiteRequest() && !$request->getIsConsoleRequest()) { 153 | $this->installSiteEventListeners(); 154 | } 155 | // Install only for non-console Control Panel requests 156 | if ($request->getIsCpRequest() && !$request->getIsConsoleRequest()) { 157 | $this->installCpEventListeners(); 158 | } 159 | } 160 | 161 | /** 162 | * Install site event listeners for site requests only 163 | */ 164 | protected function installSiteEventListeners() 165 | { 166 | // Handler: UrlManager::EVENT_REGISTER_SITE_URL_RULES 167 | Event::on( 168 | UrlManager::class, 169 | UrlManager::EVENT_REGISTER_SITE_URL_RULES, 170 | function (RegisterUrlRulesEvent $event) { 171 | Craft::debug( 172 | 'UrlManager::EVENT_REGISTER_SITE_URL_RULES', 173 | __METHOD__ 174 | ); 175 | // Register our Control Panel routes 176 | $event->rules = array_merge( 177 | $event->rules, 178 | $this->customFrontendRoutes() 179 | ); 180 | } 181 | ); 182 | } 183 | 184 | /** 185 | * Return the custom frontend routes 186 | * 187 | * @return array 188 | */ 189 | protected function customFrontendRoutes(): array 190 | { 191 | return [ 192 | ]; 193 | } 194 | 195 | /** 196 | * Install site event listeners for Control Panel requests only 197 | */ 198 | protected function installCpEventListeners() 199 | { 200 | // Handler: Plugins::EVENT_AFTER_LOAD_PLUGINS 201 | Event::on( 202 | Plugins::class, 203 | Plugins::EVENT_AFTER_LOAD_PLUGINS, 204 | function () { 205 | $this->installRedactorPlugin(); 206 | } 207 | ); 208 | } 209 | 210 | /** 211 | * Install our Redactor plugin 212 | */ 213 | protected function installRedactorPlugin() 214 | { 215 | // Make sure the Redactor plugin is installed 216 | $redactor = Craft::$app->getPlugins()->getPlugin('redactor'); 217 | if ($redactor) { 218 | // Event handler: RichText::EVENT_REGISTER_PLUGIN_PATHS 219 | Event::on( 220 | RichText::class, 221 | RichText::EVENT_REGISTER_PLUGIN_PATHS, 222 | function (RegisterPluginPathsEvent $event) { 223 | /** @var Plugin $redactor */ 224 | $redactor = Craft::$app->getPlugins()->getPlugin('redactor'); 225 | $versionDir = 'v1/'; 226 | if (Comparator::greaterThanOrEqualTo($redactor->version, '2.0.0')) { 227 | $versionDir = 'v2/'; 228 | } 229 | // Add the path to our Redactor plugin 230 | $src = Craft::getAlias('@nystudio107/richvariables/redactor/plugins/' . $versionDir); 231 | $event->paths[] = $src; 232 | } 233 | ); 234 | // Register our asset bundle 235 | try { 236 | Craft::$app->getView()->registerAssetBundle(RichVariablesAsset::class); 237 | } catch (InvalidConfigException $e) { 238 | Craft::error($e->getMessage(), __METHOD__); 239 | } 240 | } 241 | } 242 | 243 | /** 244 | * @inheritdoc 245 | */ 246 | protected function createSettingsModel() 247 | { 248 | return new Settings(); 249 | } 250 | 251 | /** 252 | * @inheritdoc 253 | */ 254 | protected function settingsHtml(): string 255 | { 256 | // Get all of the globals sets 257 | $globalsHandles = []; 258 | $allGlobalsSets = Craft::$app->getGlobals()->getAllSets(); 259 | foreach ($allGlobalsSets as $globalsSet) { 260 | $globalsHandles[$globalsSet->handle] = $globalsSet->name; 261 | } 262 | 263 | // Render our settings template 264 | try { 265 | return Craft::$app->view->renderTemplate( 266 | 'rich-variables/settings', 267 | [ 268 | 'settings' => $this->getSettings(), 269 | 'globalsSets' => $globalsHandles, 270 | ] 271 | ); 272 | } catch (LoaderError $e) { 273 | Craft::error($e->getMessage(), __METHOD__); 274 | } catch (Exception $e) { 275 | Craft::error($e->getMessage(), __METHOD__); 276 | } 277 | 278 | return ''; 279 | } 280 | } 281 | -------------------------------------------------------------------------------- /src/web/assets/dist/assets/vendor.a4d540da.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"vendor.a4d540da.js","sources":["../../../../../buildchain/node_modules/vue-confetti/src/utils/get-random-number.js","../../../../../buildchain/node_modules/vue-confetti/src/particles/base.js","../../../../../buildchain/node_modules/vue-confetti/src/particles/circle.js","../../../../../buildchain/node_modules/vue-confetti/src/particles/rect.js","../../../../../buildchain/node_modules/vue-confetti/src/particles/heart.js","../../../../../buildchain/node_modules/vue-confetti/src/particles/image.js","../../../../../buildchain/node_modules/vue-confetti/src/factories/particle.js","../../../../../buildchain/node_modules/vue-confetti/src/particle-manager.js","../../../../../buildchain/node_modules/vue-confetti/src/canvas.js","../../../../../buildchain/node_modules/vue-confetti/src/confetti.js"],"sourcesContent":["/**\n * Return a random number.\n * @param {Number} [min]\n * The minimum number (default 1).\n * @param {Number} [max]\n * The maximum number (default min + 1).\n * @param {boolean} round\n * True to round the number to the nearest integer, false otherwise.\n * @return {Number}\n * A random number between min and max.\n */\nexport default (min = 1, max = min + 1, round = false) => {\n const minN = parseFloat(min);\n const maxN = parseFloat(max);\n const n = Math.random() * (maxN - minN) + minN;\n return round ? Math.round(n) : n;\n};\n","import getRandomNumber from '../utils/get-random-number';\n\n/**\n * A particle that can be drawn on a canvas.\n */\nexport default class BaseParticle {\n /**\n * Initialise.\n * @param {object} options\n * The particle options.\n * @param {string} options.color\n * The particle color.\n * @param {number} options.size\n * The particle size.\n * @param {number} options.dropRate\n * The speed at which particles fall.\n */\n constructor({\n color = 'blue',\n size = 10,\n dropRate = 10,\n } = {}) {\n this.color = color;\n this.size = size;\n this.dropRate = dropRate;\n }\n\n /**\n * Setup.\n * @param {options} opts\n * The particle options.\n */\n setup({\n canvas,\n wind,\n windPosCoef,\n windSpeedMax,\n count,\n }) {\n this.canvas = canvas;\n this.wind = wind;\n this.windPosCoef = windPosCoef;\n this.windSpeedMax = windSpeedMax;\n this.x = getRandomNumber(-35, this.canvas.width + 35);\n this.y = getRandomNumber(-30, -35);\n this.d = getRandomNumber(150) + 10; // density\n this.particleSize = getRandomNumber(this.size, this.size * 2);\n this.tilt = getRandomNumber(10);\n this.tiltAngleIncremental = (\n (getRandomNumber(0, 0.08) + 0.04) * (getRandomNumber() < 0.5 ? -1 : 1)\n );\n this.tiltAngle = 0;\n this.angle = getRandomNumber(Math.PI * 2);\n this.count = count + 1;\n this.remove = false;\n return this;\n }\n\n /**\n * Update the particle.\n */\n update() {\n this.tiltAngle += (this.tiltAngleIncremental * (\n Math.cos(this.wind + (this.d + this.x + this.y) * this.windPosCoef)\n * 0.2 + 1\n ));\n this.y += (Math.cos(this.angle + this.d) + parseInt(this.dropRate, 10)) / 2;\n\n this.x += (Math.sin(this.angle) + Math.cos(\n this.wind + (this.d + this.x + this.y) * this.windPosCoef,\n )) * this.windSpeedMax;\n this.y += Math.sin(\n this.wind + (this.d + this.x + this.y) * this.windPosCoef,\n ) * this.windSpeedMax;\n this.tilt = (Math.sin(this.tiltAngle - (this.count / 3))) * 15;\n }\n\n /**\n * Check if the particle is past the bottom of the canvas;\n */\n pastBottom() {\n return this.y > this.canvas.height;\n }\n\n /**\n * Draw a particle.\n */\n draw() {\n this.canvas.ctx.fillStyle = this.color;\n this.canvas.ctx.beginPath();\n this.canvas.ctx.setTransform(\n Math.cos(this.tiltAngle), // set the x axis to the tilt angle\n Math.sin(this.tiltAngle),\n 0,\n 1,\n this.x,\n this.y, // set the origin\n );\n }\n\n /**\n * Kill the particle after it has left the screen.\n */\n kill() {\n this.remove = true;\n }\n}\n","import BaseParticle from './base';\n\n/**\n * Class representing a circular particle.\n */\nexport default class CircleParticle extends BaseParticle {\n /**\n * Draw the particle.\n */\n draw() {\n super.draw();\n this.canvas.ctx.arc(0, 0, (this.particleSize / 2), 0, Math.PI * 2, false);\n this.canvas.ctx.fill();\n }\n}\n","import BaseParticle from './base';\n\n/**\n * Class representing a rectangular particle.\n */\nexport default class RectParticle extends BaseParticle {\n /**\n * Draw the particle.\n */\n draw() {\n super.draw();\n this.canvas.ctx.fillRect(0, 0, this.particleSize, this.particleSize / 2);\n }\n}\n","import BaseParticle from './base';\n\n/**\n * Class representing a heart-shaped particle.\n */\nexport default class HeartParticle extends BaseParticle {\n /**\n * Draw the particle.\n */\n draw() {\n super.draw();\n const curveTo = (cp1x, cp1y, cp2x, cp2y, x, y) => {\n this.canvas.ctx.bezierCurveTo(\n cp1x * (this.particleSize / 200),\n cp1y * (this.particleSize / 200),\n cp2x * (this.particleSize / 200),\n cp2y * (this.particleSize / 200),\n x * (this.particleSize / 200),\n y * (this.particleSize / 200),\n );\n };\n this.canvas.ctx.moveTo(37.5 / this.particleSize, 20 / this.particleSize);\n curveTo(75, 37, 70, 25, 50, 25);\n curveTo(20, 25, 20, 62.5, 20, 62.5);\n curveTo(20, 80, 40, 102, 75, 120);\n curveTo(110, 102, 130, 80, 130, 62.5);\n curveTo(130, 62.5, 130, 25, 100, 25);\n curveTo(85, 25, 75, 37, 75, 40);\n this.canvas.ctx.fill();\n }\n}\n","import BaseParticle from './base';\n\n/**\n * Class representing an image particle.\n */\nexport default class ImageParticle extends BaseParticle {\n /**\n * Initialise\n * @param {HTMLImageElement} imgEl\n * An image element to pass through to ctx.drawImage.\n */\n constructor(opts, imgEl) {\n super(opts);\n\n this.imgEl = imgEl;\n }\n\n /**\n * Draw the particle.\n */\n draw() {\n super.draw();\n this.canvas.ctx.drawImage(this.imgEl, 0, 0, this.particleSize, this.particleSize);\n }\n}\n","import getRandomNumber from '../utils/get-random-number';\nimport {\n CircleParticle,\n RectParticle,\n HeartParticle,\n ImageParticle,\n} from '../particles';\n\n/**\n * Create a particle based on the given options.\n * @param {object} options\n * The particle options.\n * @returns {object}\n * A particle.\n */\nexport default class ParticleFactory {\n constructor() {\n this.cachedImages = {};\n }\n\n /**\n * Create an image element from the given source.\n * @param {string} imgSource\n * The path to the image.\n */\n createImageElement(imgSource) {\n const imgEl = document.createElement('img');\n imgEl.setAttribute('src', imgSource);\n return imgEl;\n }\n\n /**\n * Get an image element from a source string.\n * @param {string} imgSource\n * The path to the image.\n */\n getImageElement(imgSource) {\n if (!this.cachedImages[imgSource]) {\n this.cachedImages[imgSource] = this.createImageElement(imgSource);\n }\n return this.cachedImages[imgSource];\n }\n\n /**\n * Get a random particle from the list of available particles.\n * @param {Object} options\n * The particle options.\n */\n getRandomParticle(options = {}) {\n const particles = options.particles || [];\n\n if (particles.length < 1) {\n return {};\n }\n\n return particles[Math.floor(Math.random() * particles.length)];\n }\n\n /**\n * Get the particle defaults.\n * @param {Object} options\n * The particle options.\n */\n getDefaults(options = {}) {\n return {\n type: options.defaultType || 'circle',\n size: options.defaultSize || 10,\n dropRate: options.defaultDropRate || 10,\n colors: options.defaultColors || [\n 'DodgerBlue',\n 'OliveDrab',\n 'Gold',\n 'pink',\n 'SlateBlue',\n 'lightblue',\n 'Violet',\n 'PaleGreen',\n 'SteelBlue',\n 'SandyBrown',\n 'Chocolate',\n 'Crimson',\n ],\n url: null,\n };\n }\n\n /**\n * Create a particle.\n * @param {Object} options\n * The particle options.\n */\n create(options) {\n const defaults = this.getDefaults(options);\n const particle = this.getRandomParticle(options);\n\n const opts = Object.assign(defaults, particle);\n\n // Set a random color from the array\n const colorIndex = getRandomNumber(0, opts.colors.length - 1, true);\n opts.color = opts.colors[colorIndex];\n\n if (opts.type === 'circle') {\n return new CircleParticle(opts);\n }\n\n if (opts.type === 'rect') {\n return new RectParticle(opts);\n }\n\n if (opts.type === 'heart') {\n return new HeartParticle(opts);\n }\n\n if (opts.type === 'image') {\n return new ImageParticle(opts, this.getImageElement(opts.url));\n }\n\n throw Error(`Unknown particle type: \"${opts.type}\"`);\n }\n}\n","import ParticleFactory from './factories/particle';\n\n/**\n * A particle generation and management service.\n */\nexport default class ParticleManger {\n /**\n * Initialise.\n * @param {object} particleOptions\n * The particle options.\n */\n constructor(particleOptions) {\n this.items = [];\n this.pool = [];\n this.particleOptions = particleOptions;\n this.particleFactory = new ParticleFactory();\n }\n\n /**\n * Update the position of each particle.\n *\n * Moves particles back to the pool if past the bottom and not due for removal.\n */\n update() {\n const oldItems = [];\n const newItems = [];\n\n this.items.forEach((particle) => {\n particle.update();\n\n if (particle.pastBottom()) {\n if (!particle.remove) {\n particle.setup(this.particleOptions);\n oldItems.push(particle);\n }\n } else {\n newItems.push(particle);\n }\n });\n\n this.pool.push(...oldItems);\n\n this.items = newItems;\n }\n\n /**\n * Draw the particles currently in view.\n */\n draw() {\n this.items.forEach(item => item.draw());\n }\n\n /**\n * Add an item to the view.\n */\n add() {\n if (this.pool.length > 0) {\n this.items.push(this.pool.pop().setup(this.particleOptions));\n } else {\n this.items.push(\n this.particleFactory.create(this.particleOptions).setup(this.particleOptions),\n );\n }\n }\n\n /**\n * Replace particles once they have left the screen.\n */\n refresh() {\n this.items.forEach((item) => {\n item.kill();\n });\n\n this.pool = [];\n }\n}\n","/**\n * Class to generate and interact with an HTML canvas.\n */\nexport default class Canvas {\n /**\n * Initialise.\n * @param {HTMLCanvasElement} [canvasElement]\n * An optional HTMLCanvasElement to override the default.\n */\n constructor(canvasElement) {\n const defaultCanvasId = 'confetti-canvas';\n\n if (canvasElement && !(canvasElement instanceof HTMLCanvasElement)) {\n throw new Error('Element is not a valid HTMLCanvasElement');\n }\n\n this.isDefault = !canvasElement;\n\n this.canvas = canvasElement || Canvas.createDefaultCanvas(defaultCanvasId);\n\n this.ctx = this.canvas.getContext('2d');\n }\n\n /**\n * Add a fixed, full-screen canvas to the page.\n * @returns {HTMLCanvasElement}\n * A full-screen canvas.\n */\n static createDefaultCanvas(id) {\n const canvas = document.createElement('canvas');\n canvas.style.display = 'block';\n canvas.style.position = 'fixed';\n canvas.style.pointerEvents = 'none';\n canvas.style.top = 0;\n canvas.style.width = '100vw';\n canvas.style.height = '100vh';\n canvas.id = id;\n document.querySelector('body').appendChild(canvas);\n return canvas;\n }\n\n /**\n * Get the canvas width.\n * @returns {Number}\n * The canvas width.\n */\n get width() {\n return this.canvas.width;\n }\n\n /**\n * Get the canvas height.\n * @returns {Number}\n * The canvas height.\n */\n get height() {\n return this.canvas.height;\n }\n\n /**\n * Clear the canvas.\n */\n clear() {\n this.ctx.setTransform(1, 0, 0, 1, 0, 0);\n this.ctx.clearRect(0, 0, this.width, this.height);\n }\n\n /**\n * Update the canvas dimensions, if necessary.\n */\n updateDimensions() {\n if (!this.isDefault) {\n return;\n }\n\n if (this.width !== window.innerWidth || this.height !== window.innerHeight) {\n this.canvas.width = window.innerWidth;\n this.canvas.height = window.innerHeight;\n }\n }\n}\n","import ParticleManager from './particle-manager';\nimport Canvas from './canvas';\n\n/**\n * A class to drawing confetti onto a canvas.\n */\nexport default class Confetti {\n /**\n * Initialise.\n */\n constructor() {\n this.setDefaults();\n }\n\n /**\n * Initialize default.\n */\n setDefaults() {\n this.killed = false;\n this.framesSinceDrop = 0;\n this.canvas = null;\n this.canvasEl = null;\n this.W = 0;\n this.H = 0;\n this.particleManager = null;\n this.particlesPerFrame = 0; // max particles dropped per frame\n this.wind = 0;\n this.windSpeed = 1;\n this.windSpeedMax = 1;\n this.windChange = 0.01;\n this.windPosCoef = 0.002;\n this.animationId = null;\n }\n\n getParticleOptions(opts) {\n const options = {\n canvas: this.canvas,\n W: this.W,\n H: this.H,\n wind: this.wind,\n windPosCoef: this.windPosCoef,\n windSpeedMax: this.windSpeedMax,\n count: 0,\n };\n\n Object.assign(options, opts);\n\n return options;\n }\n\n /**\n * Create the confetti particles.\n * @param {Object} opts\n * The particle options.\n */\n createParticles(opts = {}) {\n const particleOpts = this.getParticleOptions(opts);\n this.particleManager = new ParticleManager(particleOpts);\n }\n\n /**\n * Get a canvas element from the given options.\n * @param {Object} opts\n * The particle options.\n */\n getCanvasElementFromOptions(opts) {\n const { canvasId, canvasElement } = opts;\n let canvasEl = canvasElement;\n\n if (canvasElement && !(canvasElement instanceof HTMLCanvasElement)) {\n throw new Error('Invalid options: canvasElement is not a valid HTMLCanvasElement');\n }\n\n if (canvasId && canvasElement) {\n throw new Error('Invalid options: canvasId and canvasElement are mutually exclusive');\n }\n\n if (canvasId && !canvasEl) {\n canvasEl = document.getElementById(canvasId);\n }\n\n if (canvasId && !(canvasEl instanceof HTMLCanvasElement)) {\n throw new Error(`Invalid options: element with id \"${canvasId}\" is not a valid HTMLCanvasElement`);\n }\n\n return canvasEl;\n }\n\n /**\n * Start dropping confetti.\n * @param {Object} opts\n * The particle options.\n */\n start(opts = {}) {\n this.remove(); // clear any previous settings\n\n const canvasEl = this.getCanvasElementFromOptions(opts);\n\n this.canvas = new Canvas(canvasEl);\n this.canvasEl = canvasEl;\n\n this.createParticles(opts);\n this.setGlobalOptions(opts);\n this.animationId = requestAnimationFrame(this.mainLoop.bind(this));\n }\n\n /**\n * Set the global options.\n */\n setGlobalOptions(opts) {\n this.particlesPerFrame = opts.particlesPerFrame || 2;\n this.windSpeedMax = opts.windSpeedMax || 1;\n }\n\n /**\n * Stop dropping confetti.\n */\n stop() {\n this.killed = true;\n this.particlesPerFrame = 0;\n }\n\n /**\n * Update the confetti options.\n */\n update(opts) {\n const canvasEl = this.getCanvasElementFromOptions(opts);\n\n // Restart if a different canvas is given\n if (this.canvas && canvasEl !== this.canvasEl) {\n this.start(opts);\n return;\n }\n\n this.setGlobalOptions(opts);\n\n if (this.particleManager) {\n this.particleManager.particleOptions = this.getParticleOptions(opts);\n this.particleManager.refresh();\n }\n }\n\n /**\n * Remove confetti.\n */\n remove() {\n this.stop();\n\n if (this.animationId) {\n cancelAnimationFrame(this.animationId);\n }\n\n if (this.canvas) {\n this.canvas.clear();\n }\n\n this.setDefaults();\n }\n\n /**\n * Run the main animation loop.\n */\n mainLoop(time) {\n this.canvas.updateDimensions();\n this.canvas.clear();\n\n this.windSpeed = Math.sin(time / 8000) * this.windSpeedMax;\n this.wind = this.particleManager.particleOptions.wind += this.windChange; // eslint-disable-line\n\n let numberToAdd = this.framesSinceDrop * this.particlesPerFrame;\n\n while (numberToAdd >= 1) {\n this.particleManager.add();\n numberToAdd -= 1;\n this.framesSinceDrop = 0;\n }\n\n this.particleManager.update();\n this.particleManager.draw();\n\n // Stop calling if no particles left in view (i.e. it's been stopped)\n if (!this.killed || this.particleManager.items.length) {\n this.animationId = requestAnimationFrame(this.mainLoop.bind(this));\n }\n\n this.framesSinceDrop += 1;\n }\n}\n"],"names":["ParticleManager"],"mappings":"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"} -------------------------------------------------------------------------------- /src/web/assets/dist/assets/vendor.a4d540da.js: -------------------------------------------------------------------------------- 1 | function Jt(e,t){const n=Object.create(null),s=e.split(",");for(let i=0;i!!n[i.toLowerCase()]:i=>!!n[i]}const xi="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",wi=Jt(xi);function Xn(e){return!!e||e===""}function Yt(e){if(P(e)){const t={};for(let n=0;n{if(n){const s=n.split(Ci);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function Xt(e){let t="";if(X(e))t=e;else if(P(e))for(let n=0;n{},Ei=()=>!1,Ti=/^on[^a-z]/,xt=e=>Ti.test(e),Zt=e=>e.startsWith("onUpdate:"),Y=Object.assign,Qt=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Mi=Object.prototype.hasOwnProperty,S=(e,t)=>Mi.call(e,t),P=Array.isArray,ft=e=>wt(e)==="[object Map]",Ii=e=>wt(e)==="[object Set]",A=e=>typeof e=="function",X=e=>typeof e=="string",Gt=e=>typeof e=="symbol",Q=e=>e!==null&&typeof e=="object",Zn=e=>Q(e)&&A(e.then)&&A(e.catch),Pi=Object.prototype.toString,wt=e=>Pi.call(e),Oi=e=>wt(e).slice(8,-1),Ai=e=>wt(e)==="[object Object]",en=e=>X(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,vt=Jt(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Ct=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},Fi=/-(\w)/g,Xe=Ct(e=>e.replace(Fi,(t,n)=>n?n.toUpperCase():"")),Si=/\B([A-Z])/g,Ze=Ct(e=>e.replace(Si,"-$1").toLowerCase()),Qn=Ct(e=>e.charAt(0).toUpperCase()+e.slice(1)),tn=Ct(e=>e?`on${Qn(e)}`:""),yt=(e,t)=>!Object.is(e,t),nn=(e,t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})},Ni=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let Gn;const Ri=()=>Gn||(Gn=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{});let Re;const Tt=[];class Hi{constructor(t=!1){this.active=!0,this.effects=[],this.cleanups=[],!t&&Re&&(this.parent=Re,this.index=(Re.scopes||(Re.scopes=[])).push(this)-1)}run(t){if(this.active)try{return this.on(),t()}finally{this.off()}}on(){this.active&&(Tt.push(this),Re=this)}off(){this.active&&(Tt.pop(),Re=Tt[Tt.length-1])}stop(t){if(this.active){if(this.effects.forEach(n=>n.stop()),this.cleanups.forEach(n=>n()),this.scopes&&this.scopes.forEach(n=>n.stop(!0)),this.parent&&!t){const n=this.parent.scopes.pop();n&&n!==this&&(this.parent.scopes[this.index]=n,n.index=this.index)}this.active=!1}}}function Li(e,t){t=t||Re,t&&t.active&&t.effects.push(e)}const sn=e=>{const t=new Set(e);return t.w=0,t.n=0,t},es=e=>(e.w&Me)>0,ts=e=>(e.n&Me)>0,Bi=({deps:e})=>{if(e.length)for(let t=0;t{const{deps:t}=e;if(t.length){let n=0;for(let s=0;s0?Qe[t-1]:void 0}}stop(){this.active&&(ns(this),this.onStop&&this.onStop(),this.active=!1)}}function ns(e){const{deps:t}=e;if(t.length){for(let n=0;n{(h==="length"||h>=s)&&c.push(a)});else switch(n!==void 0&&c.push(o.get(n)),t){case"add":P(e)?en(n)&&c.push(o.get("length")):(c.push(o.get(Le)),ft(e)&&c.push(o.get(on)));break;case"delete":P(e)||(c.push(o.get(Le)),ft(e)&&c.push(o.get(on)));break;case"set":ft(e)&&c.push(o.get(Le));break}if(c.length===1)c[0]&&an(c[0]);else{const a=[];for(const h of c)h&&a.push(...h);an(sn(a))}}function an(e,t){for(const n of P(e)?e:[...e])(n!==He||n.allowRecurse)&&(n.scheduler?n.scheduler():n.run())}const Ui=Jt("__proto__,__v_isRef,__isVue"),rs=new Set(Object.getOwnPropertyNames(Symbol).map(e=>Symbol[e]).filter(Gt)),Ki=un(),$i=un(!1,!0),zi=un(!0),ls=Wi();function Wi(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...n){const s=L(this);for(let r=0,o=this.length;r{e[t]=function(...n){et();const s=L(this)[t].apply(this,n);return Be(),s}}),e}function un(e=!1,t=!1){return function(s,i,r){if(i==="__v_isReactive")return!e;if(i==="__v_isReadonly")return e;if(i==="__v_isShallow")return t;if(i==="__v_raw"&&r===(e?t?lr:gs:t?ps:ds).get(s))return s;const o=P(s);if(!e&&o&&S(ls,i))return Reflect.get(ls,i,r);const c=Reflect.get(s,i,r);return(Gt(i)?rs.has(i):Ui(i))||(e||re(s,"get",i),t)?c:Z(c)?!o||!en(i)?c.value:c:Q(c)?e?ms(c):pn(c):c}}const ki=os(),qi=os(!0);function os(e=!1){return function(n,s,i,r){let o=n[s];if(ut(o)&&Z(o)&&!Z(i))return!1;if(!e&&!ut(i)&&(bs(i)||(i=L(i),o=L(o)),!P(n)&&Z(o)&&!Z(i)))return o.value=i,!0;const c=P(n)&&en(s)?Number(s)e,Mt=e=>Reflect.getPrototypeOf(e);function It(e,t,n=!1,s=!1){e=e.__v_raw;const i=L(e),r=L(t);t!==r&&!n&&re(i,"get",t),!n&&re(i,"get",r);const{has:o}=Mt(i),c=s?hn:n?bn:mn;if(o.call(i,t))return c(e.get(t));if(o.call(i,r))return c(e.get(r));e!==i&&e.get(t)}function Pt(e,t=!1){const n=this.__v_raw,s=L(n),i=L(e);return e!==i&&!t&&re(s,"has",e),!t&&re(s,"has",i),e===i?n.has(e):n.has(e)||n.has(i)}function Ot(e,t=!1){return e=e.__v_raw,!t&&re(L(e),"iterate",Le),Reflect.get(e,"size",e)}function fs(e){e=L(e);const t=L(this);return Mt(t).has.call(t,e)||(t.add(e),ve(t,"add",e,e)),this}function as(e,t){t=L(t);const n=L(this),{has:s,get:i}=Mt(n);let r=s.call(n,e);r||(e=L(e),r=s.call(n,e));const o=i.call(n,e);return n.set(e,t),r?yt(t,o)&&ve(n,"set",e,t):ve(n,"add",e,t),this}function us(e){const t=L(this),{has:n,get:s}=Mt(t);let i=n.call(t,e);i||(e=L(e),i=n.call(t,e)),s&&s.call(t,e);const r=t.delete(e);return i&&ve(t,"delete",e,void 0),r}function hs(){const e=L(this),t=e.size!==0,n=e.clear();return t&&ve(e,"clear",void 0,void 0),n}function At(e,t){return function(s,i){const r=this,o=r.__v_raw,c=L(o),a=t?hn:e?bn:mn;return!e&&re(c,"iterate",Le),o.forEach((h,m)=>s.call(i,a(h),a(m),r))}}function Ft(e,t,n){return function(...s){const i=this.__v_raw,r=L(i),o=ft(r),c=e==="entries"||e===Symbol.iterator&&o,a=e==="keys"&&o,h=i[e](...s),m=n?hn:t?bn:mn;return!t&&re(r,"iterate",a?on:Le),{next(){const{value:v,done:C}=h.next();return C?{value:v,done:C}:{value:c?[m(v[0]),m(v[1])]:m(v),done:C}},[Symbol.iterator](){return this}}}}function Ie(e){return function(...t){return e==="delete"?!1:this}}function Qi(){const e={get(r){return It(this,r)},get size(){return Ot(this)},has:Pt,add:fs,set:as,delete:us,clear:hs,forEach:At(!1,!1)},t={get(r){return It(this,r,!1,!0)},get size(){return Ot(this)},has:Pt,add:fs,set:as,delete:us,clear:hs,forEach:At(!1,!0)},n={get(r){return It(this,r,!0)},get size(){return Ot(this,!0)},has(r){return Pt.call(this,r,!0)},add:Ie("add"),set:Ie("set"),delete:Ie("delete"),clear:Ie("clear"),forEach:At(!0,!1)},s={get(r){return It(this,r,!0,!0)},get size(){return Ot(this,!0)},has(r){return Pt.call(this,r,!0)},add:Ie("add"),set:Ie("set"),delete:Ie("delete"),clear:Ie("clear"),forEach:At(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(r=>{e[r]=Ft(r,!1,!1),n[r]=Ft(r,!0,!1),t[r]=Ft(r,!1,!0),s[r]=Ft(r,!0,!0)}),[e,n,t,s]}const[Gi,er,tr,nr]=Qi();function dn(e,t){const n=t?e?nr:tr:e?er:Gi;return(s,i,r)=>i==="__v_isReactive"?!e:i==="__v_isReadonly"?e:i==="__v_raw"?s:Reflect.get(S(n,i)&&i in s?n:s,i,r)}const sr={get:dn(!1,!1)},ir={get:dn(!1,!0)},rr={get:dn(!0,!1)},ds=new WeakMap,ps=new WeakMap,gs=new WeakMap,lr=new WeakMap;function or(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function cr(e){return e.__v_skip||!Object.isExtensible(e)?0:or(Oi(e))}function pn(e){return ut(e)?e:gn(e,!1,cs,sr,ds)}function fr(e){return gn(e,!1,Zi,ir,ps)}function ms(e){return gn(e,!0,Xi,rr,gs)}function gn(e,t,n,s,i){if(!Q(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const r=i.get(e);if(r)return r;const o=cr(e);if(o===0)return e;const c=new Proxy(e,o===2?s:n);return i.set(e,c),c}function tt(e){return ut(e)?tt(e.__v_raw):!!(e&&e.__v_isReactive)}function ut(e){return!!(e&&e.__v_isReadonly)}function bs(e){return!!(e&&e.__v_isShallow)}function _s(e){return tt(e)||ut(e)}function L(e){const t=e&&e.__v_raw;return t?L(t):e}function xs(e){return Et(e,"__v_skip",!0),e}const mn=e=>Q(e)?pn(e):e,bn=e=>Q(e)?ms(e):e;function ar(e){ss()&&(e=L(e),e.dep||(e.dep=sn()),is(e.dep))}function ur(e,t){e=L(e),e.dep&&an(e.dep)}function Z(e){return Boolean(e&&e.__v_isRef===!0)}function hr(e){return Z(e)?e.value:e}const dr={get:(e,t,n)=>hr(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const i=e[t];return Z(i)&&!Z(n)?(i.value=n,!0):Reflect.set(e,t,n,s)}};function ws(e){return tt(e)?e:new Proxy(e,dr)}class pr{constructor(t,n,s,i){this._setter=n,this.dep=void 0,this.__v_isRef=!0,this._dirty=!0,this.effect=new cn(t,()=>{this._dirty||(this._dirty=!0,ur(this))}),this.effect.computed=this,this.effect.active=this._cacheable=!i,this.__v_isReadonly=s}get value(){const t=L(this);return ar(t),(t._dirty||!t._cacheable)&&(t._dirty=!1,t._value=t.effect.run()),t._value}set value(t){this._setter(t)}}function gr(e,t,n=!1){let s,i;const r=A(e);return r?(s=e,i=de):(s=e.get,i=e.set),new pr(s,i,r||!i,n)}Promise.resolve();function Pe(e,t,n,s){let i;try{i=s?e(...s):e()}catch(r){St(r,t,n)}return i}function ce(e,t,n,s){if(A(e)){const r=Pe(e,t,n,s);return r&&Zn(r)&&r.catch(o=>{St(o,t,n)}),r}const i=[];for(let r=0;r>>1;gt(le[s])Ce&&le.splice(t,1)}function Es(e,t,n,s){P(e)?n.push(...e):(!t||!t.includes(e,e.allowRecurse?s+1:s))&&n.push(e),ys()}function wr(e){Es(e,dt,ht,nt)}function vr(e){Es(e,Oe,pt,st)}function vn(e,t=null){if(ht.length){for(wn=t,dt=[...new Set(ht)],ht.length=0,nt=0;ntgt(n)-gt(s)),st=0;ste.id==null?1/0:e.id;function Ms(e){_n=!1,Nt=!0,vn(e),le.sort((n,s)=>gt(n)-gt(s));const t=de;try{for(Ce=0;CeI.trim()):v&&(i=n.map(Ni))}let c,a=s[c=tn(t)]||s[c=tn(Xe(t))];!a&&r&&(a=s[c=tn(Ze(t))]),a&&ce(a,e,6,i);const h=s[c+"Once"];if(h){if(!e.emitted)e.emitted={};else if(e.emitted[c])return;e.emitted[c]=!0,ce(h,e,6,i)}}function Is(e,t,n=!1){const s=t.emitsCache,i=s.get(e);if(i!==void 0)return i;const r=e.emits;let o={},c=!1;if(!A(e)){const a=h=>{const m=Is(h,t,!0);m&&(c=!0,Y(o,m))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!r&&!c?(s.set(e,null),null):(P(r)?r.forEach(a=>o[a]=null):Y(o,r),s.set(e,o),o)}function Cn(e,t){return!e||!xt(t)?!1:(t=t.slice(2).replace(/Once$/,""),S(e,t[0].toLowerCase()+t.slice(1))||S(e,Ze(t))||S(e,t))}let ge=null,Ps=null;function Rt(e){const t=ge;return ge=e,Ps=e&&e.type.__scopeId||null,t}function yr(e,t=ge,n){if(!t||e._n)return e;const s=(...i)=>{s._d&&ti(-1);const r=Rt(t),o=e(...i);return Rt(r),s._d&&ti(1),o};return s._n=!0,s._c=!0,s._d=!0,s}function yn(e){const{type:t,vnode:n,proxy:s,withProxy:i,props:r,propsOptions:[o],slots:c,attrs:a,emit:h,render:m,renderCache:v,data:C,setupState:I,ctx:R,inheritAttrs:H}=e;let O,N;const oe=Rt(e);try{if(n.shapeFlag&4){const W=i||s;O=be(m.call(W,W,v,r,I,C,R)),N=a}else{const W=t;O=be(W.length>1?W(r,{attrs:a,slots:c,emit:h}):W(r,null)),N=t.props?a:Er(a)}}catch(W){mt.length=0,St(W,e,1),O=Fe(Ae)}let q=O;if(N&&H!==!1){const W=Object.keys(N),{shapeFlag:ne}=q;W.length&&ne&(1|6)&&(o&&W.some(Zt)&&(N=Tr(N,o)),q=rt(q,N))}return n.dirs&&(q.dirs=q.dirs?q.dirs.concat(n.dirs):n.dirs),n.transition&&(q.transition=n.transition),O=q,Rt(oe),O}const Er=e=>{let t;for(const n in e)(n==="class"||n==="style"||xt(n))&&((t||(t={}))[n]=e[n]);return t},Tr=(e,t)=>{const n={};for(const s in e)(!Zt(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function Mr(e,t,n){const{props:s,children:i,component:r}=e,{props:o,children:c,patchFlag:a}=t,h=r.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&a>=0){if(a&1024)return!0;if(a&16)return s?Os(s,o,h):!!o;if(a&8){const m=t.dynamicProps;for(let v=0;ve.__isSuspense;function Or(e,t){t&&t.pendingBranch?P(e)?t.effects.push(...e):t.effects.push(e):vr(e)}function Ar(e,t){if(J){let n=J.provides;const s=J.parent&&J.parent.provides;s===n&&(n=J.provides=Object.create(s)),n[e]=t}}function En(e,t,n=!1){const s=J||ge;if(s){const i=s.parent==null?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides;if(i&&e in i)return i[e];if(arguments.length>1)return n&&A(t)?t.call(s.proxy):t}}const As={};function Tn(e,t,n){return Fs(e,t,n)}function Fs(e,t,{immediate:n,deep:s,flush:i,onTrack:r,onTrigger:o}=j){const c=J;let a,h=!1,m=!1;if(Z(e)?(a=()=>e.value,h=bs(e)):tt(e)?(a=()=>e,s=!0):P(e)?(m=!0,h=e.some(tt),a=()=>e.map(N=>{if(Z(N))return N.value;if(tt(N))return it(N);if(A(N))return Pe(N,c,2)})):A(e)?t?a=()=>Pe(e,c,2):a=()=>{if(!(c&&c.isUnmounted))return v&&v(),ce(e,c,3,[C])}:a=de,t&&s){const N=a;a=()=>it(N())}let v,C=N=>{v=O.onStop=()=>{Pe(N,c,4)}};if(bt)return C=de,t?n&&ce(t,c,3,[a(),m?[]:void 0,C]):a(),de;let I=m?[]:As;const R=()=>{if(!!O.active)if(t){const N=O.run();(s||h||(m?N.some((oe,q)=>yt(oe,I[q])):yt(N,I)))&&(v&&v(),ce(t,c,3,[N,I===As?void 0:I,C]),I=N)}else O.run()};R.allowRecurse=!!t;let H;i==="sync"?H=R:i==="post"?H=()=>te(R,c&&c.suspense):H=()=>{!c||c.isMounted?wr(R):R()};const O=new cn(a,H);return t?n?R():I=O.run():i==="post"?te(O.run.bind(O),c&&c.suspense):O.run(),()=>{O.stop(),c&&c.scope&&Qt(c.scope.effects,O)}}function Fr(e,t,n){const s=this.proxy,i=X(e)?e.includes(".")?Ss(s,e):()=>s[e]:e.bind(s,s);let r;A(t)?r=t:(r=t.handler,n=t);const o=J;lt(this);const c=Fs(i,r.bind(s),n);return o?lt(o):ze(),c}function Ss(e,t){const n=t.split(".");return()=>{let s=e;for(let i=0;i{it(n,t)});else if(Ai(e))for(const n in e)it(e[n],t);return e}function Sr(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Bs(()=>{e.isMounted=!0}),Ds(()=>{e.isUnmounting=!0}),e}const fe=[Function,Array],Nr={name:"BaseTransition",props:{mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:fe,onEnter:fe,onAfterEnter:fe,onEnterCancelled:fe,onBeforeLeave:fe,onLeave:fe,onAfterLeave:fe,onLeaveCancelled:fe,onBeforeAppear:fe,onAppear:fe,onAfterAppear:fe,onAppearCancelled:fe},setup(e,{slots:t}){const n=_l(),s=Sr();let i;return()=>{const r=t.default&&Hs(t.default(),!0);if(!r||!r.length)return;const o=L(e),{mode:c}=o,a=r[0];if(s.isLeaving)return In(a);const h=Rs(a);if(!h)return In(a);const m=Mn(h,o,s,n);Pn(h,m);const v=n.subTree,C=v&&Rs(v);let I=!1;const{getTransitionKey:R}=h.type;if(R){const H=R();i===void 0?i=H:H!==i&&(i=H,I=!0)}if(C&&C.type!==Ae&&(!$e(h,C)||I)){const H=Mn(C,o,s,n);if(Pn(C,H),c==="out-in")return s.isLeaving=!0,H.afterLeave=()=>{s.isLeaving=!1,n.update()},In(a);c==="in-out"&&h.type!==Ae&&(H.delayLeave=(O,N,oe)=>{const q=Ns(s,C);q[String(C.key)]=C,O._leaveCb=()=>{N(),O._leaveCb=void 0,delete m.delayedLeave},m.delayedLeave=oe})}return a}}},Rr=Nr;function Ns(e,t){const{leavingVNodes:n}=e;let s=n.get(t.type);return s||(s=Object.create(null),n.set(t.type,s)),s}function Mn(e,t,n,s){const{appear:i,mode:r,persisted:o=!1,onBeforeEnter:c,onEnter:a,onAfterEnter:h,onEnterCancelled:m,onBeforeLeave:v,onLeave:C,onAfterLeave:I,onLeaveCancelled:R,onBeforeAppear:H,onAppear:O,onAfterAppear:N,onAppearCancelled:oe}=t,q=String(e.key),W=Ns(n,e),ne=(B,V)=>{B&&ce(B,s,9,V)},Ne={mode:r,persisted:o,beforeEnter(B){let V=c;if(!n.isMounted)if(i)V=H||c;else return;B._leaveCb&&B._leaveCb(!0);const k=W[q];k&&$e(e,k)&&k.el._leaveCb&&k.el._leaveCb(),ne(V,[B])},enter(B){let V=a,k=h,ae=m;if(!n.isMounted)if(i)V=O||a,k=N||h,ae=oe||m;else return;let se=!1;const ue=B._enterCb=ke=>{se||(se=!0,ke?ne(ae,[B]):ne(k,[B]),Ne.delayedLeave&&Ne.delayedLeave(),B._enterCb=void 0)};V?(V(B,ue),V.length<=1&&ue()):ue()},leave(B,V){const k=String(e.key);if(B._enterCb&&B._enterCb(!0),n.isUnmounting)return V();ne(v,[B]);let ae=!1;const se=B._leaveCb=ue=>{ae||(ae=!0,V(),ue?ne(R,[B]):ne(I,[B]),B._leaveCb=void 0,W[k]===e&&delete W[k])};W[k]=e,C?(C(B,se),C.length<=1&&se()):se()},clone(B){return Mn(B,t,n,s)}};return Ne}function In(e){if(Ht(e))return e=rt(e),e.children=null,e}function Rs(e){return Ht(e)?e.children?e.children[0]:void 0:e}function Pn(e,t){e.shapeFlag&6&&e.component?Pn(e.component.subTree,t):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Hs(e,t=!1){let n=[],s=0;for(let i=0;i1)for(let i=0;i!!e.type.__asyncLoader,Ht=e=>e.type.__isKeepAlive;function Hr(e,t){Ls(e,"a",t)}function Lr(e,t){Ls(e,"da",t)}function Ls(e,t,n=J){const s=e.__wdc||(e.__wdc=()=>{let i=n;for(;i;){if(i.isDeactivated)return;i=i.parent}return e()});if(Lt(t,s,n),n){let i=n.parent;for(;i&&i.parent;)Ht(i.parent.vnode)&&Br(s,t,n,i),i=i.parent}}function Br(e,t,n,s){const i=Lt(t,e,s,!0);js(()=>{Qt(s[t],i)},n)}function Lt(e,t,n=J,s=!1){if(n){const i=n[e]||(n[e]=[]),r=t.__weh||(t.__weh=(...o)=>{if(n.isUnmounted)return;et(),lt(n);const c=ce(t,n,e,o);return ze(),Be(),c});return s?i.unshift(r):i.push(r),r}}const ye=e=>(t,n=J)=>(!bt||e==="sp")&&Lt(e,t,n),Dr=ye("bm"),Bs=ye("m"),jr=ye("bu"),Ur=ye("u"),Ds=ye("bum"),js=ye("um"),Kr=ye("sp"),$r=ye("rtg"),zr=ye("rtc");function Wr(e,t=J){Lt("ec",e,t)}let An=!0;function kr(e){const t=$s(e),n=e.proxy,s=e.ctx;An=!1,t.beforeCreate&&Us(t.beforeCreate,e,"bc");const{data:i,computed:r,methods:o,watch:c,provide:a,inject:h,created:m,beforeMount:v,mounted:C,beforeUpdate:I,updated:R,activated:H,deactivated:O,beforeDestroy:N,beforeUnmount:oe,destroyed:q,unmounted:W,render:ne,renderTracked:Ne,renderTriggered:B,errorCaptured:V,serverPrefetch:k,expose:ae,inheritAttrs:se,components:ue,directives:ke,filters:Wn}=t;if(h&&qr(h,s,null,e.appContext.config.unwrapInjectedRef),o)for(const z in o){const U=o[z];A(U)&&(s[z]=U.bind(n))}if(i){const z=i.call(n,n);Q(z)&&(e.data=pn(z))}if(An=!0,r)for(const z in r){const U=r[z],xe=A(U)?U.bind(n,n):A(U.get)?U.get.bind(n,n):de,kt=!A(U)&&A(U.set)?U.set.bind(n):de,ot=El({get:xe,set:kt});Object.defineProperty(s,z,{enumerable:!0,configurable:!0,get:()=>ot.value,set:qe=>ot.value=qe})}if(c)for(const z in c)Ks(c[z],s,n,z);if(a){const z=A(a)?a.call(n):a;Reflect.ownKeys(z).forEach(U=>{Ar(U,z[U])})}m&&Us(m,e,"c");function ee(z,U){P(U)?U.forEach(xe=>z(xe.bind(n))):U&&z(U.bind(n))}if(ee(Dr,v),ee(Bs,C),ee(jr,I),ee(Ur,R),ee(Hr,H),ee(Lr,O),ee(Wr,V),ee(zr,Ne),ee($r,B),ee(Ds,oe),ee(js,W),ee(Kr,k),P(ae))if(ae.length){const z=e.exposed||(e.exposed={});ae.forEach(U=>{Object.defineProperty(z,U,{get:()=>n[U],set:xe=>n[U]=xe})})}else e.exposed||(e.exposed={});ne&&e.render===de&&(e.render=ne),se!=null&&(e.inheritAttrs=se),ue&&(e.components=ue),ke&&(e.directives=ke)}function qr(e,t,n=de,s=!1){P(e)&&(e=Fn(e));for(const i in e){const r=e[i];let o;Q(r)?"default"in r?o=En(r.from||i,r.default,!0):o=En(r.from||i):o=En(r),Z(o)&&s?Object.defineProperty(t,i,{enumerable:!0,configurable:!0,get:()=>o.value,set:c=>o.value=c}):t[i]=o}}function Us(e,t,n){ce(P(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function Ks(e,t,n,s){const i=s.includes(".")?Ss(n,s):()=>n[s];if(X(e)){const r=t[e];A(r)&&Tn(i,r)}else if(A(e))Tn(i,e.bind(n));else if(Q(e))if(P(e))e.forEach(r=>Ks(r,t,n,s));else{const r=A(e.handler)?e.handler.bind(n):t[e.handler];A(r)&&Tn(i,r,e)}}function $s(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:i,optionsCache:r,config:{optionMergeStrategies:o}}=e.appContext,c=r.get(t);let a;return c?a=c:!i.length&&!n&&!s?a=t:(a={},i.length&&i.forEach(h=>Bt(a,h,o,!0)),Bt(a,t,o)),r.set(t,a),a}function Bt(e,t,n,s=!1){const{mixins:i,extends:r}=t;r&&Bt(e,r,n,!0),i&&i.forEach(o=>Bt(e,o,n,!0));for(const o in t)if(!(s&&o==="expose")){const c=Vr[o]||n&&n[o];e[o]=c?c(e[o],t[o]):t[o]}return e}const Vr={data:zs,props:De,emits:De,methods:De,computed:De,beforeCreate:G,created:G,beforeMount:G,mounted:G,beforeUpdate:G,updated:G,beforeDestroy:G,beforeUnmount:G,destroyed:G,unmounted:G,activated:G,deactivated:G,errorCaptured:G,serverPrefetch:G,components:De,directives:De,watch:Yr,provide:zs,inject:Jr};function zs(e,t){return t?e?function(){return Y(A(e)?e.call(this,this):e,A(t)?t.call(this,this):t)}:t:e}function Jr(e,t){return De(Fn(e),Fn(t))}function Fn(e){if(P(e)){const t={};for(let n=0;n0)&&!(o&16)){if(o&8){const m=e.vnode.dynamicProps;for(let v=0;v{a=!0;const[C,I]=ks(v,t,!0);Y(o,C),I&&c.push(...I)};!n&&t.mixins.length&&t.mixins.forEach(m),e.extends&&m(e.extends),e.mixins&&e.mixins.forEach(m)}if(!r&&!a)return s.set(e,Ye),Ye;if(P(r))for(let m=0;m-1,I[1]=H<0||R-1||S(I,"default"))&&c.push(v)}}}const h=[o,c];return s.set(e,h),h}function qs(e){return e[0]!=="$"}function Vs(e){const t=e&&e.toString().match(/^\s*function (\w+)/);return t?t[1]:e===null?"null":""}function Js(e,t){return Vs(e)===Vs(t)}function Ys(e,t){return P(t)?t.findIndex(n=>Js(n,e)):A(t)&&Js(t,e)?0:-1}const Xs=e=>e[0]==="_"||e==="$stable",Nn=e=>P(e)?e.map(be):[be(e)],Qr=(e,t,n)=>{const s=yr((...i)=>Nn(t(...i)),n);return s._c=!1,s},Zs=(e,t,n)=>{const s=e._ctx;for(const i in e){if(Xs(i))continue;const r=e[i];if(A(r))t[i]=Qr(i,r,s);else if(r!=null){const o=Nn(r);t[i]=()=>o}}},Qs=(e,t)=>{const n=Nn(t);e.slots.default=()=>n},Gr=(e,t)=>{if(e.vnode.shapeFlag&32){const n=t._;n?(e.slots=L(t),Et(t,"_",n)):Zs(t,e.slots={})}else e.slots={},t&&Qs(e,t);Et(e.slots,jt,1)},el=(e,t,n)=>{const{vnode:s,slots:i}=e;let r=!0,o=j;if(s.shapeFlag&32){const c=t._;c?n&&c===1?r=!1:(Y(i,t),!n&&c===1&&delete i._):(r=!t.$stable,Zs(t,i)),o=t}else t&&(Qs(e,t),o={default:1});if(r)for(const c in i)!Xs(c)&&!(c in o)&&delete i[c]};function je(e,t,n,s){const i=e.dirs,r=t&&t.dirs;for(let o=0;oRn(C,t&&(P(t)?t[I]:t),n,s,i));return}if(On(s)&&!i)return;const r=s.shapeFlag&4?jn(s.component)||s.component.proxy:s.el,o=i?null:r,{i:c,r:a}=e,h=t&&t.r,m=c.refs===j?c.refs={}:c.refs,v=c.setupState;if(h!=null&&h!==a&&(X(h)?(m[h]=null,S(v,h)&&(v[h]=null)):Z(h)&&(h.value=null)),A(a))Pe(a,c,12,[o,m]);else{const C=X(a),I=Z(a);if(C||I){const R=()=>{if(e.f){const H=C?m[a]:a.value;i?P(H)&&Qt(H,r):P(H)?H.includes(r)||H.push(r):C?m[a]=[r]:(a.value=[r],e.k&&(m[e.k]=a.value))}else C?(m[a]=o,S(v,a)&&(v[a]=o)):Z(a)&&(a.value=o,e.k&&(m[e.k]=o))};o?(R.id=-1,te(R,n)):R()}}}const te=Or;function sl(e){return il(e)}function il(e,t){const n=Ri();n.__VUE__=!0;const{insert:s,remove:i,patchProp:r,createElement:o,createText:c,createComment:a,setText:h,setElementText:m,parentNode:v,nextSibling:C,setScopeId:I=de,cloneNode:R,insertStaticContent:H}=e,O=(l,f,u,p=null,d=null,_=null,w=!1,b=null,x=!!f.dynamicChildren)=>{if(l===f)return;l&&!$e(l,f)&&(p=_t(l),Te(l,d,_,!0),l=null),f.patchFlag===-2&&(x=!1,f.dynamicChildren=null);const{type:g,ref:E,shapeFlag:y}=f;switch(g){case Hn:N(l,f,u,p);break;case Ae:oe(l,f,u,p);break;case Ln:l==null&&q(f,u,p,w);break;case me:ke(l,f,u,p,d,_,w,b,x);break;default:y&1?Ne(l,f,u,p,d,_,w,b,x):y&6?Wn(l,f,u,p,d,_,w,b,x):(y&64||y&128)&&g.process(l,f,u,p,d,_,w,b,x,Ve)}E!=null&&d&&Rn(E,l&&l.ref,_,f||l,!f)},N=(l,f,u,p)=>{if(l==null)s(f.el=c(f.children),u,p);else{const d=f.el=l.el;f.children!==l.children&&h(d,f.children)}},oe=(l,f,u,p)=>{l==null?s(f.el=a(f.children||""),u,p):f.el=l.el},q=(l,f,u,p)=>{[l.el,l.anchor]=H(l.children,f,u,p,l.el,l.anchor)},W=({el:l,anchor:f},u,p)=>{let d;for(;l&&l!==f;)d=C(l),s(l,u,p),l=d;s(f,u,p)},ne=({el:l,anchor:f})=>{let u;for(;l&&l!==f;)u=C(l),i(l),l=u;i(f)},Ne=(l,f,u,p,d,_,w,b,x)=>{w=w||f.type==="svg",l==null?B(f,u,p,d,_,w,b,x):ae(l,f,d,_,w,b,x)},B=(l,f,u,p,d,_,w,b)=>{let x,g;const{type:E,props:y,shapeFlag:T,transition:M,patchFlag:F,dirs:$}=l;if(l.el&&R!==void 0&&F===-1)x=l.el=R(l.el);else{if(x=l.el=o(l.type,_,y&&y.is,y),T&8?m(x,l.children):T&16&&k(l.children,x,null,p,d,_&&E!=="foreignObject",w,b),$&&je(l,null,p,"created"),y){for(const K in y)K!=="value"&&!vt(K)&&r(x,K,null,y[K],_,l.children,p,d,we);"value"in y&&r(x,"value",null,y.value),(g=y.onVnodeBeforeMount)&&_e(g,p,l)}V(x,l,l.scopeId,w,p)}$&&je(l,null,p,"beforeMount");const D=(!d||d&&!d.pendingBranch)&&M&&!M.persisted;D&&M.beforeEnter(x),s(x,f,u),((g=y&&y.onVnodeMounted)||D||$)&&te(()=>{g&&_e(g,p,l),D&&M.enter(x),$&&je(l,null,p,"mounted")},d)},V=(l,f,u,p,d)=>{if(u&&I(l,u),p)for(let _=0;_{for(let g=x;g{const b=f.el=l.el;let{patchFlag:x,dynamicChildren:g,dirs:E}=f;x|=l.patchFlag&16;const y=l.props||j,T=f.props||j;let M;u&&Ue(u,!1),(M=T.onVnodeBeforeUpdate)&&_e(M,u,f,l),E&&je(f,l,u,"beforeUpdate"),u&&Ue(u,!0);const F=d&&f.type!=="foreignObject";if(g?se(l.dynamicChildren,g,b,u,p,F,_):w||xe(l,f,b,null,u,p,F,_,!1),x>0){if(x&16)ue(b,f,y,T,u,p,d);else if(x&2&&y.class!==T.class&&r(b,"class",null,T.class,d),x&4&&r(b,"style",y.style,T.style,d),x&8){const $=f.dynamicProps;for(let D=0;D<$.length;D++){const K=$[D],he=y[K],Je=T[K];(Je!==he||K==="value")&&r(b,K,he,Je,d,l.children,u,p,we)}}x&1&&l.children!==f.children&&m(b,f.children)}else!w&&g==null&&ue(b,f,y,T,u,p,d);((M=T.onVnodeUpdated)||E)&&te(()=>{M&&_e(M,u,f,l),E&&je(f,l,u,"updated")},p)},se=(l,f,u,p,d,_,w)=>{for(let b=0;b{if(u!==p){for(const b in p){if(vt(b))continue;const x=p[b],g=u[b];x!==g&&b!=="value"&&r(l,b,g,x,w,f.children,d,_,we)}if(u!==j)for(const b in u)!vt(b)&&!(b in p)&&r(l,b,u[b],null,w,f.children,d,_,we);"value"in p&&r(l,"value",u.value,p.value)}},ke=(l,f,u,p,d,_,w,b,x)=>{const g=f.el=l?l.el:c(""),E=f.anchor=l?l.anchor:c("");let{patchFlag:y,dynamicChildren:T,slotScopeIds:M}=f;M&&(b=b?b.concat(M):M),l==null?(s(g,u,p),s(E,u,p),k(f.children,u,E,d,_,w,b,x)):y>0&&y&64&&T&&l.dynamicChildren?(se(l.dynamicChildren,T,u,d,_,w,b),(f.key!=null||d&&f===d.subTree)&&ei(l,f,!0)):xe(l,f,u,E,d,_,w,b,x)},Wn=(l,f,u,p,d,_,w,b,x)=>{f.slotScopeIds=b,l==null?f.shapeFlag&512?d.ctx.activate(f,u,p,w,x):Wt(f,u,p,d,_,w,x):ee(l,f,x)},Wt=(l,f,u,p,d,_,w)=>{const b=l.component=bl(l,p,d);if(Ht(l)&&(b.ctx.renderer=Ve),xl(b),b.asyncDep){if(d&&d.registerDep(b,z),!l.el){const x=b.subTree=Fe(Ae);oe(null,x,f,u)}return}z(b,l,f,u,d,_,w)},ee=(l,f,u)=>{const p=f.component=l.component;if(Mr(l,f,u))if(p.asyncDep&&!p.asyncResolved){U(p,f,u);return}else p.next=f,xr(p.update),p.update();else f.component=l.component,f.el=l.el,p.vnode=f},z=(l,f,u,p,d,_,w)=>{const b=()=>{if(l.isMounted){let{next:E,bu:y,u:T,parent:M,vnode:F}=l,$=E,D;Ue(l,!1),E?(E.el=F.el,U(l,E,w)):E=F,y&&nn(y),(D=E.props&&E.props.onVnodeBeforeUpdate)&&_e(D,M,E,F),Ue(l,!0);const K=yn(l),he=l.subTree;l.subTree=K,O(he,K,v(he.el),_t(he),l,d,_),E.el=K.el,$===null&&Ir(l,K.el),T&&te(T,d),(D=E.props&&E.props.onVnodeUpdated)&&te(()=>_e(D,M,E,F),d)}else{let E;const{el:y,props:T}=f,{bm:M,m:F,parent:$}=l,D=On(f);if(Ue(l,!1),M&&nn(M),!D&&(E=T&&T.onVnodeBeforeMount)&&_e(E,$,f),Ue(l,!0),y&&Vt){const K=()=>{l.subTree=yn(l),Vt(y,l.subTree,l,d,null)};D?f.type.__asyncLoader().then(()=>!l.isUnmounted&&K()):K()}else{const K=l.subTree=yn(l);O(null,K,u,p,l,d,_),f.el=K.el}if(F&&te(F,d),!D&&(E=T&&T.onVnodeMounted)){const K=f;te(()=>_e(E,$,K),d)}f.shapeFlag&256&&l.a&&te(l.a,d),l.isMounted=!0,f=u=p=null}},x=l.effect=new cn(b,()=>Cs(l.update),l.scope),g=l.update=x.run.bind(x);g.id=l.uid,Ue(l,!0),g()},U=(l,f,u)=>{f.component=l;const p=l.vnode.props;l.vnode=f,l.next=null,Zr(l,f.props,p,u),el(l,f.children,u),et(),vn(void 0,l.update),Be()},xe=(l,f,u,p,d,_,w,b,x=!1)=>{const g=l&&l.children,E=l?l.shapeFlag:0,y=f.children,{patchFlag:T,shapeFlag:M}=f;if(T>0){if(T&128){ot(g,y,u,p,d,_,w,b,x);return}else if(T&256){kt(g,y,u,p,d,_,w,b,x);return}}M&8?(E&16&&we(g,d,_),y!==g&&m(u,y)):E&16?M&16?ot(g,y,u,p,d,_,w,b,x):we(g,d,_,!0):(E&8&&m(u,""),M&16&&k(y,u,p,d,_,w,b,x))},kt=(l,f,u,p,d,_,w,b,x)=>{l=l||Ye,f=f||Ye;const g=l.length,E=f.length,y=Math.min(g,E);let T;for(T=0;TE?we(l,d,_,!0,!1,y):k(f,u,p,d,_,w,b,x,y)},ot=(l,f,u,p,d,_,w,b,x)=>{let g=0;const E=f.length;let y=l.length-1,T=E-1;for(;g<=y&&g<=T;){const M=l[g],F=f[g]=x?Se(f[g]):be(f[g]);if($e(M,F))O(M,F,u,null,d,_,w,b,x);else break;g++}for(;g<=y&&g<=T;){const M=l[y],F=f[T]=x?Se(f[T]):be(f[T]);if($e(M,F))O(M,F,u,null,d,_,w,b,x);else break;y--,T--}if(g>y){if(g<=T){const M=T+1,F=MT)for(;g<=y;)Te(l[g],d,_,!0),g++;else{const M=g,F=g,$=new Map;for(g=F;g<=T;g++){const ie=f[g]=x?Se(f[g]):be(f[g]);ie.key!=null&&$.set(ie.key,g)}let D,K=0;const he=T-F+1;let Je=!1,Vn=0;const ct=new Array(he);for(g=0;g=he){Te(ie,d,_,!0);continue}let pe;if(ie.key!=null)pe=$.get(ie.key);else for(D=F;D<=T;D++)if(ct[D-F]===0&&$e(ie,f[D])){pe=D;break}pe===void 0?Te(ie,d,_,!0):(ct[pe-F]=g+1,pe>=Vn?Vn=pe:Je=!0,O(ie,f[pe],u,null,d,_,w,b,x),K++)}const Jn=Je?rl(ct):Ye;for(D=Jn.length-1,g=he-1;g>=0;g--){const ie=F+g,pe=f[ie],Yn=ie+1{const{el:_,type:w,transition:b,children:x,shapeFlag:g}=l;if(g&6){qe(l.component.subTree,f,u,p);return}if(g&128){l.suspense.move(f,u,p);return}if(g&64){w.move(l,f,u,Ve);return}if(w===me){s(_,f,u);for(let y=0;yb.enter(_),d);else{const{leave:y,delayLeave:T,afterLeave:M}=b,F=()=>s(_,f,u),$=()=>{y(_,()=>{F(),M&&M()})};T?T(_,F,$):$()}else s(_,f,u)},Te=(l,f,u,p=!1,d=!1)=>{const{type:_,props:w,ref:b,children:x,dynamicChildren:g,shapeFlag:E,patchFlag:y,dirs:T}=l;if(b!=null&&Rn(b,null,u,l,!0),E&256){f.ctx.deactivate(l);return}const M=E&1&&T,F=!On(l);let $;if(F&&($=w&&w.onVnodeBeforeUnmount)&&_e($,f,l),E&6)_i(l.component,u,p);else{if(E&128){l.suspense.unmount(u,p);return}M&&je(l,null,f,"beforeUnmount"),E&64?l.type.remove(l,f,u,d,Ve,p):g&&(_!==me||y>0&&y&64)?we(g,f,u,!1,!0):(_===me&&y&(128|256)||!d&&E&16)&&we(x,f,u),p&&kn(l)}(F&&($=w&&w.onVnodeUnmounted)||M)&&te(()=>{$&&_e($,f,l),M&&je(l,null,f,"unmounted")},u)},kn=l=>{const{type:f,el:u,anchor:p,transition:d}=l;if(f===me){bi(u,p);return}if(f===Ln){ne(l);return}const _=()=>{i(u),d&&!d.persisted&&d.afterLeave&&d.afterLeave()};if(l.shapeFlag&1&&d&&!d.persisted){const{leave:w,delayLeave:b}=d,x=()=>w(u,_);b?b(l.el,_,x):x()}else _()},bi=(l,f)=>{let u;for(;l!==f;)u=C(l),i(l),l=u;i(f)},_i=(l,f,u)=>{const{bum:p,scope:d,update:_,subTree:w,um:b}=l;p&&nn(p),d.stop(),_&&(_.active=!1,Te(w,l,f,u)),b&&te(b,f),te(()=>{l.isUnmounted=!0},f),f&&f.pendingBranch&&!f.isUnmounted&&l.asyncDep&&!l.asyncResolved&&l.suspenseId===f.pendingId&&(f.deps--,f.deps===0&&f.resolve())},we=(l,f,u,p=!1,d=!1,_=0)=>{for(let w=_;wl.shapeFlag&6?_t(l.component.subTree):l.shapeFlag&128?l.suspense.next():C(l.anchor||l.el),qn=(l,f,u)=>{l==null?f._vnode&&Te(f._vnode,null,null,!0):O(f._vnode||null,l,f,null,null,null,u),Ts(),f._vnode=l},Ve={p:O,um:Te,m:qe,r:kn,mt:Wt,mc:k,pc:xe,pbc:se,n:_t,o:e};let qt,Vt;return t&&([qt,Vt]=t(Ve)),{render:qn,hydrate:qt,createApp:nl(qn,qt)}}function Ue({effect:e,update:t},n){e.allowRecurse=t.allowRecurse=n}function ei(e,t,n=!1){const s=e.children,i=t.children;if(P(s)&&P(i))for(let r=0;r>1,e[n[c]]0&&(t[s]=n[r-1]),n[r]=s)}}for(r=n.length,o=n[r-1];r-- >0;)n[r]=o,o=t[o];return n}const ll=e=>e.__isTeleport,ol=Symbol(),me=Symbol(void 0),Hn=Symbol(void 0),Ae=Symbol(void 0),Ln=Symbol(void 0),mt=[];let Ke=null;function to(e=!1){mt.push(Ke=e?null:[])}function cl(){mt.pop(),Ke=mt[mt.length-1]||null}let Dt=1;function ti(e){Dt+=e}function ni(e){return e.dynamicChildren=Dt>0?Ke||Ye:null,cl(),Dt>0&&Ke&&Ke.push(e),e}function no(e,t,n,s,i,r){return ni(ii(e,t,n,s,i,r,!0))}function so(e,t,n,s,i){return ni(Fe(e,t,n,s,i,!0))}function fl(e){return e?e.__v_isVNode===!0:!1}function $e(e,t){return e.type===t.type&&e.key===t.key}const jt="__vInternal",si=({key:e})=>e!=null?e:null,Ut=({ref:e,ref_key:t,ref_for:n})=>e!=null?X(e)||Z(e)||A(e)?{i:ge,r:e,k:t,f:!!n}:e:null;function ii(e,t=null,n=null,s=0,i=null,r=e===me?0:1,o=!1,c=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&si(t),ref:t&&Ut(t),scopeId:Ps,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:s,dynamicProps:i,dynamicChildren:null,appContext:null};return c?(Bn(a,n),r&128&&e.normalize(a)):n&&(a.shapeFlag|=X(n)?8:16),Dt>0&&!o&&Ke&&(a.patchFlag>0||r&6)&&a.patchFlag!==32&&Ke.push(a),a}const Fe=al;function al(e,t=null,n=null,s=0,i=null,r=!1){if((!e||e===ol)&&(e=Ae),fl(e)){const c=rt(e,t,!0);return n&&Bn(c,n),c}if(yl(e)&&(e=e.__vccOpts),t){t=ul(t);let{class:c,style:a}=t;c&&!X(c)&&(t.class=Xt(c)),Q(a)&&(_s(a)&&!P(a)&&(a=Y({},a)),t.style=Yt(a))}const o=X(e)?1:Pr(e)?128:ll(e)?64:Q(e)?4:A(e)?2:0;return ii(e,t,n,s,i,o,r,!0)}function ul(e){return e?_s(e)||jt in e?Y({},e):e:null}function rt(e,t,n=!1){const{props:s,ref:i,patchFlag:r,children:o}=e,c=t?dl(s||{},t):s;return{__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&si(c),ref:t&&t.ref?n&&i?P(i)?i.concat(Ut(t)):[i,Ut(t)]:Ut(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:o,target:e.target,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==me?r===-1?16:r|16:r,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:e.transition,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&rt(e.ssContent),ssFallback:e.ssFallback&&rt(e.ssFallback),el:e.el,anchor:e.anchor}}function hl(e=" ",t=0){return Fe(Hn,null,e,t)}function be(e){return e==null||typeof e=="boolean"?Fe(Ae):P(e)?Fe(me,null,e.slice()):typeof e=="object"?Se(e):Fe(Hn,null,String(e))}function Se(e){return e.el===null||e.memo?e:rt(e)}function Bn(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(P(t))n=16;else if(typeof t=="object")if(s&(1|64)){const i=t.default;i&&(i._c&&(i._d=!1),Bn(e,i()),i._c&&(i._d=!0));return}else{n=32;const i=t._;!i&&!(jt in t)?t._ctx=ge:i===3&&ge&&(ge.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else A(t)?(t={default:t,_ctx:ge},n=32):(t=String(t),s&64?(n=16,t=[hl(t)]):n=8);e.children=t,e.shapeFlag|=n}function dl(...e){const t={};for(let n=0;ne?ri(e)?jn(e)||e.proxy:Dn(e.parent):null,Kt=Y(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Dn(e.parent),$root:e=>Dn(e.root),$emit:e=>e.emit,$options:e=>$s(e),$forceUpdate:e=>()=>Cs(e.update),$nextTick:e=>br.bind(e.proxy),$watch:e=>Fr.bind(e)}),pl={get({_:e},t){const{ctx:n,setupState:s,data:i,props:r,accessCache:o,type:c,appContext:a}=e;let h;if(t[0]!=="$"){const I=o[t];if(I!==void 0)switch(I){case 1:return s[t];case 2:return i[t];case 4:return n[t];case 3:return r[t]}else{if(s!==j&&S(s,t))return o[t]=1,s[t];if(i!==j&&S(i,t))return o[t]=2,i[t];if((h=e.propsOptions[0])&&S(h,t))return o[t]=3,r[t];if(n!==j&&S(n,t))return o[t]=4,n[t];An&&(o[t]=0)}}const m=Kt[t];let v,C;if(m)return t==="$attrs"&&re(e,"get",t),m(e);if((v=c.__cssModules)&&(v=v[t]))return v;if(n!==j&&S(n,t))return o[t]=4,n[t];if(C=a.config.globalProperties,S(C,t))return C[t]},set({_:e},t,n){const{data:s,setupState:i,ctx:r}=e;if(i!==j&&S(i,t))i[t]=n;else if(s!==j&&S(s,t))s[t]=n;else if(S(e.props,t))return!1;return t[0]==="$"&&t.slice(1)in e?!1:(r[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:i,propsOptions:r}},o){let c;return!!n[o]||e!==j&&S(e,o)||t!==j&&S(t,o)||(c=r[0])&&S(c,o)||S(s,o)||S(Kt,o)||S(i.config.globalProperties,o)}},gl=Gs();let ml=0;function bl(e,t,n){const s=e.type,i=(t?t.appContext:e.appContext)||gl,r={uid:ml++,vnode:e,type:s,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,scope:new Hi(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(i.provides),accessCache:null,renderCache:[],components:null,directives:null,propsOptions:ks(s,i),emitsOptions:Is(s,i),emit:null,emitted:null,propsDefaults:j,inheritAttrs:s.inheritAttrs,ctx:j,data:j,props:j,attrs:j,slots:j,refs:j,setupState:j,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return r.ctx={_:r},r.root=t?t.root:r,r.emit=Cr.bind(null,r),e.ce&&e.ce(r),r}let J=null;const _l=()=>J||ge,lt=e=>{J=e,e.scope.on()},ze=()=>{J&&J.scope.off(),J=null};function ri(e){return e.vnode.shapeFlag&4}let bt=!1;function xl(e,t=!1){bt=t;const{props:n,children:s}=e.vnode,i=ri(e);Xr(e,n,i,t),Gr(e,s);const r=i?wl(e,t):void 0;return bt=!1,r}function wl(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=xs(new Proxy(e.ctx,pl));const{setup:s}=n;if(s){const i=e.setupContext=s.length>1?Cl(e):null;lt(e),et();const r=Pe(s,e,0,[e.props,i]);if(Be(),ze(),Zn(r)){if(r.then(ze,ze),t)return r.then(o=>{li(e,o,t)}).catch(o=>{St(o,e,0)});e.asyncDep=r}else li(e,r,t)}else ci(e,t)}function li(e,t,n){A(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Q(t)&&(e.setupState=ws(t)),ci(e,n)}let oi;function ci(e,t,n){const s=e.type;if(!e.render){if(!t&&oi&&!s.render){const i=s.template;if(i){const{isCustomElement:r,compilerOptions:o}=e.appContext.config,{delimiters:c,compilerOptions:a}=s,h=Y(Y({isCustomElement:r,delimiters:c},o),a);s.render=oi(i,h)}}e.render=s.render||de}lt(e),et(),kr(e),Be(),ze()}function vl(e){return new Proxy(e.attrs,{get(t,n){return re(e,"get","$attrs"),t[n]}})}function Cl(e){const t=s=>{e.exposed=s||{}};let n;return{get attrs(){return n||(n=vl(e))},slots:e.slots,emit:e.emit,expose:t}}function jn(e){if(e.exposed)return e.exposeProxy||(e.exposeProxy=new Proxy(ws(xs(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Kt)return Kt[n](e)}}))}function yl(e){return A(e)&&"__vccOpts"in e}const El=(e,t)=>gr(e,t,bt),Tl="3.2.29",Ml="http://www.w3.org/2000/svg",We=typeof document!="undefined"?document:null,fi=We&&We.createElement("template"),Il={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const i=t?We.createElementNS(Ml,e):We.createElement(e,n?{is:n}:void 0);return e==="select"&&s&&s.multiple!=null&&i.setAttribute("multiple",s.multiple),i},createText:e=>We.createTextNode(e),createComment:e=>We.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>We.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},cloneNode(e){const t=e.cloneNode(!0);return"_value"in e&&(t._value=e._value),t},insertStaticContent(e,t,n,s,i,r){const o=n?n.previousSibling:t.lastChild;if(i&&(i===r||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),!(i===r||!(i=i.nextSibling)););else{fi.innerHTML=s?`${e}`:e;const c=fi.content;if(s){const a=c.firstChild;for(;a.firstChild;)c.appendChild(a.firstChild);c.removeChild(a)}t.insertBefore(c,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}};function Pl(e,t,n){const s=e._vtc;s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}function Ol(e,t,n){const s=e.style,i=X(n);if(n&&!i){for(const r in n)Un(s,r,n[r]);if(t&&!X(t))for(const r in t)n[r]==null&&Un(s,r,"")}else{const r=s.display;i?t!==n&&(s.cssText=n):t&&e.removeAttribute("style"),"_vod"in e&&(s.display=r)}}const ai=/\s*!important$/;function Un(e,t,n){if(P(n))n.forEach(s=>Un(e,t,s));else if(t.startsWith("--"))e.setProperty(t,n);else{const s=Al(e,t);ai.test(n)?e.setProperty(Ze(s),n.replace(ai,""),"important"):e[s]=n}}const ui=["Webkit","Moz","ms"],Kn={};function Al(e,t){const n=Kn[t];if(n)return n;let s=Xe(t);if(s!=="filter"&&s in e)return Kn[t]=s;s=Qn(s);for(let i=0;idocument.createEvent("Event").timeStamp&&($t=()=>performance.now());const e=navigator.userAgent.match(/firefox\/(\d+)/i);di=!!(e&&Number(e[1])<=53)}let $n=0;const Nl=Promise.resolve(),Rl=()=>{$n=0},Hl=()=>$n||(Nl.then(Rl),$n=$t());function Ll(e,t,n,s){e.addEventListener(t,n,s)}function Bl(e,t,n,s){e.removeEventListener(t,n,s)}function Dl(e,t,n,s,i=null){const r=e._vei||(e._vei={}),o=r[t];if(s&&o)o.value=s;else{const[c,a]=jl(t);if(s){const h=r[t]=Ul(s,i);Ll(e,c,h,a)}else o&&(Bl(e,c,o,a),r[t]=void 0)}}const pi=/(?:Once|Passive|Capture)$/;function jl(e){let t;if(pi.test(e)){t={};let n;for(;n=e.match(pi);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[Ze(e.slice(2)),t]}function Ul(e,t){const n=s=>{const i=s.timeStamp||$t();(di||i>=n.attached-1)&&ce(Kl(s,n.value),t,5,[s])};return n.value=e,n.attached=Hl(),n}function Kl(e,t){if(P(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(s=>i=>!i._stopped&&s&&s(i))}else return t}const gi=/^on[a-z]/,$l=(e,t,n,s,i=!1,r,o,c,a)=>{t==="class"?Pl(e,s,i):t==="style"?Ol(e,n,s):xt(t)?Zt(t)||Dl(e,t,n,s,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):zl(e,t,s,i))?Sl(e,t,s,r,o,c,a):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),Fl(e,t,s,i))};function zl(e,t,n,s){return s?!!(t==="innerHTML"||t==="textContent"||t in e&&gi.test(t)&&A(n)):t==="spellcheck"||t==="draggable"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA"||gi.test(t)&&X(n)?!1:t in e}const Wl={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String};Rr.props;const kl=Y({patchProp:$l},Il);let mi;function ql(){return mi||(mi=sl(kl))}const io=(...e)=>{const t=ql().createApp(...e),{mount:n}=t;return t.mount=s=>{const i=Vl(s);if(!i)return;const r=t._component;!A(r)&&!r.render&&!r.template&&(r.template=i.innerHTML),i.innerHTML="";const o=n(i,!1,i instanceof SVGElement);return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),o},t};function Vl(e){return X(e)?document.querySelector(e):e}var Ee=(e=1,t=e+1,n=!1)=>{const s=parseFloat(e),i=parseFloat(t),r=Math.random()*(i-s)+s;return n?Math.round(r):r};class zt{constructor({color:t="blue",size:n=10,dropRate:s=10}={}){this.color=t,this.size=n,this.dropRate=s}setup({canvas:t,wind:n,windPosCoef:s,windSpeedMax:i,count:r}){return this.canvas=t,this.wind=n,this.windPosCoef=s,this.windSpeedMax=i,this.x=Ee(-35,this.canvas.width+35),this.y=Ee(-30,-35),this.d=Ee(150)+10,this.particleSize=Ee(this.size,this.size*2),this.tilt=Ee(10),this.tiltAngleIncremental=(Ee(0,.08)+.04)*(Ee()<.5?-1:1),this.tiltAngle=0,this.angle=Ee(Math.PI*2),this.count=r+1,this.remove=!1,this}update(){this.tiltAngle+=this.tiltAngleIncremental*(Math.cos(this.wind+(this.d+this.x+this.y)*this.windPosCoef)*.2+1),this.y+=(Math.cos(this.angle+this.d)+parseInt(this.dropRate,10))/2,this.x+=(Math.sin(this.angle)+Math.cos(this.wind+(this.d+this.x+this.y)*this.windPosCoef))*this.windSpeedMax,this.y+=Math.sin(this.wind+(this.d+this.x+this.y)*this.windPosCoef)*this.windSpeedMax,this.tilt=Math.sin(this.tiltAngle-this.count/3)*15}pastBottom(){return this.y>this.canvas.height}draw(){this.canvas.ctx.fillStyle=this.color,this.canvas.ctx.beginPath(),this.canvas.ctx.setTransform(Math.cos(this.tiltAngle),Math.sin(this.tiltAngle),0,1,this.x,this.y)}kill(){this.remove=!0}}class Jl extends zt{draw(){super.draw(),this.canvas.ctx.arc(0,0,this.particleSize/2,0,Math.PI*2,!1),this.canvas.ctx.fill()}}class Yl extends zt{draw(){super.draw(),this.canvas.ctx.fillRect(0,0,this.particleSize,this.particleSize/2)}}class Xl extends zt{draw(){super.draw();const t=(n,s,i,r,o,c)=>{this.canvas.ctx.bezierCurveTo(n*(this.particleSize/200),s*(this.particleSize/200),i*(this.particleSize/200),r*(this.particleSize/200),o*(this.particleSize/200),c*(this.particleSize/200))};this.canvas.ctx.moveTo(37.5/this.particleSize,20/this.particleSize),t(75,37,70,25,50,25),t(20,25,20,62.5,20,62.5),t(20,80,40,102,75,120),t(110,102,130,80,130,62.5),t(130,62.5,130,25,100,25),t(85,25,75,37,75,40),this.canvas.ctx.fill()}}class Zl extends zt{constructor(t,n){super(t);this.imgEl=n}draw(){super.draw(),this.canvas.ctx.drawImage(this.imgEl,0,0,this.particleSize,this.particleSize)}}class Ql{constructor(){this.cachedImages={}}createImageElement(t){const n=document.createElement("img");return n.setAttribute("src",t),n}getImageElement(t){return this.cachedImages[t]||(this.cachedImages[t]=this.createImageElement(t)),this.cachedImages[t]}getRandomParticle(t={}){const n=t.particles||[];return n.length<1?{}:n[Math.floor(Math.random()*n.length)]}getDefaults(t={}){return{type:t.defaultType||"circle",size:t.defaultSize||10,dropRate:t.defaultDropRate||10,colors:t.defaultColors||["DodgerBlue","OliveDrab","Gold","pink","SlateBlue","lightblue","Violet","PaleGreen","SteelBlue","SandyBrown","Chocolate","Crimson"],url:null}}create(t){const n=this.getDefaults(t),s=this.getRandomParticle(t),i=Object.assign(n,s),r=Ee(0,i.colors.length-1,!0);if(i.color=i.colors[r],i.type==="circle")return new Jl(i);if(i.type==="rect")return new Yl(i);if(i.type==="heart")return new Xl(i);if(i.type==="image")return new Zl(i,this.getImageElement(i.url));throw Error(`Unknown particle type: "${i.type}"`)}}class Gl{constructor(t){this.items=[],this.pool=[],this.particleOptions=t,this.particleFactory=new Ql}update(){const t=[],n=[];this.items.forEach(s=>{s.update(),s.pastBottom()?s.remove||(s.setup(this.particleOptions),t.push(s)):n.push(s)}),this.pool.push(...t),this.items=n}draw(){this.items.forEach(t=>t.draw())}add(){this.pool.length>0?this.items.push(this.pool.pop().setup(this.particleOptions)):this.items.push(this.particleFactory.create(this.particleOptions).setup(this.particleOptions))}refresh(){this.items.forEach(t=>{t.kill()}),this.pool=[]}}class zn{constructor(t){const n="confetti-canvas";if(t&&!(t instanceof HTMLCanvasElement))throw new Error("Element is not a valid HTMLCanvasElement");this.isDefault=!t,this.canvas=t||zn.createDefaultCanvas(n),this.ctx=this.canvas.getContext("2d")}static createDefaultCanvas(t){const n=document.createElement("canvas");return n.style.display="block",n.style.position="fixed",n.style.pointerEvents="none",n.style.top=0,n.style.width="100vw",n.style.height="100vh",n.id=t,document.querySelector("body").appendChild(n),n}get width(){return this.canvas.width}get height(){return this.canvas.height}clear(){this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.width,this.height)}updateDimensions(){!this.isDefault||(this.width!==window.innerWidth||this.height!==window.innerHeight)&&(this.canvas.width=window.innerWidth,this.canvas.height=window.innerHeight)}}class ro{constructor(){this.setDefaults()}setDefaults(){this.killed=!1,this.framesSinceDrop=0,this.canvas=null,this.canvasEl=null,this.W=0,this.H=0,this.particleManager=null,this.particlesPerFrame=0,this.wind=0,this.windSpeed=1,this.windSpeedMax=1,this.windChange=.01,this.windPosCoef=.002,this.animationId=null}getParticleOptions(t){const n={canvas:this.canvas,W:this.W,H:this.H,wind:this.wind,windPosCoef:this.windPosCoef,windSpeedMax:this.windSpeedMax,count:0};return Object.assign(n,t),n}createParticles(t={}){const n=this.getParticleOptions(t);this.particleManager=new Gl(n)}getCanvasElementFromOptions(t){const{canvasId:n,canvasElement:s}=t;let i=s;if(s&&!(s instanceof HTMLCanvasElement))throw new Error("Invalid options: canvasElement is not a valid HTMLCanvasElement");if(n&&s)throw new Error("Invalid options: canvasId and canvasElement are mutually exclusive");if(n&&!i&&(i=document.getElementById(n)),n&&!(i instanceof HTMLCanvasElement))throw new Error(`Invalid options: element with id "${n}" is not a valid HTMLCanvasElement`);return i}start(t={}){this.remove();const n=this.getCanvasElementFromOptions(t);this.canvas=new zn(n),this.canvasEl=n,this.createParticles(t),this.setGlobalOptions(t),this.animationId=requestAnimationFrame(this.mainLoop.bind(this))}setGlobalOptions(t){this.particlesPerFrame=t.particlesPerFrame||2,this.windSpeedMax=t.windSpeedMax||1}stop(){this.killed=!0,this.particlesPerFrame=0}update(t){const n=this.getCanvasElementFromOptions(t);if(this.canvas&&n!==this.canvasEl){this.start(t);return}this.setGlobalOptions(t),this.particleManager&&(this.particleManager.particleOptions=this.getParticleOptions(t),this.particleManager.refresh())}remove(){this.stop(),this.animationId&&cancelAnimationFrame(this.animationId),this.canvas&&this.canvas.clear(),this.setDefaults()}mainLoop(t){this.canvas.updateDimensions(),this.canvas.clear(),this.windSpeed=Math.sin(t/8e3)*this.windSpeedMax,this.wind=this.particleManager.particleOptions.wind+=this.windChange;let n=this.framesSinceDrop*this.particlesPerFrame;for(;n>=1;)this.particleManager.add(),n-=1,this.framesSinceDrop=0;this.particleManager.update(),this.particleManager.draw(),(!this.killed||this.particleManager.items.length)&&(this.animationId=requestAnimationFrame(this.mainLoop.bind(this))),this.framesSinceDrop+=1}}export{ro as C,to as a,so as b,no as c,eo as d,io as e,Bs as o}; 2 | //# sourceMappingURL=vendor.a4d540da.js.map 3 | -------------------------------------------------------------------------------- /src/web/assets/dist/img/RichVariables-menu-icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 11 | 60 | 61 | 62 | 66 | 114 | 115 | 116 | 120 | 121 | 137 | 150 | 151 | 152 | 153 | 154 | 158 | 176 | 177 | 178 | 179 | 180 | 184 | 190 | 191 | 192 | 193 | 194 | 198 | 199 | 214 | 215 | 216 | 217 | 218 | 219 | 223 | 224 | 225 | 228 | 229 | 230 | 231 | 234 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 247 | 255 | 256 | 257 | 258 | 259 | 263 | 275 | 276 | 277 | 278 | 279 | 283 | 284 | 320 | 323 | 326 | 327 | 328 | 329 | 330 | 331 | 335 | 343 | 344 | 345 | 346 | 347 | 351 | 359 | 360 | 361 | 362 | 363 | 370 | 379 | 380 | 381 | 382 | 383 | 387 | 388 | 390 | 392 | 408 | 412 | 413 | 414 | 415 | 416 | 417 | 421 | 422 | 426 | 432 | 433 | 434 | 435 | 436 | 437 | 441 | 442 | 447 | 452 | 456 | 457 | 458 | 459 | 460 | 461 | 465 | 466 | 471 | 476 | 477 | 478 | 479 | 480 | 481 | 485 | 486 | 507 | 508 | 511 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 527 | 539 | 540 | 541 | 542 | 543 | 547 | 559 | 560 | 561 | 562 | 563 | 567 | 568 | 570 | 571 | 572 | 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | 582 | 583 | 584 | 585 | 586 | 587 | 590 | 591 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 608 | 609 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | 623 | 624 | 627 | 628 | 635 | 636 | 637 | 638 | 639 | 640 | 641 | 642 | 645 | 646 | 653 | 654 | 655 | 656 | 657 | 658 | 659 | 660 | 661 | 662 | 666 | 692 | 693 | 694 | 695 | 696 | 700 | 701 | 704 | 707 | 708 | 709 | 710 | 711 | 712 | 716 | 717 | 718 | 719 | 722 | 723 | 724 | 725 | 728 | 729 | 730 | 732 | 733 | 735 | 736 | 738 | 739 | 750 | 751 | 752 | 753 | 754 | 758 | 766 | 767 | 768 | 769 | 770 | 774 | 779 | 780 | 781 | 782 | 783 | 787 | 795 | 796 | 797 | 798 | 799 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 812 | 813 | 814 | 815 | 816 | 817 | 819 | 820 | 821 | 822 | 823 | 833 | 834 | 835 | 836 | 837 | 841 | 846 | 847 | 848 | 849 | 850 | 854 | 885 | 886 | 888 | 890 | 891 | 892 | 893 | 894 | 895 | 899 | 910 | 911 | 912 | 913 | 914 | 918 | 924 | 925 | 926 | 927 | 928 | 932 | 933 | 937 | 938 | 939 | 940 | 941 | 942 | 946 | 947 | 948 | 951 | 956 | 957 | 962 | 963 | 964 | 965 | 966 | 967 | 971 | 972 | 978 | 984 | 990 | 991 | 992 | 993 | 994 | 995 | 999 | 1000 | 1005 | 1009 | 1010 | 1011 | 1012 | 1013 | 1014 | 1015 | 1022 | 1023 | 1024 | 1025 | 1026 | --------------------------------------------------------------------------------