diff --git a/CHANGELOG.md b/CHANGELOG.md index 8049a9710..ea89ca59c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,34 @@ # Solspace Freeform Changelog +## 5.8.3 - 2024-12-16 + +### Fixed +- Fixed a bug where the initial field value wasn't used in the Calculation field. +- Fixed an issue where the resource URLs for sample formatting templates were not fully compatible with Craft Cloud sites. +- Fixed a bug where **Status** was not available in Quick Export. +- Fixed issues with the Stripe webhook. +- Fixed a bug where the form builder **Usage in Elements** tab was not always loading correctly. + +## 5.8.2 - 2024-12-11 + +### Fixed +- Fixed a bug where a user with individual form permissions would not have access to a form they just duplicated. +- Fixed a bug where the automatic purging of old submissions queue job could fail if an empty string was passed for an asset. + +## 5.8.1 - 2024-12-10 + +### Added +- Added Italian translation. + +### Changed +- Changed the _English_ translation from `en-US` to `en`. + +### Fixed +- Fixed a bug where spammy submissions were still being saved to the database when the Spam Folder was disabled. +- Fixed a bug where fresh installs between 5.7.0 and 5.8.0 were missing a new `options` column in the `freeform_email_marketing_fields` and `freeform_crm_fields` database tables. Added a migration for affected installs. +- Fixed a bug where the form name link on the CP submission details page was not linked correctly. +- Fixed a bug where translations for the Error Log notice were missing. + ## 5.8.0 - 2024-12-03 ### Added diff --git a/composer.json b/composer.json index ce3caf9c8..72b9cdf31 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "solspace/craft-freeform", "description": "The most reliable form builder that's ready for wherever your project takes you.", - "version": "5.8.0", + "version": "5.8.3", "type": "craft-plugin", "authors": [ { diff --git a/packages/plugin/src/Bundles/Fields/Implementations/FileUpload/FileRemovalOnSubmissionDelete.php b/packages/plugin/src/Bundles/Fields/Implementations/FileUpload/FileRemovalOnSubmissionDelete.php index fa4c4d7d7..df273f78e 100644 --- a/packages/plugin/src/Bundles/Fields/Implementations/FileUpload/FileRemovalOnSubmissionDelete.php +++ b/packages/plugin/src/Bundles/Fields/Implementations/FileUpload/FileRemovalOnSubmissionDelete.php @@ -29,7 +29,9 @@ public function removeSubmissionFiles(Event $event): void if (\is_array($value)) { foreach ($value as $id) { - \Craft::$app->elements->deleteElementById($id); + if (\is_int($id)) { + \Craft::$app->elements->deleteElementById($id); + } } } } diff --git a/packages/plugin/src/Bundles/Form/Types/Regular/AttachFormLinks.php b/packages/plugin/src/Bundles/Form/Types/Regular/AttachFormLinks.php index dc92880d5..b9aca954f 100644 --- a/packages/plugin/src/Bundles/Form/Types/Regular/AttachFormLinks.php +++ b/packages/plugin/src/Bundles/Form/Types/Regular/AttachFormLinks.php @@ -21,6 +21,11 @@ function (GenerateLinksEvent $event) { $form = $event->getForm(); $data = $event->getFormData(); + static $isSpamEnabled; + if (null === $isSpamEnabled) { + $isSpamEnabled = Freeform::getInstance()->settings->isSpamFolderEnabled(); + } + $canManageForm = PermissionHelper::checkPermission(Freeform::PERMISSION_FORMS_MANAGE); if (!$canManageForm) { $canManageForm = PermissionHelper::checkPermission( @@ -77,7 +82,7 @@ function (GenerateLinksEvent $event) { $event->add( $spam, 'spam', - $canManageSubmissions ? UrlHelper::cpUrl('freeform/spam?source=form:'.$form->getId()) : null, + $isSpamEnabled && $canManageSubmissions ? UrlHelper::cpUrl('freeform/spam?source=form:'.$form->getId()) : null, 'linkList', $spamCount, ); diff --git a/packages/plugin/src/Bundles/Persistence/Duplication/FormDuplicator.php b/packages/plugin/src/Bundles/Persistence/Duplication/FormDuplicator.php index b85b28940..73841d159 100644 --- a/packages/plugin/src/Bundles/Persistence/Duplication/FormDuplicator.php +++ b/packages/plugin/src/Bundles/Persistence/Duplication/FormDuplicator.php @@ -2,12 +2,18 @@ namespace Solspace\Freeform\Bundles\Persistence\Duplication; +use craft\db\Query; +use craft\db\Table; use craft\helpers\StringHelper; +use craft\records\UserPermission; +use craft\records\UserPermission_User; +use craft\records\UserPermission_UserGroup; use Solspace\Freeform\Attributes\Property\Input\Field; use Solspace\Freeform\Attributes\Property\Input\Special\Properties\FieldMapping; use Solspace\Freeform\Bundles\Attributes\Property\PropertyProvider; use Solspace\Freeform\Fields\Implementations\Pro\GroupField; use Solspace\Freeform\Form\Managers\ContentManager; +use Solspace\Freeform\Freeform; use Solspace\Freeform\Library\Helpers\JsonHelper; use Solspace\Freeform\Library\Helpers\StringHelper as FreeformStringHelper; use Solspace\Freeform\Notifications\Types\Conditional\Conditional; @@ -83,6 +89,7 @@ public function clone(int $id): bool $this->cloneNotifications($id, $form); $this->cloneRules($id, $form); $this->cloneIntegrations($id, $form); + $this->updatePermissions($id, $form); $form = $this->formsService->getFormById($form->id); @@ -402,6 +409,66 @@ private function cloneIntegrations(int $originalId, FormRecord $form): void } } + private function updatePermissions(int $id, FormRecord $form): void + { + $userId = \Craft::$app->user->getIdentity()->id; + $permissions = [ + Freeform::PERMISSION_SUBMISSIONS_READ, + Freeform::PERMISSION_SUBMISSIONS_MANAGE, + Freeform::PERMISSION_FORMS_MANAGE, + ]; + + foreach ($permissions as $permissionName) { + $name = strtolower($permissionName.':'.$id); + $newName = strtolower($permissionName.':'.$form->id); + + $permissionId = (int) (new Query()) + ->select('id') + ->from(Table::USERPERMISSIONS) + ->where(['name' => $name]) + ->scalar() + ; + + $groupIds = (new Query()) + ->select('groupId') + ->from(Table::USERPERMISSIONS_USERGROUPS) + ->where(['permissionId' => $permissionId]) + ->column() + ; + + $userPermissionId = (new Query()) + ->select('id') + ->from(Table::USERPERMISSIONS_USERS) + ->where([ + 'permissionId' => $permissionId, + 'userId' => $userId, + ]) + ->scalar() + ; + + $permission = UserPermission::find()->where(['name' => $newName])->one(); + if (!$permission) { + $permission = new UserPermission(); + $permission->name = $newName; + $permission->save(); + } + + if ($userPermissionId) { + $userPermission = new UserPermission_User(); + $userPermission->userId = $userId; + $userPermission->permissionId = $permission->id; + $userPermission->save(); + } else { + foreach ($groupIds as $groupId) { + $groupPermission = new UserPermission_UserGroup(); + $groupPermission->groupId = $groupId; + $groupPermission->permissionId = $permission->id; + $groupPermission->save(); + } + } + } + } + private function warmUpLayout(int $formId): void { $this->layouts = $this->fetchRecords(FormLayoutRecord::class, $formId); diff --git a/packages/plugin/src/Bundles/Spam/SpamBundle.php b/packages/plugin/src/Bundles/Spam/SpamBundle.php index de8e0c439..c119b5440 100644 --- a/packages/plugin/src/Bundles/Spam/SpamBundle.php +++ b/packages/plugin/src/Bundles/Spam/SpamBundle.php @@ -4,7 +4,9 @@ use Solspace\Freeform\Elements\SpamSubmission; use Solspace\Freeform\Elements\Submission; +use Solspace\Freeform\Events\Forms\SubmitEvent; use Solspace\Freeform\Events\Submissions\ProcessSubmissionEvent; +use Solspace\Freeform\Form\Form; use Solspace\Freeform\Library\Bundles\FeatureBundle; use yii\base\Event; @@ -12,6 +14,12 @@ class SpamBundle extends FeatureBundle { public function __construct() { + Event::on( + Form::class, + Form::EVENT_SUBMIT, + [$this, 'onFormSubmit'] + ); + Event::on( Submission::class, Submission::EVENT_PROCESS_SUBMISSION, @@ -24,6 +32,21 @@ public static function getPriority(): int return 800; } + public function onFormSubmit(SubmitEvent $event): void + { + $form = $event->getForm(); + if (!$form->isMarkedAsSpam()) { + return; + } + + $isSpamFolderEnabled = $this->plugin()->settings->isSpamFolderEnabled(); + if ($isSpamFolderEnabled) { + return; + } + + $event->isValid = false; + } + public function processSpamSubmission(ProcessSubmissionEvent $event): void { // TODO: refactor due to mailing list field changes diff --git a/packages/plugin/src/Integrations/Elements/User/README.md b/packages/plugin/src/Integrations/Elements/User/README.md index 8a310a710..d3019432b 100644 --- a/packages/plugin/src/Integrations/Elements/User/README.md +++ b/packages/plugin/src/Integrations/Elements/User/README.md @@ -1,5 +1,5 @@ # Setup Guide -This integration allows you to map Freeform submission data to [Craft User](https://craftcms.com/docs/4.x/users.html), essentially creating a powerful [User Registration form](https://docs.solspace.com/craft/freeform/v5/guides/user-registration-forms/). +This integration allows you to map Freeform submission data to [Craft User](https://craftcms.com/docs/4.x/users.html), essentially creating a powerful [User Registration form](https://docs.solspace.com/craft/freeform/v5/guides/speciality-forms/user-registration/). Important: This feature requires a Craft Pro license in order to work, as Users are a Craft Pro feature. diff --git a/packages/plugin/src/Integrations/PaymentGateways/Stripe/Controllers/StripeWebhookController.php b/packages/plugin/src/Integrations/PaymentGateways/Stripe/Controllers/StripeWebhookController.php index 82332d204..af148e84b 100644 --- a/packages/plugin/src/Integrations/PaymentGateways/Stripe/Controllers/StripeWebhookController.php +++ b/packages/plugin/src/Integrations/PaymentGateways/Stripe/Controllers/StripeWebhookController.php @@ -31,7 +31,8 @@ public function actionWebhooks(): Response $json = json_decode($payload, false); $header = $_SERVER['HTTP_STRIPE_SIGNATURE'] ?? null; - $hash = $json->data->object->metadata->hash; + $hash = $json->data->object->subscription_details->metadata->hash ?? $json->data->object->metadata->hash; + [, $integration] = $this->getRequestItems($hash); $secret = $integration->getWebhookSecret(); diff --git a/packages/plugin/src/Resources/Bundles/FormattingTemplates/BasicDarkBundle.php b/packages/plugin/src/Resources/Bundles/FormattingTemplates/BasicDarkBundle.php index 627113315..3af3d8171 100644 --- a/packages/plugin/src/Resources/Bundles/FormattingTemplates/BasicDarkBundle.php +++ b/packages/plugin/src/Resources/Bundles/FormattingTemplates/BasicDarkBundle.php @@ -8,7 +8,7 @@ class BasicDarkBundle extends AssetBundle { public function init(): void { - $this->sourcePath = '@freeform-formatting-templates/basic-dark'; + $this->sourcePath = '@Solspace/Freeform/templates/_templates/formatting/basic-dark'; $this->js = ['_main.js']; $this->css = ['_main.css']; diff --git a/packages/plugin/src/Resources/Bundles/FormattingTemplates/BasicFloatingLabelsBundle.php b/packages/plugin/src/Resources/Bundles/FormattingTemplates/BasicFloatingLabelsBundle.php index 88d358e7e..33e26ffc9 100644 --- a/packages/plugin/src/Resources/Bundles/FormattingTemplates/BasicFloatingLabelsBundle.php +++ b/packages/plugin/src/Resources/Bundles/FormattingTemplates/BasicFloatingLabelsBundle.php @@ -8,7 +8,7 @@ class BasicFloatingLabelsBundle extends AssetBundle { public function init(): void { - $this->sourcePath = '@freeform-formatting-templates/basic-floating-labels'; + $this->sourcePath = '@Solspace/Freeform/templates/_templates/formatting/basic-floating-labels'; $this->js = ['_main.js']; $this->css = ['_main.css']; diff --git a/packages/plugin/src/Resources/Bundles/FormattingTemplates/BasicLightBundle.php b/packages/plugin/src/Resources/Bundles/FormattingTemplates/BasicLightBundle.php index 3467f8b0e..6fa340957 100644 --- a/packages/plugin/src/Resources/Bundles/FormattingTemplates/BasicLightBundle.php +++ b/packages/plugin/src/Resources/Bundles/FormattingTemplates/BasicLightBundle.php @@ -8,7 +8,7 @@ class BasicLightBundle extends AssetBundle { public function init(): void { - $this->sourcePath = '@freeform-formatting-templates/basic-light'; + $this->sourcePath = '@Solspace/Freeform/templates/_templates/formatting/basic-light'; $this->js = ['_main.js']; $this->css = ['_main.css']; diff --git a/packages/plugin/src/Resources/Bundles/FormattingTemplates/Bootstrap5Bundle.php b/packages/plugin/src/Resources/Bundles/FormattingTemplates/Bootstrap5Bundle.php index 43ced12d2..aa0a4a974 100644 --- a/packages/plugin/src/Resources/Bundles/FormattingTemplates/Bootstrap5Bundle.php +++ b/packages/plugin/src/Resources/Bundles/FormattingTemplates/Bootstrap5Bundle.php @@ -8,7 +8,7 @@ class Bootstrap5Bundle extends AssetBundle { public function init(): void { - $this->sourcePath = '@freeform-formatting-templates/bootstrap-5'; + $this->sourcePath = '@Solspace/Freeform/templates/_templates/formatting/bootstrap-5'; $this->js = ['_main.js']; $this->css = ['_main.css']; diff --git a/packages/plugin/src/Resources/Bundles/FormattingTemplates/Bootstrap5DarkBundle.php b/packages/plugin/src/Resources/Bundles/FormattingTemplates/Bootstrap5DarkBundle.php index dd07e4d10..b413f3e0c 100644 --- a/packages/plugin/src/Resources/Bundles/FormattingTemplates/Bootstrap5DarkBundle.php +++ b/packages/plugin/src/Resources/Bundles/FormattingTemplates/Bootstrap5DarkBundle.php @@ -8,7 +8,7 @@ class Bootstrap5DarkBundle extends AssetBundle { public function init(): void { - $this->sourcePath = '@freeform-formatting-templates/bootstrap-5-dark'; + $this->sourcePath = '@Solspace/Freeform/templates/_templates/formatting/bootstrap-5-dark'; $this->js = ['_main.js']; $this->css = ['_main.css']; diff --git a/packages/plugin/src/Resources/Bundles/FormattingTemplates/Bootstrap5FloatingLabelsBundle.php b/packages/plugin/src/Resources/Bundles/FormattingTemplates/Bootstrap5FloatingLabelsBundle.php index 0f3eaed1d..86c281147 100644 --- a/packages/plugin/src/Resources/Bundles/FormattingTemplates/Bootstrap5FloatingLabelsBundle.php +++ b/packages/plugin/src/Resources/Bundles/FormattingTemplates/Bootstrap5FloatingLabelsBundle.php @@ -8,7 +8,7 @@ class Bootstrap5FloatingLabelsBundle extends AssetBundle { public function init(): void { - $this->sourcePath = '@freeform-formatting-templates/bootstrap-5-floating-labels'; + $this->sourcePath = '@Solspace/Freeform/templates/_templates/formatting/bootstrap-5-floating-labels'; $this->js = ['_main.js']; $this->css = ['_main.css']; diff --git a/packages/plugin/src/Resources/Bundles/FormattingTemplates/ConversationalBundle.php b/packages/plugin/src/Resources/Bundles/FormattingTemplates/ConversationalBundle.php index 46b49572e..f1ce95eb6 100644 --- a/packages/plugin/src/Resources/Bundles/FormattingTemplates/ConversationalBundle.php +++ b/packages/plugin/src/Resources/Bundles/FormattingTemplates/ConversationalBundle.php @@ -8,7 +8,7 @@ class ConversationalBundle extends AssetBundle { public function init(): void { - $this->sourcePath = '@freeform-formatting-templates/conversational'; + $this->sourcePath = '@Solspace/Freeform/templates/_templates/formatting/conversational'; $this->js = ['_main.js']; $this->css = ['_main.css']; diff --git a/packages/plugin/src/Resources/Bundles/FormattingTemplates/FlexboxBundle.php b/packages/plugin/src/Resources/Bundles/FormattingTemplates/FlexboxBundle.php index 29004f694..b78d61a71 100644 --- a/packages/plugin/src/Resources/Bundles/FormattingTemplates/FlexboxBundle.php +++ b/packages/plugin/src/Resources/Bundles/FormattingTemplates/FlexboxBundle.php @@ -8,7 +8,7 @@ class FlexboxBundle extends AssetBundle { public function init(): void { - $this->sourcePath = '@freeform-formatting-templates/flexbox'; + $this->sourcePath = '@Solspace/Freeform/templates/_templates/formatting/flexbox'; $this->js = ['_main.js']; $this->css = ['_main.css']; diff --git a/packages/plugin/src/Resources/Bundles/FormattingTemplates/Foundation6Bundle.php b/packages/plugin/src/Resources/Bundles/FormattingTemplates/Foundation6Bundle.php index 1b66e5448..5b2c0ae65 100644 --- a/packages/plugin/src/Resources/Bundles/FormattingTemplates/Foundation6Bundle.php +++ b/packages/plugin/src/Resources/Bundles/FormattingTemplates/Foundation6Bundle.php @@ -8,7 +8,7 @@ class Foundation6Bundle extends AssetBundle { public function init(): void { - $this->sourcePath = '@freeform-formatting-templates/foundation-6'; + $this->sourcePath = '@Solspace/Freeform/templates/_templates/formatting/foundation-6'; $this->js = ['_main.js']; $this->css = ['_main.css']; diff --git a/packages/plugin/src/Resources/Bundles/FormattingTemplates/GridBundle.php b/packages/plugin/src/Resources/Bundles/FormattingTemplates/GridBundle.php index 30e6a8442..acaa14a66 100644 --- a/packages/plugin/src/Resources/Bundles/FormattingTemplates/GridBundle.php +++ b/packages/plugin/src/Resources/Bundles/FormattingTemplates/GridBundle.php @@ -8,7 +8,7 @@ class GridBundle extends AssetBundle { public function init(): void { - $this->sourcePath = '@freeform-formatting-templates/grid'; + $this->sourcePath = '@Solspace/Freeform/templates/_templates/formatting/grid'; $this->js = ['_main.js']; $this->css = ['_main.css']; diff --git a/packages/plugin/src/Resources/Bundles/FormattingTemplates/MultipageAllFieldsBundle.php b/packages/plugin/src/Resources/Bundles/FormattingTemplates/MultipageAllFieldsBundle.php index 8d85c4490..41d94454a 100644 --- a/packages/plugin/src/Resources/Bundles/FormattingTemplates/MultipageAllFieldsBundle.php +++ b/packages/plugin/src/Resources/Bundles/FormattingTemplates/MultipageAllFieldsBundle.php @@ -8,7 +8,7 @@ class MultipageAllFieldsBundle extends AssetBundle { public function init(): void { - $this->sourcePath = '@freeform-formatting-templates/multipage-all-fields'; + $this->sourcePath = '@Solspace/Freeform/templates/_templates/formatting/multipage-all-fields'; $this->js = ['_main.js']; $this->css = ['_main.css']; diff --git a/packages/plugin/src/Resources/Bundles/FormattingTemplates/Tailwind3Bundle.php b/packages/plugin/src/Resources/Bundles/FormattingTemplates/Tailwind3Bundle.php index fd602180c..9c2579fc1 100644 --- a/packages/plugin/src/Resources/Bundles/FormattingTemplates/Tailwind3Bundle.php +++ b/packages/plugin/src/Resources/Bundles/FormattingTemplates/Tailwind3Bundle.php @@ -8,7 +8,7 @@ class Tailwind3Bundle extends AssetBundle { public function init(): void { - $this->sourcePath = '@freeform-formatting-templates/tailwind-3'; + $this->sourcePath = '@Solspace/Freeform/templates/_templates/formatting/tailwind-3'; $this->js = ['_main.js']; $this->css = ['_main.css']; diff --git a/packages/plugin/src/Resources/js/scripts/front-end/fields/calculation.js b/packages/plugin/src/Resources/js/scripts/front-end/fields/calculation.js index 8418c1622..067e2c3fd 100644 --- a/packages/plugin/src/Resources/js/scripts/front-end/fields/calculation.js +++ b/packages/plugin/src/Resources/js/scripts/front-end/fields/calculation.js @@ -1 +1 @@ -!function(){"use strict";var e,t,r,n,i,s,a,o={1968:function(e,t){function r(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Object.defineProperty(t,"__esModule",{value:!0}),t.CacheItem=t.default=void 0,t.default=class{constructor(e=0){r(this,"createCacheItem",((e,t,r)=>{let i=new n;return i.key=e,i.value=t,i.isHit=r,i.defaultLifetime=this.defaultLifetime,i})),r(this,"get",((e,t,r=null,n=null)=>{let i=this.getItem(e);if(!i.isHit){let e=!0;this.save(i.set(t(i,e)))}return i.get()})),r(this,"getItem",(e=>{let t=this.hasItem(e),r=null;return t?r=this.values[e]:this.values[e]=null,(0,this.createCacheItem)(e,r,t)})),r(this,"getItems",(e=>{for(let t of e)"string"==typeof t||this.expiries[t]||n.validateKey(t);return this.generateItems(e,(new Date).getTime()/1e3,this.createCacheItem)})),r(this,"deleteItems",(e=>{for(let t of e)this.deleteItem(t);return!0})),r(this,"save",(e=>!(!e instanceof n||(null!==e.expiry&&e.expiry<=(new Date).getTime()/1e3?(this.deleteItem(e.key),0):(null===e.expiry&&0this.save(e))),r(this,"commit",(()=>!0)),r(this,"delete",(e=>this.deleteItem(e))),r(this,"getValues",(()=>this.values)),r(this,"hasItem",(e=>!!("string"==typeof e&&this.expiries[e]&&this.expiries[e]>(new Date).getTime()/1e3)||(n.validateKey(e),!!this.expiries[e]&&!this.deleteItem(e)))),r(this,"clear",(()=>(this.values={},this.expiries={},!0))),r(this,"deleteItem",(e=>("string"==typeof e&&this.expiries[e]||n.validateKey(e),delete this.values[e],delete this.expiries[e],!0))),r(this,"reset",(()=>{this.clear()})),r(this,"generateItems",((e,t,r)=>{let n=[];for(let i of e){let e=null,s=!!this.expiries[i];s||!(this.expiries[i]>t)&&this.deleteItem(i)?e=this.values[i]:this.values[i]=null,n[i]=r(i,e,s)}return n})),this.defaultLifetime=e,this.values={},this.expiries={}}};class n{constructor(){r(this,"getKey",(()=>this.key)),r(this,"get",(()=>this.value)),r(this,"set",(e=>(this.value=e,this))),r(this,"expiresAt",(e=>{if(null===e)this.expiry=this.defaultLifetime>0?Date.now()/1e3+this.defaultLifetime:null;else{if(!(e instanceof Date))throw new Error(`Expiration date must be instance of Date or be null, "${e.name}" given`);this.expiry=e.getTime()/1e3}return this})),r(this,"expiresAfter",(e=>{if(null===e)this.expiry=this.defaultLifetime>0?Date.now()/1e3+this.defaultLifetime:null;else{if(!Number.isInteger(e))throw new Error(`Expiration date must be an integer or be null, "${e.name}" given`);this.expiry=(new Date).getTime()/1e3+e}return this})),r(this,"tag",(e=>{if(!this.isTaggable)throw new Error(`Cache item "${this.key}" comes from a non tag-aware pool: you cannot tag it.`);Array.isArray(e)||(e=[e]);for(let t of e){if("string"!=typeof t)throw new Error(`Cache tag must by a string, "${typeof t}" given.`);if(this.newMetadata.tags[t]&&""===t)throw new Error("Cache tag length must be greater than zero");this.newMetadata.tags[t]=t}return this})),r(this,"getMetadata",(()=>this.metadata)),this.key=null,this.value=null,this.isHit=!1,this.expiry=null,this.defaultLifetime=null,this.metadata={},this.newMetadata={},this.innerItem=null,this.poolHash=null,this.isTaggable=!1}}t.CacheItem=n,r(n,"METADATA_EXPIRY_OFFSET",1527506807),r(n,"RESERVED_CHARACTERS",["{","}","(",")","/","\\","@",":"]),r(n,"validateKey",(e=>{if("string"!=typeof e)throw new Error(`Cache key must be string, "${typeof e}" given.`);if(""===e)throw new Error("Cache key length must be greater than zero");for(let t of n.RESERVED_CHARACTERS)if(e.indexOf(t)>=0)throw new Error(`Cache key "${e}" contains reserved character "${t}".`);return e}))},1095:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(7164);function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}t.default=class{constructor(e){i(this,"getFunction",(e=>this.functions[e])),i(this,"getSource",(()=>this.source)),i(this,"reset",(()=>(this.source="",this))),i(this,"compile",(e=>(e.compile(this),this))),i(this,"subcompile",(e=>{let t=this.source;this.source="",e.compile(this);let r=this.source;return this.source=t,r})),i(this,"raw",(e=>(this.source+=e,this))),i(this,"string",(e=>(this.source+='"'+(0,n.addcslashes)(e,'\0\t"$\\')+'"',this))),i(this,"repr",((e,t=!1)=>{if(t)this.raw(e);else if(Number.isInteger(e)||+e===e&&(!isFinite(e)||e%1))this.raw(e);else if(null===e)this.raw("null");else if("boolean"==typeof e)this.raw(e?"true":"false");else if("object"==typeof e){this.raw("{");let t=!0;for(let r of Object.keys(e))t||this.raw(", "),t=!1,this.repr(r),this.raw(":"),this.repr(e[r]);this.raw("}")}else if(Array.isArray(e)){this.raw("[");let t=!0;for(let r of e)t||this.raw(", "),t=!1,this.repr(r);this.raw("]")}else this.string(e);return this})),this.source="",this.functions=e}}},3733:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=class{constructor(e){this.expression=e}toString(){return this.expression}}},8104:function(e,t){function r(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=class{constructor(e,t,n){r(this,"getName",(()=>this.name)),r(this,"getCompiler",(()=>this.compiler)),r(this,"getEvaluator",(()=>this.evaluator)),this.name=e,this.compiler=t,this.evaluator=n}}},339:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(3861),i=l(r(2066)),s=l(r(1095)),a=l(r(3763)),o=l(r(1968)),u=l(r(3435));function l(e){return e&&e.__esModule?e:{default:e}}function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}t.default=class{constructor(e=null,t=[]){c(this,"compile",((e,t=[])=>this.getCompiler().compile(this.parse(e,t).getNodes()).getSource())),c(this,"evaluate",((e,t={})=>this.parse(e,Object.keys(t)).getNodes().evaluate(this.functions,t))),c(this,"parse",((e,t)=>{if(e instanceof a.default)return e;t.sort(((e,t)=>{let r=e,n=t;return"object"==typeof e&&(r=Object.values(e)[0]),"object"==typeof t&&(n=Object.values(t)[0]),r.localeCompare(n)}));let r=[];for(let e of t){let t=e;"object"==typeof e&&(t=Object.keys(e)[0]+":"+Object.values(e)[0]),r.push(t)}let i=this.cache.getItem(this.fixedEncodeURIComponent(e+"//"+r.join("|"))),s=i.get();if(null===s){let r=this.getParser().parse((0,n.tokenize)(e),t);s=new a.default(e,r),i.set(s),this.cache.save(i)}return s})),c(this,"fixedEncodeURIComponent",(e=>encodeURIComponent(e).replace(/[!'()*]/g,(function(e){return"%"+e.charCodeAt(0).toString(16)})))),c(this,"register",((e,t,r)=>{if(null!==this.parser)throw new u.default("Registering functions after calling evaluate(), compile(), or parse() is not supported.");this.functions[e]={compiler:t,evaluator:r}})),c(this,"addFunction",(e=>{this.register(e.getName(),e.getCompiler(),e.getEvaluator())})),c(this,"registerProvider",(e=>{for(let t of e.getFunctions())this.addFunction(t)})),c(this,"getParser",(()=>(null===this.parser&&(this.parser=new i.default(this.functions)),this.parser))),c(this,"getCompiler",(()=>(null===this.compiler&&(this.compiler=new s.default(this.functions)),this.compiler.reset()))),this.functions=[],this.parser=null,this.compiler=null,this.cache=e||new o.default;for(let e of t)this.registerProvider(e)}_registerFunctions(){}}},3861:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.tokenize=function(e){let t=0,r=[],n=[],o=(e=e.replace(/\r|\n|\t|\v|\f/g," ")).length;for(;t=0)n.push([e[t],t]),r.push(new s.Token(s.Token.PUNCTUATION_TYPE,e[t],t+1)),++t;else if(")]}".indexOf(e[t])>=0){if(0===n.length)throw new i.default(`Unexpected "${e[t]}"`,t,e);let[a,o]=n.pop(),u=a.replace("(",")").replace("{","}").replace("[","]");if(e[t]!==u)throw new i.default(`Unclosed "${a}"`,o,e);r.push(new s.Token(s.Token.PUNCTUATION_TYPE,e[t],t+1)),++t}else{let n=u(e.substr(t));if(null!==n)r.push(new s.Token(s.Token.STRING_TYPE,n.captured,t+1)),t+=n.length;else{let n=h(e.substr(t));if(n)r.push(new s.Token(s.Token.OPERATOR_TYPE,n,t+1)),t+=n.length;else if(".,?:".indexOf(e[t])>=0)r.push(new s.Token(s.Token.PUNCTUATION_TYPE,e[t],t+1)),++t;else{let n=f(e.substr(t));if(!n)throw new i.default(`Unexpected character "${e[t]}"`,t,e);r.push(new s.Token(s.Token.NAME_TYPE,n,t+1)),t+=n.length}}}}if(r.push(new s.Token(s.Token.EOF_TYPE,null,t+1)),n.length>0){let[t,r]=n.pop();throw new i.default(`Unclosed "${t}"`,r,e)}return new s.TokenStream(e,r)};var n,i=(n=r(6053))&&n.__esModule?n:{default:n},s=r(9632);function a(e){let t=null,r=e.match(/^[0-9]+(?:.[0-9]+)?/);return r&&r.length>0&&(t=r[0],t=-1===t.indexOf(".")?parseInt(t):parseFloat(t)),t}const o=/^"([^"\\]*(?:\\.[^"\\]*)*)"|'([^'\\]*(?:\\.[^'\\]*)*)'/s;function u(e){let t=null;if(-1===["'",'"'].indexOf(e.substr(0,1)))return t;let r=o.exec(e);return null!==r&&r.length>0&&(t=r[1]?{captured:r[1]}:{captured:r[2]},t.length=r[0].length),t}const l=["&&","and","||","or","+","-","*","/","%","**","&","|","^","===","!==","!=","==","<=",">=","<",">","matches","not in","in","not","!","~",".."],c=["and","or","matches","not in","in","not"];function h(e){let t=null;for(let r of l)if(e.substr(0,r.length)===r){c.indexOf(r)>=0?e.substr(0,r.length+1)===r+" "&&(t=r):t=r;break}return t}function f(e){let t=null,r=e.match(/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/);return r&&r.length>0&&(t=r[0]),t}},3435:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;class r extends Error{constructor(e){super(e),this.name="LogicException"}toString(){return`${this.name}: ${this.message}`}}t.default=r},4950:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(8278))&&n.__esModule?n:{default:n};class s extends i.default{constructor(){super(),function(e,t,r){t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(this,"compile",(e=>{this.compileArguments(e,!1)})),this.name="ArgumentsNode"}toArray(){let e=[];for(let t of this.getKeyValuePairs())e.push(t.value),e.push(", ");return e.pop(),e}}t.default=s},8278:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=s(r(3e3)),i=s(r(4985));function s(e){return e&&e.__esModule?e:{default:e}}function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class o extends n.default{constructor(){super(),a(this,"addElement",((e,t=null)=>{null===t?t=new i.default(++this.index):"Array"===this.type&&(this.type="Object"),this.nodes[(++this.keyIndex).toString()]=t,this.nodes[(++this.keyIndex).toString()]=e})),a(this,"compile",(e=>{"Object"===this.type?e.raw("{"):e.raw("["),this.compileArguments(e,"Array"!==this.type),"Object"===this.type?e.raw("}"):e.raw("]")})),a(this,"evaluate",((e,t)=>{let r;if("Array"===this.type){r=[];for(let n of this.getKeyValuePairs())r.push(n.value.evaluate(e,t))}else{r={};for(let n of this.getKeyValuePairs())r[n.key.evaluate(e,t)]=n.value.evaluate(e,t)}return r})),a(this,"getKeyValuePairs",(()=>{let e,t,r,n=[],i=Object.values(this.nodes);for(e=0,t=i.length;e{let r=!0;for(let n of this.getKeyValuePairs())r||e.raw(", "),r=!1,t&&e.compile(n.key).raw(": "),e.compile(n.value)})),this.name="ArrayNode",this.type="Array",this.index=-1,this.keyIndex=-1}toArray(){let e={};for(let t of this.getKeyValuePairs())e[t.key.attributes.value]=t.value;let t=[];if(this.isHash(e)){for(let r of Object.keys(e))t.push(", "),t.push(new i.default(r)),t.push(": "),t.push(e[r]);t[0]="{",t.push("}")}else{for(let r of Object.values(e))t.push(", "),t.push(r);t[0]="[",t.push("]")}return t}}t.default=o},2865:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(3e3))&&n.__esModule?n:{default:n},s=r(656);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class o extends i.default{constructor(e,t,r){super({left:t,right:r},{operator:e}),a(this,"compile",(e=>{let t=this.attributes.operator;"matches"!==t?void 0===o.functions[t]?(void 0!==o.operators[t]&&(t=o.operators[t]),e.raw("(").compile(this.nodes.left).raw(" ").raw(t).raw(" ").compile(this.nodes.right).raw(")")):e.raw(`${o.functions[t]}(`).compile(this.nodes.left).raw(", ").compile(this.nodes.right).raw(")"):e.compile(this.nodes.right).raw(".test(").compile(this.nodes.left).raw(")")})),a(this,"evaluate",((e,t)=>{let r=this.attributes.operator,n=this.nodes.left.evaluate(e,t);if(void 0!==o.functions[r]){let i=this.nodes.right.evaluate(e,t);switch(r){case"not in":return-1===i.indexOf(n);case"in":return i.indexOf(n)>=0;case"..":return(0,s.range)(n,i);case"**":return Math.pow(n,i)}}let i=null;switch(r){case"or":case"||":return n||(i=this.nodes.right.evaluate(e,t)),n||i;case"and":case"&&":return n&&(i=this.nodes.right.evaluate(e,t)),n&&i}switch(i=this.nodes.right.evaluate(e,t),r){case"|":return n|i;case"^":return n^i;case"&":return n&i;case"==":return n==i;case"===":return n===i;case"!=":return n!=i;case"!==":return n!==i;case"<":return n":return n>i;case">=":return n>=i;case"<=":return n<=i;case"not in":return-1===i.indexOf(n);case"in":return i.indexOf(n)>=0;case"+":return n+i;case"-":return n-i;case"~":return n.toString()+i.toString();case"*":return n*i;case"/":return n/i;case"%":return n%i;case"matches":let e=i.match(o.regex_expression);return new RegExp(e[1],e[2]).test(n)}})),this.name="BinaryNode"}toArray(){return["(",this.nodes.left," "+this.attributes.operator+" ",this.nodes.right,")"]}}t.default=o,a(o,"regex_expression",/\/(.+)\/(.*)/),a(o,"operators",{"~":".",and:"&&",or:"||"}),a(o,"functions",{"**":"Math.pow","..":"range",in:"includes","not in":"!includes"})},1290:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(3e3))&&n.__esModule?n:{default:n};function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class a extends i.default{constructor(e,t,r){super({expr1:e,expr2:t,expr3:r}),s(this,"compile",(e=>{e.raw("((").compile(this.nodes.expr1).raw(") ? (").compile(this.nodes.expr2).raw(") : (").compile(this.nodes.expr3).raw("))")})),s(this,"evaluate",((e,t)=>this.nodes.expr1.evaluate(e,t)?this.nodes.expr2.evaluate(e,t):this.nodes.expr3.evaluate(e,t))),this.name="ConditionalNode"}toArray(){return["(",this.nodes.expr1," ? ",this.nodes.expr2," : ",this.nodes.expr3,")"]}}t.default=a},4985:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(3e3))&&n.__esModule?n:{default:n};function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class a extends i.default{constructor(e,t=!1){super({},{value:e}),s(this,"compile",(e=>{e.repr(this.attributes.value,this.isIdentifier)})),s(this,"evaluate",((e,t)=>this.attributes.value)),s(this,"toArray",(()=>{let e=[],t=this.attributes.value;if(this.isIdentifier)e.push(t);else if(!0===t)e.push("true");else if(!1===t)e.push("false");else if(null===t)e.push("null");else if("number"==typeof t)e.push(t);else if("string"==typeof t)e.push(this.dumpString(t));else if(Array.isArray(t)){for(let r of t)e.push(","),e.push(new a(r));e[0]="[",e.push("]")}else if(this.isHash(t)){for(let r of Object.keys(t))e.push(", "),e.push(new a(r)),e.push(": "),e.push(new a(t[r]));e[0]="{",e.push("}")}return e})),this.isIdentifier=t,this.name="ConstantNode"}}t.default=a},1735:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(3e3))&&n.__esModule?n:{default:n};function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class a extends i.default{constructor(e,t){super({arguments:t},{name:e}),s(this,"compile",(e=>{let t=[];for(let r of Object.values(this.nodes.arguments.nodes))t.push(e.subcompile(r));let r=e.getFunction(this.attributes.name);e.raw(r.compiler.apply(null,t))})),s(this,"evaluate",((e,t)=>{let r=[t];for(let n of Object.values(this.nodes.arguments.nodes))r.push(n.evaluate(e,t));return e[this.attributes.name].evaluator.apply(null,r)})),this.name="FunctionNode"}toArray(){let e=[];e.push(this.attributes.name);for(let t of Object.values(this.nodes.arguments.nodes))e.push(", "),e.push(t);return e[1]="(",e.push(")"),e}}t.default=a},4602:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(3e3))&&n.__esModule?n:{default:n};function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class a extends i.default{constructor(e,t,r,n){super({node:e,attribute:t,arguments:r},{type:n}),s(this,"compile",(e=>{switch(this.attributes.type){case a.PROPERTY_CALL:e.compile(this.nodes.node).raw(".").raw(this.nodes.attribute.attributes.value);break;case a.METHOD_CALL:e.compile(this.nodes.node).raw(".").raw(this.nodes.attribute.attributes.value).raw("(").compile(this.nodes.arguments).raw(")");break;case a.ARRAY_CALL:e.compile(this.nodes.node).raw("[").compile(this.nodes.attribute).raw("]")}})),s(this,"evaluate",((e,t)=>{switch(this.attributes.type){case a.PROPERTY_CALL:let r=this.nodes.node.evaluate(e,t),n=this.nodes.attribute.attributes.value;if("object"!=typeof r)throw new Error(`Unable to get property "${n}" on a non-object: `+typeof r);return r[n];case a.METHOD_CALL:let i=this.nodes.node.evaluate(e,t),s=this.nodes.attribute.attributes.value;if("object"!=typeof i)throw new Error(`Unable to call method "${s}" on a non-object: `+typeof i);if(void 0===i[s])throw new Error(`Method "${s}" is undefined on object.`);if("function"!=typeof i[s])throw new Error(`Method "${s}" is not a function on object.`);let o=this.nodes.arguments.evaluate(e,t);return i[s].apply(null,o);case a.ARRAY_CALL:let u=this.nodes.node.evaluate(e,t);if(!Array.isArray(u)&&"object"!=typeof u)throw new Error("Unable to get an item on a non-array: "+typeof u);return u[this.nodes.attribute.evaluate(e,t)]}})),this.name="GetAttrNode"}toArray(){switch(this.attributes.type){case a.PROPERTY_CALL:return[this.nodes.node,".",this.nodes.attribute];case a.METHOD_CALL:return[this.nodes.node,".",this.nodes.attribute,"(",this.nodes.arguments,")"];case a.ARRAY_CALL:return[this.nodes.node,"[",this.nodes.attribute,"]"]}}}t.default=a,s(a,"PROPERTY_CALL",1),s(a,"METHOD_CALL",2),s(a,"ARRAY_CALL",3)},1653:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(3e3))&&n.__esModule?n:{default:n};function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class a extends i.default{constructor(e){super({},{name:e}),s(this,"compile",(e=>{e.raw(this.attributes.name)})),s(this,"evaluate",((e,t)=>t[this.attributes.name])),this.name="NameNode"}toArray(){return[this.attributes.name]}}t.default=a},3e3:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(9752),i=r(7164);function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}t.default=class{constructor(e={},t={}){s(this,"compile",(e=>{for(let t of Object.values(this.nodes))t.compile(e)})),s(this,"evaluate",((e,t)=>{let r=[];for(let n of Object.values(this.nodes))r.push(n.evaluate(e,t));return r})),s(this,"dump",(()=>{let e="";for(let t of this.toArray())e+=(0,n.is_scalar)(t)?t:t.dump();return e})),s(this,"dumpString",(e=>`"${(0,i.addcslashes)(e,'\0\t"\\')}"`)),s(this,"isHash",(e=>{let t=0;for(let r of Object.keys(e))if(r=parseInt(r),r!==t++)return!0;return!1})),this.name="Node",this.nodes=e,this.attributes=t}toString(){let e=[];for(let t of Object.keys(this.attributes)){let r="null";this.attributes[t]&&(r=this.attributes[t].toString()),e.push(`${t}: '${r}'`)}let t=[this.name+"("+e.join(", ")];if(this.nodes.length>0){for(let e of Object.values(this.nodes)){let r=e.toString().split("\n");for(let e of r)t.push(" "+e)}t.push(")")}else t[0]+=")";return t.join("\n")}toArray(){throw new Error(`Dumping a "${this.name}" instance is not supported yet.`)}}},4501:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(3e3))&&n.__esModule?n:{default:n};function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class a extends i.default{constructor(e,t){super({node:t},{operator:e}),s(this,"compile",(e=>{e.raw("(").raw(a.operators[this.attributes.operator]).compile(this.nodes.node).raw(")")})),s(this,"evaluate",((e,t)=>{let r=this.nodes.node.evaluate(e,t);switch(this.attributes.operator){case"not":case"!":return!r;case"-":return-r}return r})),this.name="UnaryNode"}toArray(){return["(",this.attributes.operator+" ",this.nodes.node,")"]}}t.default=a,s(a,"operators",{"!":"!",not:"!","+":"+","-":"-"})},3763:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(3733))&&n.__esModule?n:{default:n};class s extends i.default{constructor(e,t){super(e),function(e,t,r){t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(this,"getNodes",(()=>this.nodes)),this.nodes=t}}t.default=s},2066:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.OPERATOR_RIGHT=t.OPERATOR_LEFT=void 0;var n=m(r(6053)),i=r(9632),s=m(r(3e3)),a=m(r(2865)),o=m(r(4501)),u=m(r(4985)),l=m(r(1290)),c=m(r(1735)),h=m(r(1653)),f=m(r(8278)),d=m(r(4950)),p=m(r(4602));function m(e){return e&&e.__esModule?e:{default:e}}function y(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}t.OPERATOR_LEFT=1,t.OPERATOR_RIGHT=2,t.default=class{constructor(e={}){y(this,"functions",{}),y(this,"unaryOperators",{not:{precedence:50},"!":{precedence:50},"-":{precedence:500},"+":{precedence:500}}),y(this,"binaryOperators",{or:{precedence:10,associativity:1},"||":{precedence:10,associativity:1},and:{precedence:15,associativity:1},"&&":{precedence:15,associativity:1},"|":{precedence:16,associativity:1},"^":{precedence:17,associativity:1},"&":{precedence:18,associativity:1},"==":{precedence:20,associativity:1},"===":{precedence:20,associativity:1},"!=":{precedence:20,associativity:1},"!==":{precedence:20,associativity:1},"<":{precedence:20,associativity:1},">":{precedence:20,associativity:1},">=":{precedence:20,associativity:1},"<=":{precedence:20,associativity:1},"not in":{precedence:20,associativity:1},in:{precedence:20,associativity:1},matches:{precedence:20,associativity:1},"..":{precedence:25,associativity:1},"+":{precedence:30,associativity:1},"-":{precedence:30,associativity:1},"~":{precedence:40,associativity:1},"*":{precedence:60,associativity:1},"/":{precedence:60,associativity:1},"%":{precedence:60,associativity:1},"**":{precedence:200,associativity:2}}),y(this,"parse",((e,t=[])=>{this.tokenStream=e,this.names=t,this.objectMatches={},this.cachedNames=null,this.nestedExecutions=0;let r=this.parseExpression();if(!this.tokenStream.isEOF())throw new n.default(`Unexpected token "${this.tokenStream.current.type}" of value "${this.tokenStream.current.value}".`,this.tokenStream.current.cursor,this.tokenStream.expression);return r})),y(this,"parseExpression",((e=0)=>{let t=this.getPrimary(),r=this.tokenStream.current;if(this.nestedExecutions++,this.nestedExecutions>100)throw new Error("Way to many executions on '"+r.toString()+"' of '"+this.tokenStream.toString()+"'");for(;r.test(i.Token.OPERATOR_TYPE)&&void 0!==this.binaryOperators[r.value]&&null!==this.binaryOperators[r.value]&&this.binaryOperators[r.value].precedence>=e;){let e=this.binaryOperators[r.value];this.tokenStream.next();let n=this.parseExpression(1===e.associativity?e.precedence+1:e.precedence);t=new a.default(r.value,t,n),r=this.tokenStream.current}return 0===e?this.parseConditionalExpression(t):t})),y(this,"getPrimary",(()=>{let e=this.tokenStream.current;if(e.test(i.Token.OPERATOR_TYPE)&&void 0!==this.unaryOperators[e.value]&&null!==this.unaryOperators[e.value]){let t=this.unaryOperators[e.value];this.tokenStream.next();let r=this.parseExpression(t.precedence);return this.parsePostfixExpression(new o.default(e.value,r))}if(e.test(i.Token.PUNCTUATION_TYPE,"(")){this.tokenStream.next();let e=this.parseExpression();return this.tokenStream.expect(i.Token.PUNCTUATION_TYPE,")","An opened parenthesis is not properly closed"),this.parsePostfixExpression(e)}return this.parsePrimaryExpression()})),y(this,"hasVariable",(e=>this.getNames().indexOf(e)>=0)),y(this,"getNames",(()=>{if(null!==this.cachedNames)return this.cachedNames;if(this.names&&this.names.length>0){let e=[],t=0;this.objectMatches={};for(let r of this.names)"object"==typeof r?(this.objectMatches[Object.values(r)[0]]=t,e.push(Object.keys(r)[0]),e.push(Object.values(r)[0])):e.push(r),t++;return this.cachedNames=e,e}return[]})),y(this,"parseArrayExpression",(()=>{this.tokenStream.expect(i.Token.PUNCTUATION_TYPE,"[","An array element was expected");let e=new f.default,t=!0;for(;!this.tokenStream.current.test(i.Token.PUNCTUATION_TYPE,"]")&&(t||(this.tokenStream.expect(i.Token.PUNCTUATION_TYPE,",","An array element must be followed by a comma"),!this.tokenStream.current.test(i.Token.PUNCTUATION_TYPE,"]")));)t=!1,e.addElement(this.parseExpression());return this.tokenStream.expect(i.Token.PUNCTUATION_TYPE,"]","An opened array is not properly closed"),e})),y(this,"parseHashExpression",(()=>{this.tokenStream.expect(i.Token.PUNCTUATION_TYPE,"{","A hash element was expected");let e=new f.default,t=!0;for(;!this.tokenStream.current.test(i.Token.PUNCTUATION_TYPE,"}")&&(t||(this.tokenStream.expect(i.Token.PUNCTUATION_TYPE,",","An array element must be followed by a comma"),!this.tokenStream.current.test(i.Token.PUNCTUATION_TYPE,"}")));){t=!1;let r=null;if(this.tokenStream.current.test(i.Token.STRING_TYPE)||this.tokenStream.current.test(i.Token.NAME_TYPE)||this.tokenStream.current.test(i.Token.NUMBER_TYPE))r=new u.default(this.tokenStream.current.value),this.tokenStream.next();else{if(!this.tokenStream.current.test(i.Token.PUNCTUATION_TYPE,"(")){let e=this.tokenStream.current;throw new n.default(`A hash key must be a quoted string, a number, a name, or an expression enclosed in parentheses (unexpected token "${e.type}" of value "${e.value}"`,e.cursor,this.tokenStream.expression)}r=this.parseExpression()}this.tokenStream.expect(i.Token.PUNCTUATION_TYPE,":","A hash key must be followed by a colon (:)");let s=this.parseExpression();e.addElement(s,r)}return this.tokenStream.expect(i.Token.PUNCTUATION_TYPE,"}","An opened hash is not properly closed"),e})),y(this,"parsePostfixExpression",(e=>{let t=this.tokenStream.current;for(;i.Token.PUNCTUATION_TYPE===t.type;){if("."===t.value){if(this.tokenStream.next(),t=this.tokenStream.current,this.tokenStream.next(),i.Token.NAME_TYPE!==t.type&&(i.Token.OPERATOR_TYPE!==t.type||!/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/.test(t.value)))throw new n.default("Expected name",t.cursor,this.tokenStream.expression);let r=new u.default(t.value,!0),s=new d.default,a=null;if(this.tokenStream.current.test(i.Token.PUNCTUATION_TYPE,"(")){a=p.default.METHOD_CALL;for(let e of Object.values(this.parseArguments().nodes))s.addElement(e)}else a=p.default.PROPERTY_CALL;e=new p.default(e,r,s,a)}else{if("["!==t.value)break;{this.tokenStream.next();let t=this.parseExpression();this.tokenStream.expect(i.Token.PUNCTUATION_TYPE,"]"),e=new p.default(e,t,new d.default,p.default.ARRAY_CALL)}}t=this.tokenStream.current}return e})),y(this,"parseArguments",(()=>{let e=[];for(this.tokenStream.expect(i.Token.PUNCTUATION_TYPE,"(","A list of arguments must begin with an opening parenthesis");!this.tokenStream.current.test(i.Token.PUNCTUATION_TYPE,")");)0!==e.length&&this.tokenStream.expect(i.Token.PUNCTUATION_TYPE,",","Arguments must be separated by a comma"),e.push(this.parseExpression());return this.tokenStream.expect(i.Token.PUNCTUATION_TYPE,")","A list of arguments must be closed by a parenthesis"),new s.default(e)})),this.functions=e,this.tokenStream=null,this.names=null,this.objectMatches={},this.cachedNames=null,this.nestedExecutions=0}parseConditionalExpression(e){for(;this.tokenStream.current.test(i.Token.PUNCTUATION_TYPE,"?");){let t,r;this.tokenStream.next(),this.tokenStream.current.test(i.Token.PUNCTUATION_TYPE,":")?(this.tokenStream.next(),t=e,r=this.parseExpression()):(t=this.parseExpression(),this.tokenStream.current.test(i.Token.PUNCTUATION_TYPE,":")?(this.tokenStream.next(),r=this.parseExpression()):r=new u.default(null)),e=new l.default(e,t,r)}return e}parsePrimaryExpression(){let e=this.tokenStream.current,t=null;switch(e.type){case i.Token.NAME_TYPE:switch(this.tokenStream.next(),e.value){case"true":case"TRUE":return new u.default(!0);case"false":case"FALSE":return new u.default(!1);case"null":case"NULL":return new u.default(null);default:if("("===this.tokenStream.current.value){if(void 0===this.functions[e.value])throw new n.default(`The function "${e.value}" does not exist`,e.cursor,this.tokenStream.expression,e.values,Object.keys(this.functions));t=new c.default(e.value,this.parseArguments())}else{if(!this.hasVariable(e.value))throw new n.default(`Variable "${e.value}" is not valid`,e.cursor,this.tokenStream.expression,e.value,this.getNames());let r=e.value;void 0!==this.objectMatches[r]&&(r=this.getNames()[this.objectMatches[r]]),t=new h.default(r)}}break;case i.Token.NUMBER_TYPE:case i.Token.STRING_TYPE:return this.tokenStream.next(),new u.default(e.value);default:if(e.test(i.Token.PUNCTUATION_TYPE,"["))t=this.parseArrayExpression();else{if(!e.test(i.Token.PUNCTUATION_TYPE,"{"))throw new n.default(`Unexpected token "${e.type}" of value "${e.value}"`,e.cursor,this.tokenStream.expression);t=this.parseHashExpression()}}return this.parsePostfixExpression(t)}}},2242:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=class{getFunctions(){throw new Error("getFunctions must be implemented by "+this.name)}}},7478:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.arrayIntersectFn=t.countFn=t.implodeFn=t.default=void 0;var n=u(r(8104)),i=u(r(2242)),s=u(r(1315)),a=u(r(4652)),o=u(r(451));function u(e){return e&&e.__esModule?e:{default:e}}class l extends i.default{getFunctions(){return[c,h,f]}}t.default=l;const c=new n.default("implode",(function(e,t){return`implode(${e}, ${t})`}),(function(e,t,r){return(0,o.default)(t,r)}));t.implodeFn=c;const h=new n.default("count",(function(e,t){let r="";return t&&(r=`, ${t}`),`count(${e}${r})`}),(function(e,t,r){return(0,a.default)(t,r)}));t.countFn=h;const f=new n.default("array_intersect",(function(e,...t){let r="";return t.length>0&&(r=", "+t.join(", ")),`array_intersect(${e}${r})`}),(function(e){let t=[],r=!0;for(let e=1;e0){if(void 0!==e[r]){let t=e[r];for(let e of n){if("array"===e.type){if(void 0===t[e.index])return!1;t=t[e.index]}if("object"===e.type){if(void 0===t[e.attribute])return!1;t=t[e.attribute]}}return!0}return!1}return void 0!==e[r]}));t.issetFn=o},8401:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=o(r(2242)),i=o(r(8104)),s=o(r(8886)),a=o(r(5455));function o(e){return e&&e.__esModule?e:{default:e}}class u extends n.default{getFunctions(){return[new i.default("date",(function(e,t){let r="";return t&&(r=`, ${t}`),`date(${e}${r})`}),(function(e,t,r){return(0,s.default)(t,r)})),new i.default("strtotime",(function(e,t){let r="";return t&&(r=`, ${t}`),`strtotime(${e}${r})`}),(function(e,t,r){return(0,a.default)(t,r)}))]}}t.default=u},2213:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=f(r(8104)),i=f(r(2242)),s=f(r(7760)),a=f(r(3061)),o=f(r(9565)),u=f(r(7483)),l=f(r(9202)),c=f(r(8293)),h=f(r(3369));function f(e){return e&&e.__esModule?e:{default:e}}class d extends i.default{getFunctions(){return[new n.default("strtolower",(e=>"strtolower("+e+")"),((e,t)=>(0,o.default)(t))),new n.default("strtoupper",(e=>"strtoupper("+e+")"),((e,t)=>(0,u.default)(t))),new n.default("explode",((e,t,r="null")=>`explode(${e}, ${t}, ${r})`),((e,t,r,n=null)=>(0,s.default)(t,r,n))),new n.default("strlen",(function(e){return`strlen(${e});`}),(function(e,t){return(0,a.default)(t)})),new n.default("strstr",(function(e,t,r){let n="";return r&&(n=`, ${r}`),`strstr(${e}, ${t}${n});`}),(function(e,t,r,n){return(0,c.default)(t,r,n)})),new n.default("stristr",(function(e,t,r){let n="";return r&&(n=`, ${r}`),`stristr(${e}, ${t}${n});`}),(function(e,t,r,n){return(0,h.default)(t,r,n)})),new n.default("substr",(function(e,t,r){let n="";return r&&(n=`, ${r}`),`substr(${e}, ${t}${n});`}),(function(e,t,r,n){return(0,l.default)(t,r,n)}))]}}t.default=d},6053:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(8219);class i extends Error{constructor(e,t,r,n,i){super(e),this.name="SyntaxError",this.cursor=t,this.expression=r,this.subject=n,this.proposals=i}toString(){let e=`${this.name}: ${this.message} around position ${this.cursor}`;if(this.expression&&(e+=` for expression \`${this.expression}\``),e+=".",this.subject&&this.proposals){let t=Number.MAX_SAFE_INTEGER,r=null;for(let e of this.proposals){let i=(0,n.getEditDistance)(this.subject,e);i{if(this.position+=1,void 0===this.tokens[this.position])throw new i.default("Unexpected end of expression",this.last.cursor,this.expression)})),s(this,"expect",((e,t,r)=>{let n=this.current;if(!n.test(e,t)){let s="";r&&(s=r+". ");let a="";throw t&&(a=` with value "${t}"`),s+=`Unexpected token "${n.type}" of value "${n.value}" ("${e}" expected${a})`,new i.default(s,n.cursor,this.expression)}this.next()})),s(this,"isEOF",(()=>o.EOF_TYPE===this.current.type)),s(this,"isEqualTo",(e=>{if(null==e||!e instanceof a)return!1;if(e.tokens.length!==this.tokens.length)return!1;let t=e.position;e.position=0;let r=!0;for(let t of this.tokens){if(!e.current.isEqualTo(t)){r=!1;break}e.position{let t=[];if(!this.isEqualTo(e)){let r=0,n=e.position;e.position=0;for(let n of this.tokens){let i=n.diff(e.current);i.length>0&&t.push({index:r,diff:i}),e.positionthis.type===e&&(null===t||this.value===t))),s(this,"isEqualTo",(e=>!(null==e||!e instanceof o)&&e.value==this.value&&e.type===this.type&&e.cursor===this.cursor)),s(this,"diff",(e=>{let t=[];return this.isEqualTo(e)||(e.value!==this.value&&t.push(`Value: ${e.value} != ${this.value}`),e.cursor!==this.cursor&&t.push(`Cursor: ${e.cursor} != ${this.cursor}`),e.type!==this.type&&t.push(`Type: ${e.type} != ${this.type}`)),t})),this.value=t,this.type=e,this.cursor=r}toString(){return`${this.cursor} [${this.type}] ${this.value}`}}t.Token=o,s(o,"EOF_TYPE","end of expression"),s(o,"NAME_TYPE","name"),s(o,"NUMBER_TYPE","number"),s(o,"STRING_TYPE","string"),s(o,"OPERATOR_TYPE","operator"),s(o,"PUNCTUATION_TYPE","punctuation")},5825:function(e,t,r){t.ZP=void 0;var n=i(r(339));r(3861),i(r(2066)),i(r(8104)),i(r(1095)),i(r(1968)),i(r(1615)),i(r(2213)),i(r(7478)),i(r(8401));function i(e){return e&&e.__esModule?e:{default:e}}var s=n.default;t.ZP=s},8219:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getEditDistance=void 0,t.getEditDistance=function(e,t){if(0===e.length)return t.length;if(0===t.length)return e.length;let r,n,i=[];for(r=0;r<=t.length;r++)i[r]=[r];for(n=0;n<=e.length;n++)void 0===i[0]&&(i[0]=[]),i[0][n]=n;for(r=1;r<=t.length;r++)for(n=1;n<=e.length;n++)t.charAt(r-1)===e.charAt(n-1)?i[r][n]=i[r-1][n-1]:i[r][n]=Math.min(i[r-1][n-1]+1,Math.min(i[r][n-1]+1,i[r-1][n]+1));return void 0===i[t.length]&&(i[t.length]=[]),i[t.length][e.length]}},7164:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.addcslashes=function(e,t){var r="",n=[],i=0,s=0,a="",o="",u="",l="",c="",h=0,f=0,d=0,p=0,m=0,y=[],g="",b=/%([\dA-Fa-f]+)/g,v=function(e,t){return(e+="").lengthh)for(s=h;s<=f;s++)n.push(String.fromCharCode(s));else n.push(".",u,l);i+=l.length+2}else c=String.fromCharCode(parseInt(u,8)),n.push(c);i+=d}else if(o+t.charAt(i+2)===".."){if(h=(u=a).charCodeAt(0),/\\\d/.test(t.charAt(i+3)+t.charAt(i+4)))l=t.slice(i+4).match(/^\d+/)[0],i+=1;else{if(!t.charAt(i+3))throw new Error("Range with no end point");l=t.charAt(i+3)}if((f=l.charCodeAt(0))>h)for(s=h;s<=f;s++)n.push(String.fromCharCode(s));else n.push(".",u,l);i+=l.length+2}else n.push(a);for(i=0;i126)switch(a){case"\n":r+="n";break;case"\t":r+="t";break;case"\r":r+="r";break;case"":r+="a";break;case"\v":r+="v";break;case"\b":r+="b";break;case"\f":r+="f";break;default:for(g=encodeURIComponent(a),null!==(y=b.exec(g))&&(r+=v(parseInt(y[1],16).toString(8),3));null!==(y=b.exec(g));)r+="\\"+v(parseInt(y[1],16).toString(8),3)}else r+=a;else r+=a;return r}},9752:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.is_scalar=function(e){return/boolean|number|string/.test(typeof e)}},656:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.range=function(e,t){let r=[];for(let n=e;n<=t;n++)r.push(n);return r}},5152:function(e){var t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};e.exports=function(e){switch(void 0===e?"undefined":t(e)){case"boolean":return e?"1":"";case"string":return e;case"number":return isNaN(e)?"NAN":isFinite(e)?e+"":(e<0?"-":"")+"INF";case"undefined":return"";case"object":return Array.isArray(e)?"Array":null!==e?"Object":"";default:throw new Error("Unsupported value type")}}},1315:function(e){e.exports=function(e){var t={},r=arguments.length,n=r-1,i="",s={},a=0,o="";e:for(i in e)t:for(a=1;a9?-1:0)},Y:function(){return r.getFullYear()},y:function(){return n.Y().toString().slice(-2)},a:function(){return r.getHours()>11?"pm":"am"},A:function(){return n.a().toUpperCase()},B:function(){var e=3600*r.getUTCHours(),t=60*r.getUTCMinutes(),n=r.getUTCSeconds();return o(Math.floor((e+t+n+3600)/86.4)%1e3,3)},g:function(){return n.G()%12||12},G:function(){return r.getHours()},h:function(){return o(n.g(),2)},H:function(){return o(n.G(),2)},i:function(){return o(r.getMinutes(),2)},s:function(){return o(r.getSeconds(),2)},u:function(){return o(1e3*r.getMilliseconds(),6)},e:function(){throw new Error("Not supported (see source code of date() for timezone on how to add support)")},I:function(){return new Date(n.Y(),0)-Date.UTC(n.Y(),0)!=new Date(n.Y(),6)-Date.UTC(n.Y(),6)?1:0},O:function(){var e=r.getTimezoneOffset(),t=Math.abs(e);return(e>0?"-":"+")+o(100*Math.floor(t/60)+t%60,4)},P:function(){var e=n.O();return e.substr(0,3)+":"+e.substr(3,2)},T:function(){return"UTC"},Z:function(){return 60*-r.getTimezoneOffset()},c:function(){return"Y-m-d\\TH:i:sP".replace(s,a)},r:function(){return"D, d M Y H:i:s O".replace(s,a)},U:function(){return r/1e3|0}},function(e,t){return r=void 0===t?new Date:t instanceof Date?new Date(t):new Date(1e3*t),e.replace(s,a)}(e,t)}},5455:function(e){var t="[ \\t]+",r="[ \\t]*",n="(?:([ap])\\.?m\\.?([\\t ]|$))",i="(2[0-4]|[01]?[0-9])",s="([01][0-9]|2[0-4])",a="(0?[1-9]|1[0-2])",o="([0-5]?[0-9])",u="([0-5][0-9])",l="(60|[0-5]?[0-9])",c="(60|[0-5][0-9])",h="(?:\\.([0-9]+))",f="sunday|monday|tuesday|wednesday|thursday|friday|saturday",d="sun|mon|tue|wed|thu|fri|sat",p=f+"|"+d+"|weekdays?",m="first|second|third|fourth|fifth|sixth|seventh|eighth?|ninth|tenth|eleventh|twelfth",y="next|last|previous|this",g="(?:second|sec|minute|min|hour|day|fortnight|forthnight|month|year)s?|weeks|"+p,b="([0-9]{1,4})",v="([0-9]{4})",w="(1[0-2]|0?[0-9])",x="(0[0-9]|1[0-2])",k="(?:(3[01]|[0-2]?[0-9])(?:st|nd|rd|th)?)",T="(0[0-9]|[1-2][0-9]|3[01])",E="january|february|march|april|may|june|july|august|september|october|november|december",O="jan|feb|mar|apr|may|jun|jul|aug|sept?|oct|nov|dec",_="("+E+"|"+O+"|i[vx]|vi{0,3}|xi{0,2}|i{1,3})",A="((?:GMT)?([+-])"+i+":?"+o+"?)",N=_+"[ .\\t-]*"+k+"[,.stndrh\\t ]*";function P(e,t){switch(t=t&&t.toLowerCase()){case"a":e+=12===e?-12:0;break;case"p":e+=12!==e?12:0}return e}function S(e){var t=+e;return e.length<4&&t<100&&(t+=t<70?2e3:1900),t}function j(e){return{jan:0,january:0,i:0,feb:1,february:1,ii:1,mar:2,march:2,iii:2,apr:3,april:3,iv:3,may:4,v:4,jun:5,june:5,vi:5,jul:6,july:6,vii:6,aug:7,august:7,viii:7,sep:8,sept:8,september:8,ix:8,oct:9,october:9,x:9,nov:10,november:10,xi:10,dec:11,december:11,xii:11}[e.toLowerCase()]}function R(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{mon:1,monday:1,tue:2,tuesday:2,wed:3,wednesday:3,thu:4,thursday:4,fri:5,friday:5,sat:6,saturday:6,sun:0,sunday:0}[e.toLowerCase()]||t}function C(e,t){if(!(e=e&&e.match(/(?:GMT)?([+-])(\d+)(:?)(\d{0,2})/i)))return t;var r="-"===e[1]?-1:1,n=+e[2],i=+e[4];return e[4]||e[3]||(i=Math.floor(n%100),n=Math.floor(n/100)),r*(60*n+i)*60}var M={acdt:37800,acst:34200,addt:-7200,adt:-10800,aedt:39600,aest:36e3,ahdt:-32400,ahst:-36e3,akdt:-28800,akst:-32400,amt:-13840,apt:-10800,ast:-14400,awdt:32400,awst:28800,awt:-10800,bdst:7200,bdt:-36e3,bmt:-14309,bst:3600,cast:34200,cat:7200,cddt:-14400,cdt:-18e3,cemt:10800,cest:7200,cet:3600,cmt:-15408,cpt:-18e3,cst:-21600,cwt:-18e3,chst:36e3,dmt:-1521,eat:10800,eddt:-10800,edt:-14400,eest:10800,eet:7200,emt:-26248,ept:-14400,est:-18e3,ewt:-14400,ffmt:-14660,fmt:-4056,gdt:39600,gmt:0,gst:36e3,hdt:-34200,hkst:32400,hkt:28800,hmt:-19776,hpt:-34200,hst:-36e3,hwt:-34200,iddt:14400,idt:10800,imt:25025,ist:7200,jdt:36e3,jmt:8440,jst:32400,kdt:36e3,kmt:5736,kst:30600,lst:9394,mddt:-18e3,mdst:16279,mdt:-21600,mest:7200,met:3600,mmt:9017,mpt:-21600,msd:14400,msk:10800,mst:-25200,mwt:-21600,nddt:-5400,ndt:-9052,npt:-9e3,nst:-12600,nwt:-9e3,nzdt:46800,nzmt:41400,nzst:43200,pddt:-21600,pdt:-25200,pkst:21600,pkt:18e3,plmt:25590,pmt:-13236,ppmt:-17340,ppt:-25200,pst:-28800,pwt:-25200,qmt:-18840,rmt:5794,sast:7200,sdmt:-16800,sjmt:-20173,smt:-13884,sst:-39600,tbmt:10751,tmt:12344,uct:0,utc:0,wast:7200,wat:3600,wemt:7200,west:3600,wet:0,wib:25200,wita:28800,wit:32400,wmt:5040,yddt:-25200,ydt:-28800,ypt:-28800,yst:-32400,ywt:-28800,a:3600,b:7200,c:10800,d:14400,e:18e3,f:21600,g:25200,h:28800,i:32400,k:36e3,l:39600,m:43200,n:-3600,o:-7200,p:-10800,q:-14400,r:-18e3,s:-21600,t:-25200,u:-28800,v:-32400,w:-36e3,x:-39600,y:-43200,z:0},U={yesterday:{regex:/^yesterday/i,name:"yesterday",callback:function(){return this.rd-=1,this.resetTime()}},now:{regex:/^now/i,name:"now"},noon:{regex:/^noon/i,name:"noon",callback:function(){return this.resetTime()&&this.time(12,0,0,0)}},midnightOrToday:{regex:/^(midnight|today)/i,name:"midnight | today",callback:function(){return this.resetTime()}},tomorrow:{regex:/^tomorrow/i,name:"tomorrow",callback:function(){return this.rd+=1,this.resetTime()}},timestamp:{regex:/^@(-?\d+)/i,name:"timestamp",callback:function(e,t){return this.rs+=+t,this.y=1970,this.m=0,this.d=1,this.dates=0,this.resetTime()&&this.zone(0)}},firstOrLastDay:{regex:/^(first|last) day of/i,name:"firstdayof | lastdayof",callback:function(e,t){"first"===t.toLowerCase()?this.firstOrLastDayOfMonth=1:this.firstOrLastDayOfMonth=-1}},backOrFrontOf:{regex:RegExp("^(back|front) of "+i+r+n+"?","i"),name:"backof | frontof",callback:function(e,t,r,n){var i=+r,s=15;return"back"===t.toLowerCase()||(i-=1,s=45),i=P(i,n),this.resetTime()&&this.time(i,s,0,0)}},weekdayOf:{regex:RegExp("^("+m+"|"+y+")"+t+"("+f+"|"+d+")"+t+"of","i"),name:"weekdayof"},mssqltime:{regex:RegExp("^"+a+":"+u+":"+c+"[:.]([0-9]+)"+n,"i"),name:"mssqltime",callback:function(e,t,r,n,i,s){return this.time(P(+t,s),+r,+n,+i.substr(0,3))}},timeLong12:{regex:RegExp("^"+a+"[:.]"+o+"[:.]"+c+r+n,"i"),name:"timelong12",callback:function(e,t,r,n,i){return this.time(P(+t,i),+r,+n,0)}},timeShort12:{regex:RegExp("^"+a+"[:.]"+u+r+n,"i"),name:"timeshort12",callback:function(e,t,r,n){return this.time(P(+t,n),+r,0,0)}},timeTiny12:{regex:RegExp("^"+a+r+n,"i"),name:"timetiny12",callback:function(e,t,r){return this.time(P(+t,r),0,0,0)}},soap:{regex:RegExp("^"+v+"-"+x+"-"+T+"T"+s+":"+u+":"+c+h+A+"?","i"),name:"soap",callback:function(e,t,r,n,i,s,a,o,u){return this.ymd(+t,r-1,+n)&&this.time(+i,+s,+a,+o.substr(0,3))&&this.zone(C(u))}},wddx:{regex:RegExp("^"+v+"-"+w+"-"+k+"T"+i+":"+o+":"+l),name:"wddx",callback:function(e,t,r,n,i,s,a){return this.ymd(+t,r-1,+n)&&this.time(+i,+s,+a,0)}},exif:{regex:RegExp("^"+v+":"+x+":"+T+" "+s+":"+u+":"+c,"i"),name:"exif",callback:function(e,t,r,n,i,s,a){return this.ymd(+t,r-1,+n)&&this.time(+i,+s,+a,0)}},xmlRpc:{regex:RegExp("^"+v+x+T+"T"+i+":"+u+":"+c),name:"xmlrpc",callback:function(e,t,r,n,i,s,a){return this.ymd(+t,r-1,+n)&&this.time(+i,+s,+a,0)}},xmlRpcNoColon:{regex:RegExp("^"+v+x+T+"[Tt]"+i+u+c),name:"xmlrpcnocolon",callback:function(e,t,r,n,i,s,a){return this.ymd(+t,r-1,+n)&&this.time(+i,+s,+a,0)}},clf:{regex:RegExp("^"+k+"/("+O+")/"+v+":"+s+":"+u+":"+c+t+A,"i"),name:"clf",callback:function(e,t,r,n,i,s,a,o){return this.ymd(+n,j(r),+t)&&this.time(+i,+s,+a,0)&&this.zone(C(o))}},iso8601long:{regex:RegExp("^t?"+i+"[:.]"+o+"[:.]"+l+h,"i"),name:"iso8601long",callback:function(e,t,r,n,i){return this.time(+t,+r,+n,+i.substr(0,3))}},dateTextual:{regex:RegExp("^"+_+"[ .\\t-]*"+k+"[,.stndrh\\t ]+"+b,"i"),name:"datetextual",callback:function(e,t,r,n){return this.ymd(S(n),j(t),+r)}},pointedDate4:{regex:RegExp("^"+k+"[.\\t-]"+w+"[.-]"+v),name:"pointeddate4",callback:function(e,t,r,n){return this.ymd(+n,r-1,+t)}},pointedDate2:{regex:RegExp("^"+k+"[.\\t]"+w+"\\.([0-9]{2})"),name:"pointeddate2",callback:function(e,t,r,n){return this.ymd(S(n),r-1,+t)}},timeLong24:{regex:RegExp("^t?"+i+"[:.]"+o+"[:.]"+l),name:"timelong24",callback:function(e,t,r,n){return this.time(+t,+r,+n,0)}},dateNoColon:{regex:RegExp("^"+v+x+T),name:"datenocolon",callback:function(e,t,r,n){return this.ymd(+t,r-1,+n)}},pgydotd:{regex:RegExp("^"+v+"\\.?(00[1-9]|0[1-9][0-9]|[12][0-9][0-9]|3[0-5][0-9]|36[0-6])"),name:"pgydotd",callback:function(e,t,r){return this.ymd(+t,0,+r)}},timeShort24:{regex:RegExp("^t?"+i+"[:.]"+o,"i"),name:"timeshort24",callback:function(e,t,r){return this.time(+t,+r,0,0)}},iso8601noColon:{regex:RegExp("^t?"+s+u+c,"i"),name:"iso8601nocolon",callback:function(e,t,r,n){return this.time(+t,+r,+n,0)}},iso8601dateSlash:{regex:RegExp("^"+v+"/"+x+"/"+T+"/"),name:"iso8601dateslash",callback:function(e,t,r,n){return this.ymd(+t,r-1,+n)}},dateSlash:{regex:RegExp("^"+v+"/"+w+"/"+k),name:"dateslash",callback:function(e,t,r,n){return this.ymd(+t,r-1,+n)}},american:{regex:RegExp("^"+w+"/"+k+"/"+b),name:"american",callback:function(e,t,r,n){return this.ymd(S(n),t-1,+r)}},americanShort:{regex:RegExp("^"+w+"/"+k),name:"americanshort",callback:function(e,t,r){return this.ymd(this.y,t-1,+r)}},gnuDateShortOrIso8601date2:{regex:RegExp("^"+b+"-"+w+"-"+k),name:"gnudateshort | iso8601date2",callback:function(e,t,r,n){return this.ymd(S(t),r-1,+n)}},iso8601date4:{regex:RegExp("^([+-]?[0-9]{4})-"+x+"-"+T),name:"iso8601date4",callback:function(e,t,r,n){return this.ymd(+t,r-1,+n)}},gnuNoColon:{regex:RegExp("^t?"+s+u,"i"),name:"gnunocolon",callback:function(e,t,r){switch(this.times){case 0:return this.time(+t,+r,0,this.f);case 1:return this.y=100*t+ +r,this.times++,!0;default:return!1}}},gnuDateShorter:{regex:RegExp("^"+v+"-"+w),name:"gnudateshorter",callback:function(e,t,r){return this.ymd(+t,r-1,1)}},pgTextReverse:{regex:RegExp("^(\\d{3,4}|[4-9]\\d|3[2-9])-("+O+")-"+T,"i"),name:"pgtextreverse",callback:function(e,t,r,n){return this.ymd(S(t),j(r),+n)}},dateFull:{regex:RegExp("^"+k+"[ \\t.-]*"+_+"[ \\t.-]*"+b,"i"),name:"datefull",callback:function(e,t,r,n){return this.ymd(S(n),j(r),+t)}},dateNoDay:{regex:RegExp("^"+_+"[ .\\t-]*"+v,"i"),name:"datenoday",callback:function(e,t,r){return this.ymd(+r,j(t),1)}},dateNoDayRev:{regex:RegExp("^"+v+"[ .\\t-]*"+_,"i"),name:"datenodayrev",callback:function(e,t,r){return this.ymd(+t,j(r),1)}},pgTextShort:{regex:RegExp("^("+O+")-"+T+"-"+b,"i"),name:"pgtextshort",callback:function(e,t,r,n){return this.ymd(S(n),j(t),+r)}},dateNoYear:{regex:RegExp("^"+N,"i"),name:"datenoyear",callback:function(e,t,r){return this.ymd(this.y,j(t),+r)}},dateNoYearRev:{regex:RegExp("^"+k+"[ .\\t-]*"+_,"i"),name:"datenoyearrev",callback:function(e,t,r){return this.ymd(this.y,j(r),+t)}},isoWeekDay:{regex:RegExp("^"+v+"-?W(0[1-9]|[1-4][0-9]|5[0-3])(?:-?([0-7]))?"),name:"isoweekday | isoweek",callback:function(e,t,r,n){if(n=n?+n:1,!this.ymd(+t,0,1))return!1;var i=new Date(this.y,this.m,this.d).getDay();i=0-(i>4?i-7:i),this.rd+=i+7*(r-1)+n}},relativeText:{regex:RegExp("^("+m+"|"+y+")"+t+"("+g+")","i"),name:"relativetext",callback:function(e,t,r){var n,i={amount:{last:-1,previous:-1,this:0,first:1,next:1,second:2,third:3,fourth:4,fifth:5,sixth:6,seventh:7,eight:8,eighth:8,ninth:9,tenth:10,eleventh:11,twelfth:12}[n=t.toLowerCase()],behavior:{this:1}[n]||0}.amount;switch(r.toLowerCase()){case"sec":case"secs":case"second":case"seconds":this.rs+=i;break;case"min":case"mins":case"minute":case"minutes":this.ri+=i;break;case"hour":case"hours":this.rh+=i;break;case"day":case"days":this.rd+=i;break;case"fortnight":case"fortnights":case"forthnight":case"forthnights":this.rd+=14*i;break;case"week":case"weeks":this.rd+=7*i;break;case"month":case"months":this.rm+=i;break;case"year":case"years":this.ry+=i;break;case"mon":case"monday":case"tue":case"tuesday":case"wed":case"wednesday":case"thu":case"thursday":case"fri":case"friday":case"sat":case"saturday":case"sun":case"sunday":this.resetTime(),this.weekday=R(r,7),this.weekdayBehavior=1,this.rd+=7*(i>0?i-1:i)}}},relative:{regex:RegExp("^([+-]*)[ \\t]*(\\d+)"+r+"("+g+"|week)","i"),name:"relative",callback:function(e,t,r,n){var i=t.replace(/[^-]/g,"").length,s=+r*Math.pow(-1,i);switch(n.toLowerCase()){case"sec":case"secs":case"second":case"seconds":this.rs+=s;break;case"min":case"mins":case"minute":case"minutes":this.ri+=s;break;case"hour":case"hours":this.rh+=s;break;case"day":case"days":this.rd+=s;break;case"fortnight":case"fortnights":case"forthnight":case"forthnights":this.rd+=14*s;break;case"week":case"weeks":this.rd+=7*s;break;case"month":case"months":this.rm+=s;break;case"year":case"years":this.ry+=s;break;case"mon":case"monday":case"tue":case"tuesday":case"wed":case"wednesday":case"thu":case"thursday":case"fri":case"friday":case"sat":case"saturday":case"sun":case"sunday":this.resetTime(),this.weekday=R(n,7),this.weekdayBehavior=1,this.rd+=7*(s>0?s-1:s)}}},dayText:{regex:RegExp("^("+p+")","i"),name:"daytext",callback:function(e,t){this.resetTime(),this.weekday=R(t,0),2!==this.weekdayBehavior&&(this.weekdayBehavior=1)}},relativeTextWeek:{regex:RegExp("^("+y+")"+t+"week","i"),name:"relativetextweek",callback:function(e,t){switch(this.weekdayBehavior=2,t.toLowerCase()){case"this":this.rd+=0;break;case"next":this.rd+=7;break;case"last":case"previous":this.rd-=7}isNaN(this.weekday)&&(this.weekday=1)}},monthFullOrMonthAbbr:{regex:RegExp("^("+E+"|"+O+")","i"),name:"monthfull | monthabbr",callback:function(e,t){return this.ymd(this.y,j(t),this.d)}},tzCorrection:{regex:RegExp("^"+A,"i"),name:"tzcorrection",callback:function(e){return this.zone(C(e))}},tzAbbr:{regex:RegExp("^\\(?([a-zA-Z]{1,6})\\)?"),name:"tzabbr",callback:function(e,t){var r=M[t.toLowerCase()];return!isNaN(r)&&this.zone(r)}},ago:{regex:/^ago/i,name:"ago",callback:function(){this.ry=-this.ry,this.rm=-this.rm,this.rd=-this.rd,this.rh=-this.rh,this.ri=-this.ri,this.rs=-this.rs,this.rf=-this.rf}},year4:{regex:RegExp("^"+v),name:"year4",callback:function(e,t){return this.y=+t,!0}},whitespace:{regex:/^[ .,\t]+/,name:"whitespace"},dateShortWithTimeLong:{regex:RegExp("^"+N+"t?"+i+"[:.]"+o+"[:.]"+l,"i"),name:"dateshortwithtimelong",callback:function(e,t,r,n,i,s){return this.ymd(this.y,j(t),+r)&&this.time(+n,+i,+s,0)}},dateShortWithTimeLong12:{regex:RegExp("^"+N+a+"[:.]"+o+"[:.]"+c+r+n,"i"),name:"dateshortwithtimelong12",callback:function(e,t,r,n,i,s,a){return this.ymd(this.y,j(t),+r)&&this.time(P(+n,a),+i,+s,0)}},dateShortWithTimeShort:{regex:RegExp("^"+N+"t?"+i+"[:.]"+o,"i"),name:"dateshortwithtimeshort",callback:function(e,t,r,n,i){return this.ymd(this.y,j(t),+r)&&this.time(+n,+i,0,0)}},dateShortWithTimeShort12:{regex:RegExp("^"+N+a+"[:.]"+u+r+n,"i"),name:"dateshortwithtimeshort12",callback:function(e,t,r,n,i,s){return this.ymd(this.y,j(t),+r)&&this.time(P(+n,s),+i,0,0)}}},I={y:NaN,m:NaN,d:NaN,h:NaN,i:NaN,s:NaN,f:NaN,ry:0,rm:0,rd:0,rh:0,ri:0,rs:0,rf:0,weekday:NaN,weekdayBehavior:0,firstOrLastDayOfMonth:0,z:NaN,dates:0,times:0,zones:0,ymd:function(e,t,r){return!(this.dates>0||(this.dates++,this.y=e,this.m=t,this.d=r,0))},time:function(e,t,r,n){return!(this.times>0||(this.times++,this.h=e,this.i=t,this.s=r,this.f=n,0))},resetTime:function(){return this.h=0,this.i=0,this.s=0,this.f=0,this.times=0,!0},zone:function(e){return this.zones<=1&&(this.zones++,this.z=e,!0)},toDate:function(e){switch(this.dates&&!this.times&&(this.h=this.i=this.s=this.f=0),isNaN(this.y)&&(this.y=e.getFullYear()),isNaN(this.m)&&(this.m=e.getMonth()),isNaN(this.d)&&(this.d=e.getDate()),isNaN(this.h)&&(this.h=e.getHours()),isNaN(this.i)&&(this.i=e.getMinutes()),isNaN(this.s)&&(this.s=e.getSeconds()),isNaN(this.f)&&(this.f=e.getMilliseconds()),this.firstOrLastDayOfMonth){case 1:this.d=1;break;case-1:this.d=0,this.m+=1}if(!isNaN(this.weekday)){var t=new Date(e.getTime());t.setFullYear(this.y,this.m,this.d),t.setHours(this.h,this.i,this.s,this.f);var r=t.getDay();if(2===this.weekdayBehavior)0===r&&0!==this.weekday&&(this.weekday=-6),0===this.weekday&&0!==r&&(this.weekday=7),this.d-=r,this.d+=this.weekday;else{var n=this.weekday-r;(this.rd<0&&n<0||this.rd>=0&&n<=-this.weekdayBehavior)&&(n+=7),this.weekday>=0?this.d+=n:this.d-=7-(Math.abs(this.weekday)-r),this.weekday=NaN}}this.y+=this.ry,this.m+=this.rm,this.d+=this.rd,this.h+=this.rh,this.i+=this.ri,this.s+=this.rs,this.f+=this.rf,this.ry=this.rm=this.rd=0,this.rh=this.ri=this.rs=this.rf=0;var i=new Date(e.getTime());switch(i.setFullYear(this.y,this.m,this.d),i.setHours(this.h,this.i,this.s,this.f),this.firstOrLastDayOfMonth){case 1:i.setDate(1);break;case-1:i.setMonth(i.getMonth()+1,0)}return isNaN(this.z)||i.getTimezoneOffset()===this.z||(i.setUTCFullYear(i.getFullYear(),i.getMonth(),i.getDate()),i.setUTCHours(i.getHours(),i.getMinutes(),i.getSeconds()-this.z,i.getMilliseconds())),i}};e.exports=function(e,t){null==t&&(t=Math.floor(Date.now()/1e3));for(var r=[U.yesterday,U.now,U.noon,U.midnightOrToday,U.tomorrow,U.timestamp,U.firstOrLastDay,U.backOrFrontOf,U.timeTiny12,U.timeShort12,U.timeLong12,U.mssqltime,U.timeShort24,U.timeLong24,U.iso8601long,U.gnuNoColon,U.iso8601noColon,U.americanShort,U.american,U.iso8601date4,U.iso8601dateSlash,U.dateSlash,U.gnuDateShortOrIso8601date2,U.gnuDateShorter,U.dateFull,U.pointedDate4,U.pointedDate2,U.dateNoDay,U.dateNoDayRev,U.dateTextual,U.dateNoYear,U.dateNoYearRev,U.dateNoColon,U.xmlRpc,U.xmlRpcNoColon,U.soap,U.wddx,U.exif,U.pgydotd,U.isoWeekDay,U.pgTextShort,U.pgTextReverse,U.clf,U.year4,U.ago,U.dayText,U.relativeTextWeek,U.relativeText,U.monthFullOrMonthAbbr,U.tzCorrection,U.tzAbbr,U.dateShortWithTimeShort12,U.dateShortWithTimeLong12,U.dateShortWithTimeShort,U.dateShortWithTimeLong,U.relative,U.whitespace],n=Object.create(I);e.length;){for(var i=null,s=null,a=0,o=r.length;ai[0].length)&&(i=l,s=u)}if(!s||s.callback&&!1===s.callback.apply(n,i))return!1;e=e.substr(i[0].length),s=null,i=null}return Math.floor(n.toDate(new Date(1e3*t))/1e3)}},9655:function(e,t,r){e.exports=function(e){var t="undefined"!=typeof window?window:r.g;t.$locutus=t.$locutus||{};var n=t.$locutus;return n.php=n.php||{},n.php.ini=n.php.ini||{},n.php.ini[e]&&void 0!==n.php.ini[e].local_value?null===n.php.ini[e].local_value?"":n.php.ini[e].local_value:""}},7760:function(e){var t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};e.exports=function(e,r,n){if(arguments.length<2||void 0===e||void 0===r)return null;if(""===e||!1===e||null===e)return!1;if("function"==typeof e||"object"===(void 0===e?"undefined":t(e))||"function"==typeof r||"object"===(void 0===r?"undefined":t(r)))return{0:""};!0===e&&(e="1");var i=(r+="").split(e+="");return void 0===n?i:(0===n&&(n=1),n>0?n>=i.length?i:i.slice(0,n-1).concat([i.slice(n-1).join(e)]):-n>=i.length?[]:(i.splice(i.length+n),i))}},451:function(e){var t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};e.exports=function(e,r){var n="",i="",s="";if(1===arguments.length&&(r=e,e=""),"object"===(void 0===r?"undefined":t(r))){if("[object Array]"===Object.prototype.toString.call(r))return r.join(e);for(n in r)i+=s+r[n],s=e;return i}return r}},3369:function(e){e.exports=function(e,t,r){var n;return-1!==(n=(e+="").toLowerCase().indexOf((t+"").toLowerCase()))&&(r?e.substr(0,n):e.slice(n))}},3061:function(e,t,r){e.exports=function(e){var t=e+"";if("off"===(r(9655)("unicode.semantics")||"off"))return t.length;var n=0,i=0,s=function(e,t){var r=e.charCodeAt(t),n="",i="";if(r>=55296&&r<=56319){if(e.length<=t+1)throw new Error("High surrogate without following low surrogate");if((n=e.charCodeAt(t+1))<56320||n>57343)throw new Error("High surrogate without following low surrogate");return e.charAt(t)+e.charAt(t+1)}if(r>=56320&&r<=57343){if(0===t)throw new Error("Low surrogate without preceding high surrogate");if((i=e.charCodeAt(t-1))<55296||i>56319)throw new Error("Low surrogate without preceding high surrogate");return!1}return e.charAt(t)};for(n=0,i=0;ns||t<0||t>a)&&(i?e.slice(t,a).join(""):e.slice(t,a))}}},u={};function l(e){var t=u[e];if(void 0!==t)return t.exports;var r=u[e]={exports:{}};return o[e](r,r.exports,l),r.exports}l.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),e=l(5825),t=function(e,t,r,n){return new(r||(r=Promise))((function(i,s){function a(e){try{u(n.next(e))}catch(e){s(e)}}function o(e){try{u(n.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,o)}u((n=n.apply(e,t||[])).next())}))},r=function(e,t){var r,n,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]1&&r.forEach((function(e){e!=e&&e instanceof HTMLInputElement&&e.addEventListener("click",(function(){l[t]=s(e),c()}))}))}}))},document.querySelectorAll("*[data-field-type=calculation]").forEach((function(e){return t(void 0,void 0,void 0,(function(){var t;return r(this,(function(r){return(t=e.querySelector("input[data-calculations]"))?(a(t),[2]):[2]}))}))})),new MutationObserver((function(e){e.forEach((function(e){"childList"===e.type&&e.addedNodes.length>0&&e.addedNodes.forEach((function(e){if(e instanceof HTMLElement){var t=e.querySelector("input[data-calculations]");t&&a(t)}}))}))})).observe(document.body,{childList:!0,subtree:!0})}(); \ No newline at end of file +!function(){"use strict";var e,t,r,n,i,s,a,o={1968:function(e,t){function r(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Object.defineProperty(t,"__esModule",{value:!0}),t.CacheItem=t.default=void 0,t.default=class{constructor(e=0){r(this,"createCacheItem",((e,t,r)=>{let i=new n;return i.key=e,i.value=t,i.isHit=r,i.defaultLifetime=this.defaultLifetime,i})),r(this,"get",((e,t,r=null,n=null)=>{let i=this.getItem(e);if(!i.isHit){let e=!0;this.save(i.set(t(i,e)))}return i.get()})),r(this,"getItem",(e=>{let t=this.hasItem(e),r=null;return t?r=this.values[e]:this.values[e]=null,(0,this.createCacheItem)(e,r,t)})),r(this,"getItems",(e=>{for(let t of e)"string"==typeof t||this.expiries[t]||n.validateKey(t);return this.generateItems(e,(new Date).getTime()/1e3,this.createCacheItem)})),r(this,"deleteItems",(e=>{for(let t of e)this.deleteItem(t);return!0})),r(this,"save",(e=>!(!e instanceof n||(null!==e.expiry&&e.expiry<=(new Date).getTime()/1e3?(this.deleteItem(e.key),0):(null===e.expiry&&0this.save(e))),r(this,"commit",(()=>!0)),r(this,"delete",(e=>this.deleteItem(e))),r(this,"getValues",(()=>this.values)),r(this,"hasItem",(e=>!!("string"==typeof e&&this.expiries[e]&&this.expiries[e]>(new Date).getTime()/1e3)||(n.validateKey(e),!!this.expiries[e]&&!this.deleteItem(e)))),r(this,"clear",(()=>(this.values={},this.expiries={},!0))),r(this,"deleteItem",(e=>("string"==typeof e&&this.expiries[e]||n.validateKey(e),delete this.values[e],delete this.expiries[e],!0))),r(this,"reset",(()=>{this.clear()})),r(this,"generateItems",((e,t,r)=>{let n=[];for(let i of e){let e=null,s=!!this.expiries[i];s||!(this.expiries[i]>t)&&this.deleteItem(i)?e=this.values[i]:this.values[i]=null,n[i]=r(i,e,s)}return n})),this.defaultLifetime=e,this.values={},this.expiries={}}};class n{constructor(){r(this,"getKey",(()=>this.key)),r(this,"get",(()=>this.value)),r(this,"set",(e=>(this.value=e,this))),r(this,"expiresAt",(e=>{if(null===e)this.expiry=this.defaultLifetime>0?Date.now()/1e3+this.defaultLifetime:null;else{if(!(e instanceof Date))throw new Error(`Expiration date must be instance of Date or be null, "${e.name}" given`);this.expiry=e.getTime()/1e3}return this})),r(this,"expiresAfter",(e=>{if(null===e)this.expiry=this.defaultLifetime>0?Date.now()/1e3+this.defaultLifetime:null;else{if(!Number.isInteger(e))throw new Error(`Expiration date must be an integer or be null, "${e.name}" given`);this.expiry=(new Date).getTime()/1e3+e}return this})),r(this,"tag",(e=>{if(!this.isTaggable)throw new Error(`Cache item "${this.key}" comes from a non tag-aware pool: you cannot tag it.`);Array.isArray(e)||(e=[e]);for(let t of e){if("string"!=typeof t)throw new Error(`Cache tag must by a string, "${typeof t}" given.`);if(this.newMetadata.tags[t]&&""===t)throw new Error("Cache tag length must be greater than zero");this.newMetadata.tags[t]=t}return this})),r(this,"getMetadata",(()=>this.metadata)),this.key=null,this.value=null,this.isHit=!1,this.expiry=null,this.defaultLifetime=null,this.metadata={},this.newMetadata={},this.innerItem=null,this.poolHash=null,this.isTaggable=!1}}t.CacheItem=n,r(n,"METADATA_EXPIRY_OFFSET",1527506807),r(n,"RESERVED_CHARACTERS",["{","}","(",")","/","\\","@",":"]),r(n,"validateKey",(e=>{if("string"!=typeof e)throw new Error(`Cache key must be string, "${typeof e}" given.`);if(""===e)throw new Error("Cache key length must be greater than zero");for(let t of n.RESERVED_CHARACTERS)if(e.indexOf(t)>=0)throw new Error(`Cache key "${e}" contains reserved character "${t}".`);return e}))},1095:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(7164);function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}t.default=class{constructor(e){i(this,"getFunction",(e=>this.functions[e])),i(this,"getSource",(()=>this.source)),i(this,"reset",(()=>(this.source="",this))),i(this,"compile",(e=>(e.compile(this),this))),i(this,"subcompile",(e=>{let t=this.source;this.source="",e.compile(this);let r=this.source;return this.source=t,r})),i(this,"raw",(e=>(this.source+=e,this))),i(this,"string",(e=>(this.source+='"'+(0,n.addcslashes)(e,'\0\t"$\\')+'"',this))),i(this,"repr",((e,t=!1)=>{if(t)this.raw(e);else if(Number.isInteger(e)||+e===e&&(!isFinite(e)||e%1))this.raw(e);else if(null===e)this.raw("null");else if("boolean"==typeof e)this.raw(e?"true":"false");else if("object"==typeof e){this.raw("{");let t=!0;for(let r of Object.keys(e))t||this.raw(", "),t=!1,this.repr(r),this.raw(":"),this.repr(e[r]);this.raw("}")}else if(Array.isArray(e)){this.raw("[");let t=!0;for(let r of e)t||this.raw(", "),t=!1,this.repr(r);this.raw("]")}else this.string(e);return this})),this.source="",this.functions=e}}},3733:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=class{constructor(e){this.expression=e}toString(){return this.expression}}},8104:function(e,t){function r(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=class{constructor(e,t,n){r(this,"getName",(()=>this.name)),r(this,"getCompiler",(()=>this.compiler)),r(this,"getEvaluator",(()=>this.evaluator)),this.name=e,this.compiler=t,this.evaluator=n}}},339:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(3861),i=l(r(2066)),s=l(r(1095)),a=l(r(3763)),o=l(r(1968)),u=l(r(3435));function l(e){return e&&e.__esModule?e:{default:e}}function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}t.default=class{constructor(e=null,t=[]){c(this,"compile",((e,t=[])=>this.getCompiler().compile(this.parse(e,t).getNodes()).getSource())),c(this,"evaluate",((e,t={})=>this.parse(e,Object.keys(t)).getNodes().evaluate(this.functions,t))),c(this,"parse",((e,t)=>{if(e instanceof a.default)return e;t.sort(((e,t)=>{let r=e,n=t;return"object"==typeof e&&(r=Object.values(e)[0]),"object"==typeof t&&(n=Object.values(t)[0]),r.localeCompare(n)}));let r=[];for(let e of t){let t=e;"object"==typeof e&&(t=Object.keys(e)[0]+":"+Object.values(e)[0]),r.push(t)}let i=this.cache.getItem(this.fixedEncodeURIComponent(e+"//"+r.join("|"))),s=i.get();if(null===s){let r=this.getParser().parse((0,n.tokenize)(e),t);s=new a.default(e,r),i.set(s),this.cache.save(i)}return s})),c(this,"fixedEncodeURIComponent",(e=>encodeURIComponent(e).replace(/[!'()*]/g,(function(e){return"%"+e.charCodeAt(0).toString(16)})))),c(this,"register",((e,t,r)=>{if(null!==this.parser)throw new u.default("Registering functions after calling evaluate(), compile(), or parse() is not supported.");this.functions[e]={compiler:t,evaluator:r}})),c(this,"addFunction",(e=>{this.register(e.getName(),e.getCompiler(),e.getEvaluator())})),c(this,"registerProvider",(e=>{for(let t of e.getFunctions())this.addFunction(t)})),c(this,"getParser",(()=>(null===this.parser&&(this.parser=new i.default(this.functions)),this.parser))),c(this,"getCompiler",(()=>(null===this.compiler&&(this.compiler=new s.default(this.functions)),this.compiler.reset()))),this.functions=[],this.parser=null,this.compiler=null,this.cache=e||new o.default;for(let e of t)this.registerProvider(e)}_registerFunctions(){}}},3861:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.tokenize=function(e){let t=0,r=[],n=[],o=(e=e.replace(/\r|\n|\t|\v|\f/g," ")).length;for(;t=0)n.push([e[t],t]),r.push(new s.Token(s.Token.PUNCTUATION_TYPE,e[t],t+1)),++t;else if(")]}".indexOf(e[t])>=0){if(0===n.length)throw new i.default(`Unexpected "${e[t]}"`,t,e);let[a,o]=n.pop(),u=a.replace("(",")").replace("{","}").replace("[","]");if(e[t]!==u)throw new i.default(`Unclosed "${a}"`,o,e);r.push(new s.Token(s.Token.PUNCTUATION_TYPE,e[t],t+1)),++t}else{let n=u(e.substr(t));if(null!==n)r.push(new s.Token(s.Token.STRING_TYPE,n.captured,t+1)),t+=n.length;else{let n=h(e.substr(t));if(n)r.push(new s.Token(s.Token.OPERATOR_TYPE,n,t+1)),t+=n.length;else if(".,?:".indexOf(e[t])>=0)r.push(new s.Token(s.Token.PUNCTUATION_TYPE,e[t],t+1)),++t;else{let n=f(e.substr(t));if(!n)throw new i.default(`Unexpected character "${e[t]}"`,t,e);r.push(new s.Token(s.Token.NAME_TYPE,n,t+1)),t+=n.length}}}}if(r.push(new s.Token(s.Token.EOF_TYPE,null,t+1)),n.length>0){let[t,r]=n.pop();throw new i.default(`Unclosed "${t}"`,r,e)}return new s.TokenStream(e,r)};var n,i=(n=r(6053))&&n.__esModule?n:{default:n},s=r(9632);function a(e){let t=null,r=e.match(/^[0-9]+(?:.[0-9]+)?/);return r&&r.length>0&&(t=r[0],t=-1===t.indexOf(".")?parseInt(t):parseFloat(t)),t}const o=/^"([^"\\]*(?:\\.[^"\\]*)*)"|'([^'\\]*(?:\\.[^'\\]*)*)'/s;function u(e){let t=null;if(-1===["'",'"'].indexOf(e.substr(0,1)))return t;let r=o.exec(e);return null!==r&&r.length>0&&(t=r[1]?{captured:r[1]}:{captured:r[2]},t.length=r[0].length),t}const l=["&&","and","||","or","+","-","*","/","%","**","&","|","^","===","!==","!=","==","<=",">=","<",">","matches","not in","in","not","!","~",".."],c=["and","or","matches","not in","in","not"];function h(e){let t=null;for(let r of l)if(e.substr(0,r.length)===r){c.indexOf(r)>=0?e.substr(0,r.length+1)===r+" "&&(t=r):t=r;break}return t}function f(e){let t=null,r=e.match(/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/);return r&&r.length>0&&(t=r[0]),t}},3435:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;class r extends Error{constructor(e){super(e),this.name="LogicException"}toString(){return`${this.name}: ${this.message}`}}t.default=r},4950:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(8278))&&n.__esModule?n:{default:n};class s extends i.default{constructor(){super(),function(e,t,r){t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(this,"compile",(e=>{this.compileArguments(e,!1)})),this.name="ArgumentsNode"}toArray(){let e=[];for(let t of this.getKeyValuePairs())e.push(t.value),e.push(", ");return e.pop(),e}}t.default=s},8278:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=s(r(3e3)),i=s(r(4985));function s(e){return e&&e.__esModule?e:{default:e}}function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class o extends n.default{constructor(){super(),a(this,"addElement",((e,t=null)=>{null===t?t=new i.default(++this.index):"Array"===this.type&&(this.type="Object"),this.nodes[(++this.keyIndex).toString()]=t,this.nodes[(++this.keyIndex).toString()]=e})),a(this,"compile",(e=>{"Object"===this.type?e.raw("{"):e.raw("["),this.compileArguments(e,"Array"!==this.type),"Object"===this.type?e.raw("}"):e.raw("]")})),a(this,"evaluate",((e,t)=>{let r;if("Array"===this.type){r=[];for(let n of this.getKeyValuePairs())r.push(n.value.evaluate(e,t))}else{r={};for(let n of this.getKeyValuePairs())r[n.key.evaluate(e,t)]=n.value.evaluate(e,t)}return r})),a(this,"getKeyValuePairs",(()=>{let e,t,r,n=[],i=Object.values(this.nodes);for(e=0,t=i.length;e{let r=!0;for(let n of this.getKeyValuePairs())r||e.raw(", "),r=!1,t&&e.compile(n.key).raw(": "),e.compile(n.value)})),this.name="ArrayNode",this.type="Array",this.index=-1,this.keyIndex=-1}toArray(){let e={};for(let t of this.getKeyValuePairs())e[t.key.attributes.value]=t.value;let t=[];if(this.isHash(e)){for(let r of Object.keys(e))t.push(", "),t.push(new i.default(r)),t.push(": "),t.push(e[r]);t[0]="{",t.push("}")}else{for(let r of Object.values(e))t.push(", "),t.push(r);t[0]="[",t.push("]")}return t}}t.default=o},2865:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(3e3))&&n.__esModule?n:{default:n},s=r(656);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class o extends i.default{constructor(e,t,r){super({left:t,right:r},{operator:e}),a(this,"compile",(e=>{let t=this.attributes.operator;"matches"!==t?void 0===o.functions[t]?(void 0!==o.operators[t]&&(t=o.operators[t]),e.raw("(").compile(this.nodes.left).raw(" ").raw(t).raw(" ").compile(this.nodes.right).raw(")")):e.raw(`${o.functions[t]}(`).compile(this.nodes.left).raw(", ").compile(this.nodes.right).raw(")"):e.compile(this.nodes.right).raw(".test(").compile(this.nodes.left).raw(")")})),a(this,"evaluate",((e,t)=>{let r=this.attributes.operator,n=this.nodes.left.evaluate(e,t);if(void 0!==o.functions[r]){let i=this.nodes.right.evaluate(e,t);switch(r){case"not in":return-1===i.indexOf(n);case"in":return i.indexOf(n)>=0;case"..":return(0,s.range)(n,i);case"**":return Math.pow(n,i)}}let i=null;switch(r){case"or":case"||":return n||(i=this.nodes.right.evaluate(e,t)),n||i;case"and":case"&&":return n&&(i=this.nodes.right.evaluate(e,t)),n&&i}switch(i=this.nodes.right.evaluate(e,t),r){case"|":return n|i;case"^":return n^i;case"&":return n&i;case"==":return n==i;case"===":return n===i;case"!=":return n!=i;case"!==":return n!==i;case"<":return n":return n>i;case">=":return n>=i;case"<=":return n<=i;case"not in":return-1===i.indexOf(n);case"in":return i.indexOf(n)>=0;case"+":return n+i;case"-":return n-i;case"~":return n.toString()+i.toString();case"*":return n*i;case"/":return n/i;case"%":return n%i;case"matches":let e=i.match(o.regex_expression);return new RegExp(e[1],e[2]).test(n)}})),this.name="BinaryNode"}toArray(){return["(",this.nodes.left," "+this.attributes.operator+" ",this.nodes.right,")"]}}t.default=o,a(o,"regex_expression",/\/(.+)\/(.*)/),a(o,"operators",{"~":".",and:"&&",or:"||"}),a(o,"functions",{"**":"Math.pow","..":"range",in:"includes","not in":"!includes"})},1290:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(3e3))&&n.__esModule?n:{default:n};function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class a extends i.default{constructor(e,t,r){super({expr1:e,expr2:t,expr3:r}),s(this,"compile",(e=>{e.raw("((").compile(this.nodes.expr1).raw(") ? (").compile(this.nodes.expr2).raw(") : (").compile(this.nodes.expr3).raw("))")})),s(this,"evaluate",((e,t)=>this.nodes.expr1.evaluate(e,t)?this.nodes.expr2.evaluate(e,t):this.nodes.expr3.evaluate(e,t))),this.name="ConditionalNode"}toArray(){return["(",this.nodes.expr1," ? ",this.nodes.expr2," : ",this.nodes.expr3,")"]}}t.default=a},4985:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(3e3))&&n.__esModule?n:{default:n};function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class a extends i.default{constructor(e,t=!1){super({},{value:e}),s(this,"compile",(e=>{e.repr(this.attributes.value,this.isIdentifier)})),s(this,"evaluate",((e,t)=>this.attributes.value)),s(this,"toArray",(()=>{let e=[],t=this.attributes.value;if(this.isIdentifier)e.push(t);else if(!0===t)e.push("true");else if(!1===t)e.push("false");else if(null===t)e.push("null");else if("number"==typeof t)e.push(t);else if("string"==typeof t)e.push(this.dumpString(t));else if(Array.isArray(t)){for(let r of t)e.push(","),e.push(new a(r));e[0]="[",e.push("]")}else if(this.isHash(t)){for(let r of Object.keys(t))e.push(", "),e.push(new a(r)),e.push(": "),e.push(new a(t[r]));e[0]="{",e.push("}")}return e})),this.isIdentifier=t,this.name="ConstantNode"}}t.default=a},1735:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(3e3))&&n.__esModule?n:{default:n};function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class a extends i.default{constructor(e,t){super({arguments:t},{name:e}),s(this,"compile",(e=>{let t=[];for(let r of Object.values(this.nodes.arguments.nodes))t.push(e.subcompile(r));let r=e.getFunction(this.attributes.name);e.raw(r.compiler.apply(null,t))})),s(this,"evaluate",((e,t)=>{let r=[t];for(let n of Object.values(this.nodes.arguments.nodes))r.push(n.evaluate(e,t));return e[this.attributes.name].evaluator.apply(null,r)})),this.name="FunctionNode"}toArray(){let e=[];e.push(this.attributes.name);for(let t of Object.values(this.nodes.arguments.nodes))e.push(", "),e.push(t);return e[1]="(",e.push(")"),e}}t.default=a},4602:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(3e3))&&n.__esModule?n:{default:n};function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class a extends i.default{constructor(e,t,r,n){super({node:e,attribute:t,arguments:r},{type:n}),s(this,"compile",(e=>{switch(this.attributes.type){case a.PROPERTY_CALL:e.compile(this.nodes.node).raw(".").raw(this.nodes.attribute.attributes.value);break;case a.METHOD_CALL:e.compile(this.nodes.node).raw(".").raw(this.nodes.attribute.attributes.value).raw("(").compile(this.nodes.arguments).raw(")");break;case a.ARRAY_CALL:e.compile(this.nodes.node).raw("[").compile(this.nodes.attribute).raw("]")}})),s(this,"evaluate",((e,t)=>{switch(this.attributes.type){case a.PROPERTY_CALL:let r=this.nodes.node.evaluate(e,t),n=this.nodes.attribute.attributes.value;if("object"!=typeof r)throw new Error(`Unable to get property "${n}" on a non-object: `+typeof r);return r[n];case a.METHOD_CALL:let i=this.nodes.node.evaluate(e,t),s=this.nodes.attribute.attributes.value;if("object"!=typeof i)throw new Error(`Unable to call method "${s}" on a non-object: `+typeof i);if(void 0===i[s])throw new Error(`Method "${s}" is undefined on object.`);if("function"!=typeof i[s])throw new Error(`Method "${s}" is not a function on object.`);let o=this.nodes.arguments.evaluate(e,t);return i[s].apply(null,o);case a.ARRAY_CALL:let u=this.nodes.node.evaluate(e,t);if(!Array.isArray(u)&&"object"!=typeof u)throw new Error("Unable to get an item on a non-array: "+typeof u);return u[this.nodes.attribute.evaluate(e,t)]}})),this.name="GetAttrNode"}toArray(){switch(this.attributes.type){case a.PROPERTY_CALL:return[this.nodes.node,".",this.nodes.attribute];case a.METHOD_CALL:return[this.nodes.node,".",this.nodes.attribute,"(",this.nodes.arguments,")"];case a.ARRAY_CALL:return[this.nodes.node,"[",this.nodes.attribute,"]"]}}}t.default=a,s(a,"PROPERTY_CALL",1),s(a,"METHOD_CALL",2),s(a,"ARRAY_CALL",3)},1653:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(3e3))&&n.__esModule?n:{default:n};function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class a extends i.default{constructor(e){super({},{name:e}),s(this,"compile",(e=>{e.raw(this.attributes.name)})),s(this,"evaluate",((e,t)=>t[this.attributes.name])),this.name="NameNode"}toArray(){return[this.attributes.name]}}t.default=a},3e3:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(9752),i=r(7164);function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}t.default=class{constructor(e={},t={}){s(this,"compile",(e=>{for(let t of Object.values(this.nodes))t.compile(e)})),s(this,"evaluate",((e,t)=>{let r=[];for(let n of Object.values(this.nodes))r.push(n.evaluate(e,t));return r})),s(this,"dump",(()=>{let e="";for(let t of this.toArray())e+=(0,n.is_scalar)(t)?t:t.dump();return e})),s(this,"dumpString",(e=>`"${(0,i.addcslashes)(e,'\0\t"\\')}"`)),s(this,"isHash",(e=>{let t=0;for(let r of Object.keys(e))if(r=parseInt(r),r!==t++)return!0;return!1})),this.name="Node",this.nodes=e,this.attributes=t}toString(){let e=[];for(let t of Object.keys(this.attributes)){let r="null";this.attributes[t]&&(r=this.attributes[t].toString()),e.push(`${t}: '${r}'`)}let t=[this.name+"("+e.join(", ")];if(this.nodes.length>0){for(let e of Object.values(this.nodes)){let r=e.toString().split("\n");for(let e of r)t.push(" "+e)}t.push(")")}else t[0]+=")";return t.join("\n")}toArray(){throw new Error(`Dumping a "${this.name}" instance is not supported yet.`)}}},4501:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(3e3))&&n.__esModule?n:{default:n};function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class a extends i.default{constructor(e,t){super({node:t},{operator:e}),s(this,"compile",(e=>{e.raw("(").raw(a.operators[this.attributes.operator]).compile(this.nodes.node).raw(")")})),s(this,"evaluate",((e,t)=>{let r=this.nodes.node.evaluate(e,t);switch(this.attributes.operator){case"not":case"!":return!r;case"-":return-r}return r})),this.name="UnaryNode"}toArray(){return["(",this.attributes.operator+" ",this.nodes.node,")"]}}t.default=a,s(a,"operators",{"!":"!",not:"!","+":"+","-":"-"})},3763:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(3733))&&n.__esModule?n:{default:n};class s extends i.default{constructor(e,t){super(e),function(e,t,r){t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(this,"getNodes",(()=>this.nodes)),this.nodes=t}}t.default=s},2066:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.OPERATOR_RIGHT=t.OPERATOR_LEFT=void 0;var n=m(r(6053)),i=r(9632),s=m(r(3e3)),a=m(r(2865)),o=m(r(4501)),u=m(r(4985)),l=m(r(1290)),c=m(r(1735)),h=m(r(1653)),f=m(r(8278)),d=m(r(4950)),p=m(r(4602));function m(e){return e&&e.__esModule?e:{default:e}}function y(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}t.OPERATOR_LEFT=1,t.OPERATOR_RIGHT=2,t.default=class{constructor(e={}){y(this,"functions",{}),y(this,"unaryOperators",{not:{precedence:50},"!":{precedence:50},"-":{precedence:500},"+":{precedence:500}}),y(this,"binaryOperators",{or:{precedence:10,associativity:1},"||":{precedence:10,associativity:1},and:{precedence:15,associativity:1},"&&":{precedence:15,associativity:1},"|":{precedence:16,associativity:1},"^":{precedence:17,associativity:1},"&":{precedence:18,associativity:1},"==":{precedence:20,associativity:1},"===":{precedence:20,associativity:1},"!=":{precedence:20,associativity:1},"!==":{precedence:20,associativity:1},"<":{precedence:20,associativity:1},">":{precedence:20,associativity:1},">=":{precedence:20,associativity:1},"<=":{precedence:20,associativity:1},"not in":{precedence:20,associativity:1},in:{precedence:20,associativity:1},matches:{precedence:20,associativity:1},"..":{precedence:25,associativity:1},"+":{precedence:30,associativity:1},"-":{precedence:30,associativity:1},"~":{precedence:40,associativity:1},"*":{precedence:60,associativity:1},"/":{precedence:60,associativity:1},"%":{precedence:60,associativity:1},"**":{precedence:200,associativity:2}}),y(this,"parse",((e,t=[])=>{this.tokenStream=e,this.names=t,this.objectMatches={},this.cachedNames=null,this.nestedExecutions=0;let r=this.parseExpression();if(!this.tokenStream.isEOF())throw new n.default(`Unexpected token "${this.tokenStream.current.type}" of value "${this.tokenStream.current.value}".`,this.tokenStream.current.cursor,this.tokenStream.expression);return r})),y(this,"parseExpression",((e=0)=>{let t=this.getPrimary(),r=this.tokenStream.current;if(this.nestedExecutions++,this.nestedExecutions>100)throw new Error("Way to many executions on '"+r.toString()+"' of '"+this.tokenStream.toString()+"'");for(;r.test(i.Token.OPERATOR_TYPE)&&void 0!==this.binaryOperators[r.value]&&null!==this.binaryOperators[r.value]&&this.binaryOperators[r.value].precedence>=e;){let e=this.binaryOperators[r.value];this.tokenStream.next();let n=this.parseExpression(1===e.associativity?e.precedence+1:e.precedence);t=new a.default(r.value,t,n),r=this.tokenStream.current}return 0===e?this.parseConditionalExpression(t):t})),y(this,"getPrimary",(()=>{let e=this.tokenStream.current;if(e.test(i.Token.OPERATOR_TYPE)&&void 0!==this.unaryOperators[e.value]&&null!==this.unaryOperators[e.value]){let t=this.unaryOperators[e.value];this.tokenStream.next();let r=this.parseExpression(t.precedence);return this.parsePostfixExpression(new o.default(e.value,r))}if(e.test(i.Token.PUNCTUATION_TYPE,"(")){this.tokenStream.next();let e=this.parseExpression();return this.tokenStream.expect(i.Token.PUNCTUATION_TYPE,")","An opened parenthesis is not properly closed"),this.parsePostfixExpression(e)}return this.parsePrimaryExpression()})),y(this,"hasVariable",(e=>this.getNames().indexOf(e)>=0)),y(this,"getNames",(()=>{if(null!==this.cachedNames)return this.cachedNames;if(this.names&&this.names.length>0){let e=[],t=0;this.objectMatches={};for(let r of this.names)"object"==typeof r?(this.objectMatches[Object.values(r)[0]]=t,e.push(Object.keys(r)[0]),e.push(Object.values(r)[0])):e.push(r),t++;return this.cachedNames=e,e}return[]})),y(this,"parseArrayExpression",(()=>{this.tokenStream.expect(i.Token.PUNCTUATION_TYPE,"[","An array element was expected");let e=new f.default,t=!0;for(;!this.tokenStream.current.test(i.Token.PUNCTUATION_TYPE,"]")&&(t||(this.tokenStream.expect(i.Token.PUNCTUATION_TYPE,",","An array element must be followed by a comma"),!this.tokenStream.current.test(i.Token.PUNCTUATION_TYPE,"]")));)t=!1,e.addElement(this.parseExpression());return this.tokenStream.expect(i.Token.PUNCTUATION_TYPE,"]","An opened array is not properly closed"),e})),y(this,"parseHashExpression",(()=>{this.tokenStream.expect(i.Token.PUNCTUATION_TYPE,"{","A hash element was expected");let e=new f.default,t=!0;for(;!this.tokenStream.current.test(i.Token.PUNCTUATION_TYPE,"}")&&(t||(this.tokenStream.expect(i.Token.PUNCTUATION_TYPE,",","An array element must be followed by a comma"),!this.tokenStream.current.test(i.Token.PUNCTUATION_TYPE,"}")));){t=!1;let r=null;if(this.tokenStream.current.test(i.Token.STRING_TYPE)||this.tokenStream.current.test(i.Token.NAME_TYPE)||this.tokenStream.current.test(i.Token.NUMBER_TYPE))r=new u.default(this.tokenStream.current.value),this.tokenStream.next();else{if(!this.tokenStream.current.test(i.Token.PUNCTUATION_TYPE,"(")){let e=this.tokenStream.current;throw new n.default(`A hash key must be a quoted string, a number, a name, or an expression enclosed in parentheses (unexpected token "${e.type}" of value "${e.value}"`,e.cursor,this.tokenStream.expression)}r=this.parseExpression()}this.tokenStream.expect(i.Token.PUNCTUATION_TYPE,":","A hash key must be followed by a colon (:)");let s=this.parseExpression();e.addElement(s,r)}return this.tokenStream.expect(i.Token.PUNCTUATION_TYPE,"}","An opened hash is not properly closed"),e})),y(this,"parsePostfixExpression",(e=>{let t=this.tokenStream.current;for(;i.Token.PUNCTUATION_TYPE===t.type;){if("."===t.value){if(this.tokenStream.next(),t=this.tokenStream.current,this.tokenStream.next(),i.Token.NAME_TYPE!==t.type&&(i.Token.OPERATOR_TYPE!==t.type||!/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/.test(t.value)))throw new n.default("Expected name",t.cursor,this.tokenStream.expression);let r=new u.default(t.value,!0),s=new d.default,a=null;if(this.tokenStream.current.test(i.Token.PUNCTUATION_TYPE,"(")){a=p.default.METHOD_CALL;for(let e of Object.values(this.parseArguments().nodes))s.addElement(e)}else a=p.default.PROPERTY_CALL;e=new p.default(e,r,s,a)}else{if("["!==t.value)break;{this.tokenStream.next();let t=this.parseExpression();this.tokenStream.expect(i.Token.PUNCTUATION_TYPE,"]"),e=new p.default(e,t,new d.default,p.default.ARRAY_CALL)}}t=this.tokenStream.current}return e})),y(this,"parseArguments",(()=>{let e=[];for(this.tokenStream.expect(i.Token.PUNCTUATION_TYPE,"(","A list of arguments must begin with an opening parenthesis");!this.tokenStream.current.test(i.Token.PUNCTUATION_TYPE,")");)0!==e.length&&this.tokenStream.expect(i.Token.PUNCTUATION_TYPE,",","Arguments must be separated by a comma"),e.push(this.parseExpression());return this.tokenStream.expect(i.Token.PUNCTUATION_TYPE,")","A list of arguments must be closed by a parenthesis"),new s.default(e)})),this.functions=e,this.tokenStream=null,this.names=null,this.objectMatches={},this.cachedNames=null,this.nestedExecutions=0}parseConditionalExpression(e){for(;this.tokenStream.current.test(i.Token.PUNCTUATION_TYPE,"?");){let t,r;this.tokenStream.next(),this.tokenStream.current.test(i.Token.PUNCTUATION_TYPE,":")?(this.tokenStream.next(),t=e,r=this.parseExpression()):(t=this.parseExpression(),this.tokenStream.current.test(i.Token.PUNCTUATION_TYPE,":")?(this.tokenStream.next(),r=this.parseExpression()):r=new u.default(null)),e=new l.default(e,t,r)}return e}parsePrimaryExpression(){let e=this.tokenStream.current,t=null;switch(e.type){case i.Token.NAME_TYPE:switch(this.tokenStream.next(),e.value){case"true":case"TRUE":return new u.default(!0);case"false":case"FALSE":return new u.default(!1);case"null":case"NULL":return new u.default(null);default:if("("===this.tokenStream.current.value){if(void 0===this.functions[e.value])throw new n.default(`The function "${e.value}" does not exist`,e.cursor,this.tokenStream.expression,e.values,Object.keys(this.functions));t=new c.default(e.value,this.parseArguments())}else{if(!this.hasVariable(e.value))throw new n.default(`Variable "${e.value}" is not valid`,e.cursor,this.tokenStream.expression,e.value,this.getNames());let r=e.value;void 0!==this.objectMatches[r]&&(r=this.getNames()[this.objectMatches[r]]),t=new h.default(r)}}break;case i.Token.NUMBER_TYPE:case i.Token.STRING_TYPE:return this.tokenStream.next(),new u.default(e.value);default:if(e.test(i.Token.PUNCTUATION_TYPE,"["))t=this.parseArrayExpression();else{if(!e.test(i.Token.PUNCTUATION_TYPE,"{"))throw new n.default(`Unexpected token "${e.type}" of value "${e.value}"`,e.cursor,this.tokenStream.expression);t=this.parseHashExpression()}}return this.parsePostfixExpression(t)}}},2242:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=class{getFunctions(){throw new Error("getFunctions must be implemented by "+this.name)}}},7478:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.arrayIntersectFn=t.countFn=t.implodeFn=t.default=void 0;var n=u(r(8104)),i=u(r(2242)),s=u(r(1315)),a=u(r(4652)),o=u(r(451));function u(e){return e&&e.__esModule?e:{default:e}}class l extends i.default{getFunctions(){return[c,h,f]}}t.default=l;const c=new n.default("implode",(function(e,t){return`implode(${e}, ${t})`}),(function(e,t,r){return(0,o.default)(t,r)}));t.implodeFn=c;const h=new n.default("count",(function(e,t){let r="";return t&&(r=`, ${t}`),`count(${e}${r})`}),(function(e,t,r){return(0,a.default)(t,r)}));t.countFn=h;const f=new n.default("array_intersect",(function(e,...t){let r="";return t.length>0&&(r=", "+t.join(", ")),`array_intersect(${e}${r})`}),(function(e){let t=[],r=!0;for(let e=1;e0){if(void 0!==e[r]){let t=e[r];for(let e of n){if("array"===e.type){if(void 0===t[e.index])return!1;t=t[e.index]}if("object"===e.type){if(void 0===t[e.attribute])return!1;t=t[e.attribute]}}return!0}return!1}return void 0!==e[r]}));t.issetFn=o},8401:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=o(r(2242)),i=o(r(8104)),s=o(r(8886)),a=o(r(5455));function o(e){return e&&e.__esModule?e:{default:e}}class u extends n.default{getFunctions(){return[new i.default("date",(function(e,t){let r="";return t&&(r=`, ${t}`),`date(${e}${r})`}),(function(e,t,r){return(0,s.default)(t,r)})),new i.default("strtotime",(function(e,t){let r="";return t&&(r=`, ${t}`),`strtotime(${e}${r})`}),(function(e,t,r){return(0,a.default)(t,r)}))]}}t.default=u},2213:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=f(r(8104)),i=f(r(2242)),s=f(r(7760)),a=f(r(3061)),o=f(r(9565)),u=f(r(7483)),l=f(r(9202)),c=f(r(8293)),h=f(r(3369));function f(e){return e&&e.__esModule?e:{default:e}}class d extends i.default{getFunctions(){return[new n.default("strtolower",(e=>"strtolower("+e+")"),((e,t)=>(0,o.default)(t))),new n.default("strtoupper",(e=>"strtoupper("+e+")"),((e,t)=>(0,u.default)(t))),new n.default("explode",((e,t,r="null")=>`explode(${e}, ${t}, ${r})`),((e,t,r,n=null)=>(0,s.default)(t,r,n))),new n.default("strlen",(function(e){return`strlen(${e});`}),(function(e,t){return(0,a.default)(t)})),new n.default("strstr",(function(e,t,r){let n="";return r&&(n=`, ${r}`),`strstr(${e}, ${t}${n});`}),(function(e,t,r,n){return(0,c.default)(t,r,n)})),new n.default("stristr",(function(e,t,r){let n="";return r&&(n=`, ${r}`),`stristr(${e}, ${t}${n});`}),(function(e,t,r,n){return(0,h.default)(t,r,n)})),new n.default("substr",(function(e,t,r){let n="";return r&&(n=`, ${r}`),`substr(${e}, ${t}${n});`}),(function(e,t,r,n){return(0,l.default)(t,r,n)}))]}}t.default=d},6053:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(8219);class i extends Error{constructor(e,t,r,n,i){super(e),this.name="SyntaxError",this.cursor=t,this.expression=r,this.subject=n,this.proposals=i}toString(){let e=`${this.name}: ${this.message} around position ${this.cursor}`;if(this.expression&&(e+=` for expression \`${this.expression}\``),e+=".",this.subject&&this.proposals){let t=Number.MAX_SAFE_INTEGER,r=null;for(let e of this.proposals){let i=(0,n.getEditDistance)(this.subject,e);i{if(this.position+=1,void 0===this.tokens[this.position])throw new i.default("Unexpected end of expression",this.last.cursor,this.expression)})),s(this,"expect",((e,t,r)=>{let n=this.current;if(!n.test(e,t)){let s="";r&&(s=r+". ");let a="";throw t&&(a=` with value "${t}"`),s+=`Unexpected token "${n.type}" of value "${n.value}" ("${e}" expected${a})`,new i.default(s,n.cursor,this.expression)}this.next()})),s(this,"isEOF",(()=>o.EOF_TYPE===this.current.type)),s(this,"isEqualTo",(e=>{if(null==e||!e instanceof a)return!1;if(e.tokens.length!==this.tokens.length)return!1;let t=e.position;e.position=0;let r=!0;for(let t of this.tokens){if(!e.current.isEqualTo(t)){r=!1;break}e.position{let t=[];if(!this.isEqualTo(e)){let r=0,n=e.position;e.position=0;for(let n of this.tokens){let i=n.diff(e.current);i.length>0&&t.push({index:r,diff:i}),e.positionthis.type===e&&(null===t||this.value===t))),s(this,"isEqualTo",(e=>!(null==e||!e instanceof o)&&e.value==this.value&&e.type===this.type&&e.cursor===this.cursor)),s(this,"diff",(e=>{let t=[];return this.isEqualTo(e)||(e.value!==this.value&&t.push(`Value: ${e.value} != ${this.value}`),e.cursor!==this.cursor&&t.push(`Cursor: ${e.cursor} != ${this.cursor}`),e.type!==this.type&&t.push(`Type: ${e.type} != ${this.type}`)),t})),this.value=t,this.type=e,this.cursor=r}toString(){return`${this.cursor} [${this.type}] ${this.value}`}}t.Token=o,s(o,"EOF_TYPE","end of expression"),s(o,"NAME_TYPE","name"),s(o,"NUMBER_TYPE","number"),s(o,"STRING_TYPE","string"),s(o,"OPERATOR_TYPE","operator"),s(o,"PUNCTUATION_TYPE","punctuation")},5825:function(e,t,r){t.ZP=void 0;var n=i(r(339));r(3861),i(r(2066)),i(r(8104)),i(r(1095)),i(r(1968)),i(r(1615)),i(r(2213)),i(r(7478)),i(r(8401));function i(e){return e&&e.__esModule?e:{default:e}}var s=n.default;t.ZP=s},8219:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getEditDistance=void 0,t.getEditDistance=function(e,t){if(0===e.length)return t.length;if(0===t.length)return e.length;let r,n,i=[];for(r=0;r<=t.length;r++)i[r]=[r];for(n=0;n<=e.length;n++)void 0===i[0]&&(i[0]=[]),i[0][n]=n;for(r=1;r<=t.length;r++)for(n=1;n<=e.length;n++)t.charAt(r-1)===e.charAt(n-1)?i[r][n]=i[r-1][n-1]:i[r][n]=Math.min(i[r-1][n-1]+1,Math.min(i[r][n-1]+1,i[r-1][n]+1));return void 0===i[t.length]&&(i[t.length]=[]),i[t.length][e.length]}},7164:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.addcslashes=function(e,t){var r="",n=[],i=0,s=0,a="",o="",u="",l="",c="",h=0,f=0,d=0,p=0,m=0,y=[],g="",b=/%([\dA-Fa-f]+)/g,v=function(e,t){return(e+="").lengthh)for(s=h;s<=f;s++)n.push(String.fromCharCode(s));else n.push(".",u,l);i+=l.length+2}else c=String.fromCharCode(parseInt(u,8)),n.push(c);i+=d}else if(o+t.charAt(i+2)===".."){if(h=(u=a).charCodeAt(0),/\\\d/.test(t.charAt(i+3)+t.charAt(i+4)))l=t.slice(i+4).match(/^\d+/)[0],i+=1;else{if(!t.charAt(i+3))throw new Error("Range with no end point");l=t.charAt(i+3)}if((f=l.charCodeAt(0))>h)for(s=h;s<=f;s++)n.push(String.fromCharCode(s));else n.push(".",u,l);i+=l.length+2}else n.push(a);for(i=0;i126)switch(a){case"\n":r+="n";break;case"\t":r+="t";break;case"\r":r+="r";break;case"":r+="a";break;case"\v":r+="v";break;case"\b":r+="b";break;case"\f":r+="f";break;default:for(g=encodeURIComponent(a),null!==(y=b.exec(g))&&(r+=v(parseInt(y[1],16).toString(8),3));null!==(y=b.exec(g));)r+="\\"+v(parseInt(y[1],16).toString(8),3)}else r+=a;else r+=a;return r}},9752:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.is_scalar=function(e){return/boolean|number|string/.test(typeof e)}},656:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.range=function(e,t){let r=[];for(let n=e;n<=t;n++)r.push(n);return r}},5152:function(e){var t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};e.exports=function(e){switch(void 0===e?"undefined":t(e)){case"boolean":return e?"1":"";case"string":return e;case"number":return isNaN(e)?"NAN":isFinite(e)?e+"":(e<0?"-":"")+"INF";case"undefined":return"";case"object":return Array.isArray(e)?"Array":null!==e?"Object":"";default:throw new Error("Unsupported value type")}}},1315:function(e){e.exports=function(e){var t={},r=arguments.length,n=r-1,i="",s={},a=0,o="";e:for(i in e)t:for(a=1;a9?-1:0)},Y:function(){return r.getFullYear()},y:function(){return n.Y().toString().slice(-2)},a:function(){return r.getHours()>11?"pm":"am"},A:function(){return n.a().toUpperCase()},B:function(){var e=3600*r.getUTCHours(),t=60*r.getUTCMinutes(),n=r.getUTCSeconds();return o(Math.floor((e+t+n+3600)/86.4)%1e3,3)},g:function(){return n.G()%12||12},G:function(){return r.getHours()},h:function(){return o(n.g(),2)},H:function(){return o(n.G(),2)},i:function(){return o(r.getMinutes(),2)},s:function(){return o(r.getSeconds(),2)},u:function(){return o(1e3*r.getMilliseconds(),6)},e:function(){throw new Error("Not supported (see source code of date() for timezone on how to add support)")},I:function(){return new Date(n.Y(),0)-Date.UTC(n.Y(),0)!=new Date(n.Y(),6)-Date.UTC(n.Y(),6)?1:0},O:function(){var e=r.getTimezoneOffset(),t=Math.abs(e);return(e>0?"-":"+")+o(100*Math.floor(t/60)+t%60,4)},P:function(){var e=n.O();return e.substr(0,3)+":"+e.substr(3,2)},T:function(){return"UTC"},Z:function(){return 60*-r.getTimezoneOffset()},c:function(){return"Y-m-d\\TH:i:sP".replace(s,a)},r:function(){return"D, d M Y H:i:s O".replace(s,a)},U:function(){return r/1e3|0}},function(e,t){return r=void 0===t?new Date:t instanceof Date?new Date(t):new Date(1e3*t),e.replace(s,a)}(e,t)}},5455:function(e){var t="[ \\t]+",r="[ \\t]*",n="(?:([ap])\\.?m\\.?([\\t ]|$))",i="(2[0-4]|[01]?[0-9])",s="([01][0-9]|2[0-4])",a="(0?[1-9]|1[0-2])",o="([0-5]?[0-9])",u="([0-5][0-9])",l="(60|[0-5]?[0-9])",c="(60|[0-5][0-9])",h="(?:\\.([0-9]+))",f="sunday|monday|tuesday|wednesday|thursday|friday|saturday",d="sun|mon|tue|wed|thu|fri|sat",p=f+"|"+d+"|weekdays?",m="first|second|third|fourth|fifth|sixth|seventh|eighth?|ninth|tenth|eleventh|twelfth",y="next|last|previous|this",g="(?:second|sec|minute|min|hour|day|fortnight|forthnight|month|year)s?|weeks|"+p,b="([0-9]{1,4})",v="([0-9]{4})",w="(1[0-2]|0?[0-9])",x="(0[0-9]|1[0-2])",k="(?:(3[01]|[0-2]?[0-9])(?:st|nd|rd|th)?)",T="(0[0-9]|[1-2][0-9]|3[01])",E="january|february|march|april|may|june|july|august|september|october|november|december",O="jan|feb|mar|apr|may|jun|jul|aug|sept?|oct|nov|dec",_="("+E+"|"+O+"|i[vx]|vi{0,3}|xi{0,2}|i{1,3})",A="((?:GMT)?([+-])"+i+":?"+o+"?)",N=_+"[ .\\t-]*"+k+"[,.stndrh\\t ]*";function P(e,t){switch(t=t&&t.toLowerCase()){case"a":e+=12===e?-12:0;break;case"p":e+=12!==e?12:0}return e}function S(e){var t=+e;return e.length<4&&t<100&&(t+=t<70?2e3:1900),t}function j(e){return{jan:0,january:0,i:0,feb:1,february:1,ii:1,mar:2,march:2,iii:2,apr:3,april:3,iv:3,may:4,v:4,jun:5,june:5,vi:5,jul:6,july:6,vii:6,aug:7,august:7,viii:7,sep:8,sept:8,september:8,ix:8,oct:9,october:9,x:9,nov:10,november:10,xi:10,dec:11,december:11,xii:11}[e.toLowerCase()]}function R(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{mon:1,monday:1,tue:2,tuesday:2,wed:3,wednesday:3,thu:4,thursday:4,fri:5,friday:5,sat:6,saturday:6,sun:0,sunday:0}[e.toLowerCase()]||t}function M(e,t){if(!(e=e&&e.match(/(?:GMT)?([+-])(\d+)(:?)(\d{0,2})/i)))return t;var r="-"===e[1]?-1:1,n=+e[2],i=+e[4];return e[4]||e[3]||(i=Math.floor(n%100),n=Math.floor(n/100)),r*(60*n+i)*60}var C={acdt:37800,acst:34200,addt:-7200,adt:-10800,aedt:39600,aest:36e3,ahdt:-32400,ahst:-36e3,akdt:-28800,akst:-32400,amt:-13840,apt:-10800,ast:-14400,awdt:32400,awst:28800,awt:-10800,bdst:7200,bdt:-36e3,bmt:-14309,bst:3600,cast:34200,cat:7200,cddt:-14400,cdt:-18e3,cemt:10800,cest:7200,cet:3600,cmt:-15408,cpt:-18e3,cst:-21600,cwt:-18e3,chst:36e3,dmt:-1521,eat:10800,eddt:-10800,edt:-14400,eest:10800,eet:7200,emt:-26248,ept:-14400,est:-18e3,ewt:-14400,ffmt:-14660,fmt:-4056,gdt:39600,gmt:0,gst:36e3,hdt:-34200,hkst:32400,hkt:28800,hmt:-19776,hpt:-34200,hst:-36e3,hwt:-34200,iddt:14400,idt:10800,imt:25025,ist:7200,jdt:36e3,jmt:8440,jst:32400,kdt:36e3,kmt:5736,kst:30600,lst:9394,mddt:-18e3,mdst:16279,mdt:-21600,mest:7200,met:3600,mmt:9017,mpt:-21600,msd:14400,msk:10800,mst:-25200,mwt:-21600,nddt:-5400,ndt:-9052,npt:-9e3,nst:-12600,nwt:-9e3,nzdt:46800,nzmt:41400,nzst:43200,pddt:-21600,pdt:-25200,pkst:21600,pkt:18e3,plmt:25590,pmt:-13236,ppmt:-17340,ppt:-25200,pst:-28800,pwt:-25200,qmt:-18840,rmt:5794,sast:7200,sdmt:-16800,sjmt:-20173,smt:-13884,sst:-39600,tbmt:10751,tmt:12344,uct:0,utc:0,wast:7200,wat:3600,wemt:7200,west:3600,wet:0,wib:25200,wita:28800,wit:32400,wmt:5040,yddt:-25200,ydt:-28800,ypt:-28800,yst:-32400,ywt:-28800,a:3600,b:7200,c:10800,d:14400,e:18e3,f:21600,g:25200,h:28800,i:32400,k:36e3,l:39600,m:43200,n:-3600,o:-7200,p:-10800,q:-14400,r:-18e3,s:-21600,t:-25200,u:-28800,v:-32400,w:-36e3,x:-39600,y:-43200,z:0},U={yesterday:{regex:/^yesterday/i,name:"yesterday",callback:function(){return this.rd-=1,this.resetTime()}},now:{regex:/^now/i,name:"now"},noon:{regex:/^noon/i,name:"noon",callback:function(){return this.resetTime()&&this.time(12,0,0,0)}},midnightOrToday:{regex:/^(midnight|today)/i,name:"midnight | today",callback:function(){return this.resetTime()}},tomorrow:{regex:/^tomorrow/i,name:"tomorrow",callback:function(){return this.rd+=1,this.resetTime()}},timestamp:{regex:/^@(-?\d+)/i,name:"timestamp",callback:function(e,t){return this.rs+=+t,this.y=1970,this.m=0,this.d=1,this.dates=0,this.resetTime()&&this.zone(0)}},firstOrLastDay:{regex:/^(first|last) day of/i,name:"firstdayof | lastdayof",callback:function(e,t){"first"===t.toLowerCase()?this.firstOrLastDayOfMonth=1:this.firstOrLastDayOfMonth=-1}},backOrFrontOf:{regex:RegExp("^(back|front) of "+i+r+n+"?","i"),name:"backof | frontof",callback:function(e,t,r,n){var i=+r,s=15;return"back"===t.toLowerCase()||(i-=1,s=45),i=P(i,n),this.resetTime()&&this.time(i,s,0,0)}},weekdayOf:{regex:RegExp("^("+m+"|"+y+")"+t+"("+f+"|"+d+")"+t+"of","i"),name:"weekdayof"},mssqltime:{regex:RegExp("^"+a+":"+u+":"+c+"[:.]([0-9]+)"+n,"i"),name:"mssqltime",callback:function(e,t,r,n,i,s){return this.time(P(+t,s),+r,+n,+i.substr(0,3))}},timeLong12:{regex:RegExp("^"+a+"[:.]"+o+"[:.]"+c+r+n,"i"),name:"timelong12",callback:function(e,t,r,n,i){return this.time(P(+t,i),+r,+n,0)}},timeShort12:{regex:RegExp("^"+a+"[:.]"+u+r+n,"i"),name:"timeshort12",callback:function(e,t,r,n){return this.time(P(+t,n),+r,0,0)}},timeTiny12:{regex:RegExp("^"+a+r+n,"i"),name:"timetiny12",callback:function(e,t,r){return this.time(P(+t,r),0,0,0)}},soap:{regex:RegExp("^"+v+"-"+x+"-"+T+"T"+s+":"+u+":"+c+h+A+"?","i"),name:"soap",callback:function(e,t,r,n,i,s,a,o,u){return this.ymd(+t,r-1,+n)&&this.time(+i,+s,+a,+o.substr(0,3))&&this.zone(M(u))}},wddx:{regex:RegExp("^"+v+"-"+w+"-"+k+"T"+i+":"+o+":"+l),name:"wddx",callback:function(e,t,r,n,i,s,a){return this.ymd(+t,r-1,+n)&&this.time(+i,+s,+a,0)}},exif:{regex:RegExp("^"+v+":"+x+":"+T+" "+s+":"+u+":"+c,"i"),name:"exif",callback:function(e,t,r,n,i,s,a){return this.ymd(+t,r-1,+n)&&this.time(+i,+s,+a,0)}},xmlRpc:{regex:RegExp("^"+v+x+T+"T"+i+":"+u+":"+c),name:"xmlrpc",callback:function(e,t,r,n,i,s,a){return this.ymd(+t,r-1,+n)&&this.time(+i,+s,+a,0)}},xmlRpcNoColon:{regex:RegExp("^"+v+x+T+"[Tt]"+i+u+c),name:"xmlrpcnocolon",callback:function(e,t,r,n,i,s,a){return this.ymd(+t,r-1,+n)&&this.time(+i,+s,+a,0)}},clf:{regex:RegExp("^"+k+"/("+O+")/"+v+":"+s+":"+u+":"+c+t+A,"i"),name:"clf",callback:function(e,t,r,n,i,s,a,o){return this.ymd(+n,j(r),+t)&&this.time(+i,+s,+a,0)&&this.zone(M(o))}},iso8601long:{regex:RegExp("^t?"+i+"[:.]"+o+"[:.]"+l+h,"i"),name:"iso8601long",callback:function(e,t,r,n,i){return this.time(+t,+r,+n,+i.substr(0,3))}},dateTextual:{regex:RegExp("^"+_+"[ .\\t-]*"+k+"[,.stndrh\\t ]+"+b,"i"),name:"datetextual",callback:function(e,t,r,n){return this.ymd(S(n),j(t),+r)}},pointedDate4:{regex:RegExp("^"+k+"[.\\t-]"+w+"[.-]"+v),name:"pointeddate4",callback:function(e,t,r,n){return this.ymd(+n,r-1,+t)}},pointedDate2:{regex:RegExp("^"+k+"[.\\t]"+w+"\\.([0-9]{2})"),name:"pointeddate2",callback:function(e,t,r,n){return this.ymd(S(n),r-1,+t)}},timeLong24:{regex:RegExp("^t?"+i+"[:.]"+o+"[:.]"+l),name:"timelong24",callback:function(e,t,r,n){return this.time(+t,+r,+n,0)}},dateNoColon:{regex:RegExp("^"+v+x+T),name:"datenocolon",callback:function(e,t,r,n){return this.ymd(+t,r-1,+n)}},pgydotd:{regex:RegExp("^"+v+"\\.?(00[1-9]|0[1-9][0-9]|[12][0-9][0-9]|3[0-5][0-9]|36[0-6])"),name:"pgydotd",callback:function(e,t,r){return this.ymd(+t,0,+r)}},timeShort24:{regex:RegExp("^t?"+i+"[:.]"+o,"i"),name:"timeshort24",callback:function(e,t,r){return this.time(+t,+r,0,0)}},iso8601noColon:{regex:RegExp("^t?"+s+u+c,"i"),name:"iso8601nocolon",callback:function(e,t,r,n){return this.time(+t,+r,+n,0)}},iso8601dateSlash:{regex:RegExp("^"+v+"/"+x+"/"+T+"/"),name:"iso8601dateslash",callback:function(e,t,r,n){return this.ymd(+t,r-1,+n)}},dateSlash:{regex:RegExp("^"+v+"/"+w+"/"+k),name:"dateslash",callback:function(e,t,r,n){return this.ymd(+t,r-1,+n)}},american:{regex:RegExp("^"+w+"/"+k+"/"+b),name:"american",callback:function(e,t,r,n){return this.ymd(S(n),t-1,+r)}},americanShort:{regex:RegExp("^"+w+"/"+k),name:"americanshort",callback:function(e,t,r){return this.ymd(this.y,t-1,+r)}},gnuDateShortOrIso8601date2:{regex:RegExp("^"+b+"-"+w+"-"+k),name:"gnudateshort | iso8601date2",callback:function(e,t,r,n){return this.ymd(S(t),r-1,+n)}},iso8601date4:{regex:RegExp("^([+-]?[0-9]{4})-"+x+"-"+T),name:"iso8601date4",callback:function(e,t,r,n){return this.ymd(+t,r-1,+n)}},gnuNoColon:{regex:RegExp("^t?"+s+u,"i"),name:"gnunocolon",callback:function(e,t,r){switch(this.times){case 0:return this.time(+t,+r,0,this.f);case 1:return this.y=100*t+ +r,this.times++,!0;default:return!1}}},gnuDateShorter:{regex:RegExp("^"+v+"-"+w),name:"gnudateshorter",callback:function(e,t,r){return this.ymd(+t,r-1,1)}},pgTextReverse:{regex:RegExp("^(\\d{3,4}|[4-9]\\d|3[2-9])-("+O+")-"+T,"i"),name:"pgtextreverse",callback:function(e,t,r,n){return this.ymd(S(t),j(r),+n)}},dateFull:{regex:RegExp("^"+k+"[ \\t.-]*"+_+"[ \\t.-]*"+b,"i"),name:"datefull",callback:function(e,t,r,n){return this.ymd(S(n),j(r),+t)}},dateNoDay:{regex:RegExp("^"+_+"[ .\\t-]*"+v,"i"),name:"datenoday",callback:function(e,t,r){return this.ymd(+r,j(t),1)}},dateNoDayRev:{regex:RegExp("^"+v+"[ .\\t-]*"+_,"i"),name:"datenodayrev",callback:function(e,t,r){return this.ymd(+t,j(r),1)}},pgTextShort:{regex:RegExp("^("+O+")-"+T+"-"+b,"i"),name:"pgtextshort",callback:function(e,t,r,n){return this.ymd(S(n),j(t),+r)}},dateNoYear:{regex:RegExp("^"+N,"i"),name:"datenoyear",callback:function(e,t,r){return this.ymd(this.y,j(t),+r)}},dateNoYearRev:{regex:RegExp("^"+k+"[ .\\t-]*"+_,"i"),name:"datenoyearrev",callback:function(e,t,r){return this.ymd(this.y,j(r),+t)}},isoWeekDay:{regex:RegExp("^"+v+"-?W(0[1-9]|[1-4][0-9]|5[0-3])(?:-?([0-7]))?"),name:"isoweekday | isoweek",callback:function(e,t,r,n){if(n=n?+n:1,!this.ymd(+t,0,1))return!1;var i=new Date(this.y,this.m,this.d).getDay();i=0-(i>4?i-7:i),this.rd+=i+7*(r-1)+n}},relativeText:{regex:RegExp("^("+m+"|"+y+")"+t+"("+g+")","i"),name:"relativetext",callback:function(e,t,r){var n,i={amount:{last:-1,previous:-1,this:0,first:1,next:1,second:2,third:3,fourth:4,fifth:5,sixth:6,seventh:7,eight:8,eighth:8,ninth:9,tenth:10,eleventh:11,twelfth:12}[n=t.toLowerCase()],behavior:{this:1}[n]||0}.amount;switch(r.toLowerCase()){case"sec":case"secs":case"second":case"seconds":this.rs+=i;break;case"min":case"mins":case"minute":case"minutes":this.ri+=i;break;case"hour":case"hours":this.rh+=i;break;case"day":case"days":this.rd+=i;break;case"fortnight":case"fortnights":case"forthnight":case"forthnights":this.rd+=14*i;break;case"week":case"weeks":this.rd+=7*i;break;case"month":case"months":this.rm+=i;break;case"year":case"years":this.ry+=i;break;case"mon":case"monday":case"tue":case"tuesday":case"wed":case"wednesday":case"thu":case"thursday":case"fri":case"friday":case"sat":case"saturday":case"sun":case"sunday":this.resetTime(),this.weekday=R(r,7),this.weekdayBehavior=1,this.rd+=7*(i>0?i-1:i)}}},relative:{regex:RegExp("^([+-]*)[ \\t]*(\\d+)"+r+"("+g+"|week)","i"),name:"relative",callback:function(e,t,r,n){var i=t.replace(/[^-]/g,"").length,s=+r*Math.pow(-1,i);switch(n.toLowerCase()){case"sec":case"secs":case"second":case"seconds":this.rs+=s;break;case"min":case"mins":case"minute":case"minutes":this.ri+=s;break;case"hour":case"hours":this.rh+=s;break;case"day":case"days":this.rd+=s;break;case"fortnight":case"fortnights":case"forthnight":case"forthnights":this.rd+=14*s;break;case"week":case"weeks":this.rd+=7*s;break;case"month":case"months":this.rm+=s;break;case"year":case"years":this.ry+=s;break;case"mon":case"monday":case"tue":case"tuesday":case"wed":case"wednesday":case"thu":case"thursday":case"fri":case"friday":case"sat":case"saturday":case"sun":case"sunday":this.resetTime(),this.weekday=R(n,7),this.weekdayBehavior=1,this.rd+=7*(s>0?s-1:s)}}},dayText:{regex:RegExp("^("+p+")","i"),name:"daytext",callback:function(e,t){this.resetTime(),this.weekday=R(t,0),2!==this.weekdayBehavior&&(this.weekdayBehavior=1)}},relativeTextWeek:{regex:RegExp("^("+y+")"+t+"week","i"),name:"relativetextweek",callback:function(e,t){switch(this.weekdayBehavior=2,t.toLowerCase()){case"this":this.rd+=0;break;case"next":this.rd+=7;break;case"last":case"previous":this.rd-=7}isNaN(this.weekday)&&(this.weekday=1)}},monthFullOrMonthAbbr:{regex:RegExp("^("+E+"|"+O+")","i"),name:"monthfull | monthabbr",callback:function(e,t){return this.ymd(this.y,j(t),this.d)}},tzCorrection:{regex:RegExp("^"+A,"i"),name:"tzcorrection",callback:function(e){return this.zone(M(e))}},tzAbbr:{regex:RegExp("^\\(?([a-zA-Z]{1,6})\\)?"),name:"tzabbr",callback:function(e,t){var r=C[t.toLowerCase()];return!isNaN(r)&&this.zone(r)}},ago:{regex:/^ago/i,name:"ago",callback:function(){this.ry=-this.ry,this.rm=-this.rm,this.rd=-this.rd,this.rh=-this.rh,this.ri=-this.ri,this.rs=-this.rs,this.rf=-this.rf}},year4:{regex:RegExp("^"+v),name:"year4",callback:function(e,t){return this.y=+t,!0}},whitespace:{regex:/^[ .,\t]+/,name:"whitespace"},dateShortWithTimeLong:{regex:RegExp("^"+N+"t?"+i+"[:.]"+o+"[:.]"+l,"i"),name:"dateshortwithtimelong",callback:function(e,t,r,n,i,s){return this.ymd(this.y,j(t),+r)&&this.time(+n,+i,+s,0)}},dateShortWithTimeLong12:{regex:RegExp("^"+N+a+"[:.]"+o+"[:.]"+c+r+n,"i"),name:"dateshortwithtimelong12",callback:function(e,t,r,n,i,s,a){return this.ymd(this.y,j(t),+r)&&this.time(P(+n,a),+i,+s,0)}},dateShortWithTimeShort:{regex:RegExp("^"+N+"t?"+i+"[:.]"+o,"i"),name:"dateshortwithtimeshort",callback:function(e,t,r,n,i){return this.ymd(this.y,j(t),+r)&&this.time(+n,+i,0,0)}},dateShortWithTimeShort12:{regex:RegExp("^"+N+a+"[:.]"+u+r+n,"i"),name:"dateshortwithtimeshort12",callback:function(e,t,r,n,i,s){return this.ymd(this.y,j(t),+r)&&this.time(P(+n,s),+i,0,0)}}},L={y:NaN,m:NaN,d:NaN,h:NaN,i:NaN,s:NaN,f:NaN,ry:0,rm:0,rd:0,rh:0,ri:0,rs:0,rf:0,weekday:NaN,weekdayBehavior:0,firstOrLastDayOfMonth:0,z:NaN,dates:0,times:0,zones:0,ymd:function(e,t,r){return!(this.dates>0||(this.dates++,this.y=e,this.m=t,this.d=r,0))},time:function(e,t,r,n){return!(this.times>0||(this.times++,this.h=e,this.i=t,this.s=r,this.f=n,0))},resetTime:function(){return this.h=0,this.i=0,this.s=0,this.f=0,this.times=0,!0},zone:function(e){return this.zones<=1&&(this.zones++,this.z=e,!0)},toDate:function(e){switch(this.dates&&!this.times&&(this.h=this.i=this.s=this.f=0),isNaN(this.y)&&(this.y=e.getFullYear()),isNaN(this.m)&&(this.m=e.getMonth()),isNaN(this.d)&&(this.d=e.getDate()),isNaN(this.h)&&(this.h=e.getHours()),isNaN(this.i)&&(this.i=e.getMinutes()),isNaN(this.s)&&(this.s=e.getSeconds()),isNaN(this.f)&&(this.f=e.getMilliseconds()),this.firstOrLastDayOfMonth){case 1:this.d=1;break;case-1:this.d=0,this.m+=1}if(!isNaN(this.weekday)){var t=new Date(e.getTime());t.setFullYear(this.y,this.m,this.d),t.setHours(this.h,this.i,this.s,this.f);var r=t.getDay();if(2===this.weekdayBehavior)0===r&&0!==this.weekday&&(this.weekday=-6),0===this.weekday&&0!==r&&(this.weekday=7),this.d-=r,this.d+=this.weekday;else{var n=this.weekday-r;(this.rd<0&&n<0||this.rd>=0&&n<=-this.weekdayBehavior)&&(n+=7),this.weekday>=0?this.d+=n:this.d-=7-(Math.abs(this.weekday)-r),this.weekday=NaN}}this.y+=this.ry,this.m+=this.rm,this.d+=this.rd,this.h+=this.rh,this.i+=this.ri,this.s+=this.rs,this.f+=this.rf,this.ry=this.rm=this.rd=0,this.rh=this.ri=this.rs=this.rf=0;var i=new Date(e.getTime());switch(i.setFullYear(this.y,this.m,this.d),i.setHours(this.h,this.i,this.s,this.f),this.firstOrLastDayOfMonth){case 1:i.setDate(1);break;case-1:i.setMonth(i.getMonth()+1,0)}return isNaN(this.z)||i.getTimezoneOffset()===this.z||(i.setUTCFullYear(i.getFullYear(),i.getMonth(),i.getDate()),i.setUTCHours(i.getHours(),i.getMinutes(),i.getSeconds()-this.z,i.getMilliseconds())),i}};e.exports=function(e,t){null==t&&(t=Math.floor(Date.now()/1e3));for(var r=[U.yesterday,U.now,U.noon,U.midnightOrToday,U.tomorrow,U.timestamp,U.firstOrLastDay,U.backOrFrontOf,U.timeTiny12,U.timeShort12,U.timeLong12,U.mssqltime,U.timeShort24,U.timeLong24,U.iso8601long,U.gnuNoColon,U.iso8601noColon,U.americanShort,U.american,U.iso8601date4,U.iso8601dateSlash,U.dateSlash,U.gnuDateShortOrIso8601date2,U.gnuDateShorter,U.dateFull,U.pointedDate4,U.pointedDate2,U.dateNoDay,U.dateNoDayRev,U.dateTextual,U.dateNoYear,U.dateNoYearRev,U.dateNoColon,U.xmlRpc,U.xmlRpcNoColon,U.soap,U.wddx,U.exif,U.pgydotd,U.isoWeekDay,U.pgTextShort,U.pgTextReverse,U.clf,U.year4,U.ago,U.dayText,U.relativeTextWeek,U.relativeText,U.monthFullOrMonthAbbr,U.tzCorrection,U.tzAbbr,U.dateShortWithTimeShort12,U.dateShortWithTimeLong12,U.dateShortWithTimeShort,U.dateShortWithTimeLong,U.relative,U.whitespace],n=Object.create(L);e.length;){for(var i=null,s=null,a=0,o=r.length;ai[0].length)&&(i=l,s=u)}if(!s||s.callback&&!1===s.callback.apply(n,i))return!1;e=e.substr(i[0].length),s=null,i=null}return Math.floor(n.toDate(new Date(1e3*t))/1e3)}},9655:function(e,t,r){e.exports=function(e){var t="undefined"!=typeof window?window:r.g;t.$locutus=t.$locutus||{};var n=t.$locutus;return n.php=n.php||{},n.php.ini=n.php.ini||{},n.php.ini[e]&&void 0!==n.php.ini[e].local_value?null===n.php.ini[e].local_value?"":n.php.ini[e].local_value:""}},7760:function(e){var t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};e.exports=function(e,r,n){if(arguments.length<2||void 0===e||void 0===r)return null;if(""===e||!1===e||null===e)return!1;if("function"==typeof e||"object"===(void 0===e?"undefined":t(e))||"function"==typeof r||"object"===(void 0===r?"undefined":t(r)))return{0:""};!0===e&&(e="1");var i=(r+="").split(e+="");return void 0===n?i:(0===n&&(n=1),n>0?n>=i.length?i:i.slice(0,n-1).concat([i.slice(n-1).join(e)]):-n>=i.length?[]:(i.splice(i.length+n),i))}},451:function(e){var t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};e.exports=function(e,r){var n="",i="",s="";if(1===arguments.length&&(r=e,e=""),"object"===(void 0===r?"undefined":t(r))){if("[object Array]"===Object.prototype.toString.call(r))return r.join(e);for(n in r)i+=s+r[n],s=e;return i}return r}},3369:function(e){e.exports=function(e,t,r){var n;return-1!==(n=(e+="").toLowerCase().indexOf((t+"").toLowerCase()))&&(r?e.substr(0,n):e.slice(n))}},3061:function(e,t,r){e.exports=function(e){var t=e+"";if("off"===(r(9655)("unicode.semantics")||"off"))return t.length;var n=0,i=0,s=function(e,t){var r=e.charCodeAt(t),n="",i="";if(r>=55296&&r<=56319){if(e.length<=t+1)throw new Error("High surrogate without following low surrogate");if((n=e.charCodeAt(t+1))<56320||n>57343)throw new Error("High surrogate without following low surrogate");return e.charAt(t)+e.charAt(t+1)}if(r>=56320&&r<=57343){if(0===t)throw new Error("Low surrogate without preceding high surrogate");if((i=e.charCodeAt(t-1))<55296||i>56319)throw new Error("Low surrogate without preceding high surrogate");return!1}return e.charAt(t)};for(n=0,i=0;ns||t<0||t>a)&&(i?e.slice(t,a).join(""):e.slice(t,a))}}},u={};function l(e){var t=u[e];if(void 0!==t)return t.exports;var r=u[e]={exports:{}};return o[e](r,r.exports,l),r.exports}l.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),e=l(5825),t=function(e,t,r,n){return new(r||(r=Promise))((function(i,s){function a(e){try{u(n.next(e))}catch(e){s(e)}}function o(e){try{u(n.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,o)}u((n=n.apply(e,t||[])).next())}))},r=function(e,t){var r,n,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(u){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&e.addedNodes.forEach((function(e){if(e instanceof HTMLElement){var t=e.querySelector("input[data-calculations]");t&&a(t)}}))}))})).observe(document.body,{childList:!0,subtree:!0})}(); \ No newline at end of file diff --git a/packages/plugin/src/Services/SubmissionsService.php b/packages/plugin/src/Services/SubmissionsService.php index 6b09b5b69..588893d37 100644 --- a/packages/plugin/src/Services/SubmissionsService.php +++ b/packages/plugin/src/Services/SubmissionsService.php @@ -33,6 +33,7 @@ use Solspace\Freeform\Freeform; use Solspace\Freeform\Library\Database\SubmissionHandlerInterface; use Solspace\Freeform\Library\Helpers\PermissionHelper; +use Solspace\Freeform\Records\FormRecord; use Twig\Markup; use yii\base\Event; @@ -117,6 +118,16 @@ public function getSubmissionCount(?array $formIds = null, ?array $statusIds = n */ public function getSubmissionCountByForm(bool $isSpam = false, ?Carbon $rangeStart = null, ?Carbon $rangeEnd = null): array { + $isSpamFolderEnabled = $this->getSettingsService()->isSpamFolderEnabled(); + if ($isSpam && !$isSpamFolderEnabled) { + return (new Query()) + ->select('spamBlockCount') + ->from(FormRecord::TABLE) + ->indexBy('id') + ->column() + ; + } + $submissions = Submission::TABLE; $query = (new Query()) ->select(["COUNT({$submissions}.[[id]]) as [[submissionCount]]"]) @@ -398,11 +409,13 @@ public function purgeSubmissions(?int $age = null): array $assetIds = array_unique($assetIds); foreach ($assetIds as $assetId) { - \Craft::$app->elements->deleteElementById( - $assetId, - hardDelete: true, - ); - ++$deletedAssets; + if (\is_int($assetId)) { + \Craft::$app->elements->deleteElementById( + $assetId, + hardDelete: true, + ); + ++$deletedAssets; + } } } diff --git a/packages/plugin/src/Tests/Attributes/Property/PropertyTypes/Table/TableTransformerTest.php b/packages/plugin/src/Tests/Attributes/Property/PropertyTypes/Table/TableTransformerTest.php index 189f0a5d0..cfebe8b3c 100644 --- a/packages/plugin/src/Tests/Attributes/Property/PropertyTypes/Table/TableTransformerTest.php +++ b/packages/plugin/src/Tests/Attributes/Property/PropertyTypes/Table/TableTransformerTest.php @@ -46,9 +46,9 @@ public function testReverseTransform() $output = (new TableTransformer())->reverseTransform($value); $expected = [ - ['label' => 'Col 1', 'value' => 'one', 'type' => 'string'], - ['label' => 'Col 2', 'value' => 'two', 'type' => 'checkbox'], - ['label' => 'Col 3', 'value' => 'three;four;five', 'type' => 'select'], + ['label' => 'Col 1', 'value' => 'one', 'type' => 'string', 'placeholder' => '', 'options' => [], 'checked' => false], + ['label' => 'Col 2', 'value' => 'two', 'type' => 'checkbox', 'placeholder' => '', 'options' => [], 'checked' => false], + ['label' => 'Col 3', 'value' => 'three;four;five', 'type' => 'select', 'placeholder' => '', 'options' => [], 'checked' => false], ]; $this->assertEquals($expected, $output); diff --git a/packages/plugin/src/controllers/FormsController.php b/packages/plugin/src/controllers/FormsController.php index f59bfbc9f..644298bbc 100644 --- a/packages/plugin/src/controllers/FormsController.php +++ b/packages/plugin/src/controllers/FormsController.php @@ -37,7 +37,7 @@ public function actionIndex(): Response { PermissionHelper::requirePermission(Freeform::PERMISSION_FORMS_ACCESS); - $translations = include __DIR__.'/../translations/en-US/freeform.php'; + $translations = include __DIR__.'/../translations/en/freeform.php'; $translations = array_keys($translations); $this->view->registerAssetBundle(FreeformClientBundle::class); diff --git a/packages/plugin/src/controllers/api/forms/ElementsController.php b/packages/plugin/src/controllers/api/forms/ElementsController.php index 87cd143d4..10c73dc58 100644 --- a/packages/plugin/src/controllers/api/forms/ElementsController.php +++ b/packages/plugin/src/controllers/api/forms/ElementsController.php @@ -40,14 +40,19 @@ public function actionGet(int $id): Response $conditions = ['or']; foreach ($fieldUids as $uuid) { - $conditions[] = new Expression( - match ($driver) { - 'mysql' => "JSON_UNQUOTE(JSON_EXTRACT([[es.content]], '$.\"{$uuid}\"')) = :formId", - 'pgsql' => '[[es.content]]->>:uuid = :formId', - default => throw new \RuntimeException("Unsupported driver: {$driver}"), - }, - [':uuid' => $uuid, ':formId' => $id] - ); + if ('mysql' === $driver) { + $conditions[] = new Expression( + "JSON_UNQUOTE(JSON_EXTRACT([[es.content]], '$.\"{$uuid}\"')) = :formId", + [':formId' => $id] + ); + } elseif ('pgsql' === $driver) { + $conditions[] = new Expression( + '[[es.content]]->>:uuid = :formId', + [':uuid' => $uuid, ':formId' => (string) $id] + ); + } else { + throw new \RuntimeException("Unsupported driver: {$driver}"); + } } $elementIds = (new Query()) @@ -71,6 +76,7 @@ public function actionGet(int $id): Response $elements[] = \Craft::$app->elements->getElementById($elementId, siteId: $site->id); } + $elements = array_filter($elements); $elements = array_map( fn (ElementInterface $element) => [ 'id' => $element->id, diff --git a/packages/plugin/src/controllers/export/QuickExportController.php b/packages/plugin/src/controllers/export/QuickExportController.php index b29277ead..bc90b08be 100644 --- a/packages/plugin/src/controllers/export/QuickExportController.php +++ b/packages/plugin/src/controllers/export/QuickExportController.php @@ -13,6 +13,7 @@ use Solspace\Freeform\Library\Helpers\JsonHelper; use Solspace\Freeform\Library\Helpers\PermissionHelper; use Solspace\Freeform\Records\Pro\ExportSettingRecord; +use Solspace\Freeform\Records\StatusRecord; use yii\base\Exception; use yii\base\InvalidConfigException; use yii\web\BadRequestHttpException; @@ -100,6 +101,10 @@ public function actionExportDialogue(): Response 'label' => 'IP Address', 'checked' => true, ]; + $fieldSetting['status'] = [ + 'label' => 'Status', + 'checked' => true, + ]; $fieldSetting['dateCreated'] = [ 'label' => 'Date Created', 'checked' => true, @@ -229,6 +234,7 @@ public function actionIndex() $fieldName = $fieldId; $fieldName = match ($fieldName) { 'title' => $isCraft5 ? 'es.[[title]]' : 'c.[['.$fieldName.']]', + 'status' => 'stat.[[name]] as status', 'cc_status' => 'p.[[status]] as cc_status', 'cc_amount' => 'p.[[amount]] as cc_amount', 'cc_currency' => 'p.[[currency]] as cc_currency', @@ -244,6 +250,7 @@ public function actionIndex() ->select($searchableFields) ->from(Submission::TABLE.' s') ->innerJoin(Submission::getContentTableName($form).' sc', 'sc.[[id]] = s.[[id]]') + ->innerJoin(StatusRecord::TABLE.' stat', 'stat.[[id]] = s.[[statusId]]') ->where(['s.[[formId]]' => $form->getId()]) ->andWhere(['s.[[isSpam]]' => $isSpam]) ; diff --git a/packages/plugin/src/migrations/m241104_091432_AddOptionsToIntegrationFields.php b/packages/plugin/src/migrations/m241104_091432_AddOptionsToIntegrationFields.php index da153127e..4cb4adf6e 100644 --- a/packages/plugin/src/migrations/m241104_091432_AddOptionsToIntegrationFields.php +++ b/packages/plugin/src/migrations/m241104_091432_AddOptionsToIntegrationFields.php @@ -8,6 +8,10 @@ class m241104_091432_AddOptionsToIntegrationFields extends Migration { public function safeUp(): bool { + if ($this->db->columnExists('{{%freeform_crm_fields}}', 'options')) { + return true; + } + $this->addColumn( '{{%freeform_crm_fields}}', 'options', @@ -25,6 +29,10 @@ public function safeUp(): bool public function safeDown(): bool { + if (!$this->db->columnExists('{{%freeform_crm_fields}}', 'options')) { + return true; + } + $this->dropColumn('{{%freeform_crm_fields}}', 'options'); $this->dropColumn('{{%freeform_email_marketing_fields}}', 'options'); diff --git a/packages/plugin/src/migrations/m241210_054218_AddOptionColumnFixForIntegrations.php b/packages/plugin/src/migrations/m241210_054218_AddOptionColumnFixForIntegrations.php new file mode 100644 index 000000000..6be507657 --- /dev/null +++ b/packages/plugin/src/migrations/m241210_054218_AddOptionColumnFixForIntegrations.php @@ -0,0 +1,41 @@ +db->columnExists('{{%freeform_crm_fields}}', 'options')) { + return true; + } + + $this->addColumn( + '{{%freeform_crm_fields}}', + 'options', + $this->json()->after('required') + ); + + $this->addColumn( + '{{%freeform_email_marketing_fields}}', + 'options', + $this->json()->after('required') + ); + + return true; + } + + public function safeDown(): bool + { + if (!$this->db->columnExists('{{%freeform_crm_fields}}', 'options')) { + return true; + } + + $this->dropColumn('{{%freeform_crm_fields}}', 'options'); + $this->dropColumn('{{%freeform_email_marketing_fields}}', 'options'); + + return true; + } +} diff --git a/packages/plugin/src/templates/submissions/edit.twig b/packages/plugin/src/templates/submissions/edit.twig index 5027f5d1f..cdb6378e9 100644 --- a/packages/plugin/src/templates/submissions/edit.twig +++ b/packages/plugin/src/templates/submissions/edit.twig @@ -11,7 +11,7 @@ {% set crumbs = crumbs|default([ { label: craft.freeform.name, url: url('freeform') }, { label: "Forms"|t("freeform"), url: url('freeform/forms') }, - { label: submission.form.name, url: url('freeform/forms/' ~ submission.getForm().id) }, + { label: form.name, url: url('freeform/forms/' ~ form.id) }, { label: "Submissions"|t('freeform'), url: url('freeform/submissions') }, ]) %} @@ -175,7 +175,7 @@ diff --git a/packages/plugin/src/translations/en-US/freeform.php b/packages/plugin/src/translations/en/freeform.php similarity index 100% rename from packages/plugin/src/translations/en-US/freeform.php rename to packages/plugin/src/translations/en/freeform.php diff --git a/packages/scripts/src/components/front-end/fields/calculation.ts b/packages/scripts/src/components/front-end/fields/calculation.ts index 426169c97..3afb48c87 100644 --- a/packages/scripts/src/components/front-end/fields/calculation.ts +++ b/packages/scripts/src/components/front-end/fields/calculation.ts @@ -4,9 +4,14 @@ import ExpressionLanguage from 'expression-language'; const getVariablesPattern = /field:([a-zA-Z0-9_]+)/g; const expressionLanguage = new ExpressionLanguage(); -const extractValue = (element: HTMLInputElement | HTMLSelectElement): string | number | boolean => { +const extractValue = (element: HTMLInputElement | HTMLSelectElement): string | number | boolean | null => { const value = element.value; + // Return null if the value is an empty string + if (value === '') { + return null; + } + if (element.type === 'number') { return Number(value); } @@ -28,7 +33,7 @@ const attachCalculations = (input: HTMLInputElement) => { // Get calculation logic & decimal count const calculationsLogic = calculations.replace(getVariablesPattern, (_, variable) => variable); - const decimalCount = decimal ?? Number(decimal); + const decimalCount = decimal ? Number(decimal) : null; // Get variables const variables: Record = {}; @@ -42,13 +47,13 @@ const attachCalculations = (input: HTMLInputElement) => { return; } - const isAllValuesFilled = Object.values(variables).every((value) => value !== ''); + const isAllValuesFilled = Object.values(variables).every((value) => value !== null && value !== ''); if (!isAllValuesFilled) { return; } let result = expressionLanguage.evaluate(calculationsLogic, variables); - result = decimalCount ? result.toFixed(decimalCount) : result; + result = decimalCount !== null ? result.toFixed(decimalCount) : result; const updateInputValue = (value: string | number) => { input.value = value.toString(); @@ -57,7 +62,6 @@ const attachCalculations = (input: HTMLInputElement) => { if (input.type !== 'hidden') { updateInputValue(result); - return; } @@ -72,42 +76,79 @@ const attachCalculations = (input: HTMLInputElement) => { }; Object.keys(variables).forEach((variable) => { - const inputElements = input.form.querySelectorAll(`input[name="${variable}"], select[name="${variable}"]`); + const inputElements = input.form.querySelectorAll( + `input[name="${variable}"], select[name="${variable}"]` + ); if (inputElements.length === 0) { return; } - const element = inputElements[0] as HTMLInputElement | HTMLSelectElement; + inputElements.forEach((element) => { + const updateVariables = () => { + if (element instanceof HTMLInputElement) { + if (element.type === 'radio' && !element.checked) { + return; + } + variables[variable] = extractValue(element); + } else if (element instanceof HTMLSelectElement) { + variables[variable] = extractValue(element); + } + }; + + const updateVariablesAndCalculate = () => { + updateVariables(); + handleCalculation(); + }; - const updateVariables = () => { - variables[variable] = extractValue(element); - }; + updateVariables(); // Initial update - const updateVariablesAndCalculate = () => { - updateVariables(); - handleCalculation(); - }; + if (element instanceof HTMLInputElement) { + if (element.type === 'radio') { + element.addEventListener('change', updateVariablesAndCalculate); + } else { + element.addEventListener('input', updateVariablesAndCalculate); + } + } else if (element instanceof HTMLSelectElement) { + element.addEventListener('change', updateVariablesAndCalculate); + } + }); + }); - updateVariables(); // Initial update + // Trigger initial calculation if all values are present + const areDefaultValuesSet = Object.keys(variables).every((variable) => { + const inputElements = input.form.querySelectorAll( + `input[name="${variable}"], select[name="${variable}"]` + ); - if (element instanceof HTMLInputElement) { - element.addEventListener('input', updateVariablesAndCalculate); - } else if (element instanceof HTMLSelectElement) { - element.addEventListener('change', updateVariablesAndCalculate); + if (inputElements.length === 0) { + return false; // No matching inputs found for the variable } - // Handling other input elements (if any) - if (inputElements.length > 1) { - inputElements.forEach((element) => { - if (element !== element && element instanceof HTMLInputElement) { - element.addEventListener('click', () => { - variables[variable] = extractValue(element); - handleCalculation(); - }); + let value: string | number | boolean | null = null; + + inputElements.forEach((element) => { + if (element instanceof HTMLInputElement) { + if (element.type === 'radio') { + if (element.checked) { + value = extractValue(element); + } + } else { + value = extractValue(element); } - }); - } + } else if (element instanceof HTMLSelectElement) { + value = extractValue(element); + } + }); + + variables[variable] = value; + + // Ensure the variable has a non-null, non-empty value + return value !== null && value !== ''; }); + + if (areDefaultValuesSet) { + handleCalculation(); + } }; const registerCalculationInputs = async (container: HTMLElement) => {