From fcdd933f7dd566075b01803c7b4fc0c68a4c3a96 Mon Sep 17 00:00:00 2001 From: mikesealey Date: Thu, 4 Jul 2024 16:47:08 +0100 Subject: [PATCH 1/5] updates Handlebar-Helper manifest for Lorem helper --- packages/string-templates/package.json | 2 +- packages/string-templates/src/manifest.json | 665 +++++--------------- 2 files changed, 143 insertions(+), 524 deletions(-) diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index ca7c7485cd..17f26604a3 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -26,7 +26,7 @@ "manifest": "ts-node ./scripts/gen-collection-info.ts" }, "dependencies": { - "@budibase/handlebars-helpers": "^0.13.1", + "@budibase/handlebars-helpers": "^0.13.2", "dayjs": "^1.10.8", "handlebars": "^4.7.8", "lodash.clonedeep": "^4.5.0" diff --git a/packages/string-templates/src/manifest.json b/packages/string-templates/src/manifest.json index dce4af8665..5387f1e746 100644 --- a/packages/string-templates/src/manifest.json +++ b/packages/string-templates/src/manifest.json @@ -1,144 +1,105 @@ { "math": { "abs": { - "args": [ - "a" - ], + "args": ["a"], "numArgs": 1, "example": "{{ abs 12012.1000 }} -> 12012.1", "description": "

Return the magnitude of a.

\n", "requiresBlock": false }, "add": { - "args": [ - "a", - "b" - ], + "args": ["a", "b"], "numArgs": 2, "example": "{{ add 1 2 }} -> 3", "description": "

Return the sum of a plus b.

\n", "requiresBlock": false }, "avg": { - "args": [ - "array" - ], + "args": ["array"], "numArgs": 1, "example": "{{ avg 1 2 3 4 5 }} -> 3", "description": "

Returns the average of all numbers in the given array.

\n", "requiresBlock": false }, "ceil": { - "args": [ - "value" - ], + "args": ["value"], "numArgs": 1, "example": "{{ ceil 1.2 }} -> 2", "description": "

Get the Math.ceil() of the given value.

\n", "requiresBlock": false }, "divide": { - "args": [ - "a", - "b" - ], + "args": ["a", "b"], "numArgs": 2, "example": "{{ divide 10 5 }} -> 2", "description": "

Divide a by b

\n", "requiresBlock": false }, "floor": { - "args": [ - "value" - ], + "args": ["value"], "numArgs": 1, "example": "{{ floor 1.2 }} -> 1", "description": "

Get the Math.floor() of the given value.

\n", "requiresBlock": false }, "minus": { - "args": [ - "a", - "b" - ], + "args": ["a", "b"], "numArgs": 2, "example": "{{ subtract 10 5 }} -> 5", "description": "

Return the product of a minus b.

\n", "requiresBlock": false }, "modulo": { - "args": [ - "a", - "b" - ], + "args": ["a", "b"], "numArgs": 2, "example": "{{ modulo 10 5 }} -> 0", "description": "

Get the remainder of a division operation.

\n", "requiresBlock": false }, "multiply": { - "args": [ - "a", - "b" - ], + "args": ["a", "b"], "numArgs": 2, "example": "{{ multiply 10 5 }} -> 50", "description": "

Multiply number a by number b.

\n", "requiresBlock": false }, "plus": { - "args": [ - "a", - "b" - ], + "args": ["a", "b"], "numArgs": 2, "example": "{{ plus 10 5 }} -> 15", "description": "

Add a by b.

\n", "requiresBlock": false }, "random": { - "args": [ - "min", - "max" - ], + "args": ["min", "max"], "numArgs": 2, "example": "{{ random 0 20 }} -> 10", "description": "

Generate a random number between two values

\n", "requiresBlock": false }, "remainder": { - "args": [ - "a", - "b" - ], + "args": ["a", "b"], "numArgs": 2, "example": "{{ remainder 10 6 }} -> 4", "description": "

Get the remainder when a is divided by b.

\n", "requiresBlock": false }, "round": { - "args": [ - "number" - ], + "args": ["number"], "numArgs": 1, "example": "{{ round 10.3 }} -> 10", "description": "

Round the given number.

\n", "requiresBlock": false }, "subtract": { - "args": [ - "a", - "b" - ], + "args": ["a", "b"], "numArgs": 2, "example": "{{ subtract 10 5 }} -> 5", "description": "

Return the product of a minus b.

\n", "requiresBlock": false }, "sum": { - "args": [ - "array" - ], + "args": ["array"], "numArgs": 1, "example": "{{ sum [1, 2, 3] }} -> 6", "description": "

Returns the sum of all numbers in the given array.

\n", @@ -147,285 +108,196 @@ }, "array": { "after": { - "args": [ - "array", - "n" - ], + "args": ["array", "n"], "numArgs": 2, "example": "{{ after ['a', 'b', 'c', 'd'] 2}} -> ['c', 'd']", "description": "

Returns all of the items in an array after the specified index. Opposite of before.

\n", "requiresBlock": false }, "arrayify": { - "args": [ - "value" - ], + "args": ["value"], "numArgs": 1, "example": "{{ arrayify 'foo' }} -> ['foo']", "description": "

Cast the given value to an array.

\n", "requiresBlock": false }, "before": { - "args": [ - "array", - "n" - ], + "args": ["array", "n"], "numArgs": 2, "example": "{{ before ['a', 'b', 'c', 'd'] 3}} -> ['a', 'b']", "description": "

Return all of the items in the collection before the specified count. Opposite of after.

\n", "requiresBlock": false }, "eachIndex": { - "args": [ - "array", - "options" - ], + "args": ["array", "options"], "numArgs": 2, "example": "{{#eachIndex [1, 2, 3]}} {{item}} is {{index}} {{/eachIndex}} -> ' 1 is 0 2 is 1 3 is 2 '", "description": "

Iterates the array, listing an item and the index of it.

\n", "requiresBlock": true }, "filter": { - "args": [ - "array", - "value", - "options" - ], + "args": ["array", "value", "options"], "numArgs": 3, "example": "{{#filter [1, 2, 3] 2}}2 Found{{else}}2 not found{{/filter}} -> 2 Found", "description": "

Block helper that filters the given array and renders the block for values that evaluate to true, otherwise the inverse block is returned.

\n", "requiresBlock": true }, "first": { - "args": [ - "array", - "n" - ], + "args": ["array", "n"], "numArgs": 2, "example": "{{first [1, 2, 3, 4] 2}} -> 1,2", "description": "

Returns the first item, or first n items of an array.

\n", "requiresBlock": false }, "forEach": { - "args": [ - "array", - "options" - ], + "args": ["array", "options"], "numArgs": 2, "example": "{{#forEach [{ 'name': 'John' }] }} {{ name }} {{/forEach}} -> ' John '", "description": "

Iterates over each item in an array and exposes the current item in the array as context to the inner block. In addition to the current array item, the helper exposes the following variables to the inner block: - index - total - isFirst - isLast Also, @index is exposed as a private variable, and additional private variables may be defined as hash arguments.

\n", "requiresBlock": true }, "inArray": { - "args": [ - "array", - "value", - "options" - ], + "args": ["array", "value", "options"], "numArgs": 3, "example": "{{#inArray [1, 2, 3] 2}} 2 exists {{else}} 2 does not exist {{/inArray}} -> ' 2 exists '", "description": "

Block helper that renders the block if an array has the given value. Optionally specify an inverse block to render when the array does not have the given value.

\n", "requiresBlock": true }, "isArray": { - "args": [ - "value" - ], + "args": ["value"], "numArgs": 1, "example": "{{isArray [1, 2]}} -> true", "description": "

Returns true if value is an es5 array.

\n", "requiresBlock": false }, "itemAt": { - "args": [ - "array", - "idx" - ], + "args": ["array", "idx"], "numArgs": 2, "example": "{{itemAt [1, 2, 3] 1}} -> 2", "description": "

Returns the item from array at index idx.

\n", "requiresBlock": false }, "join": { - "args": [ - "array", - "separator" - ], + "args": ["array", "separator"], "numArgs": 2, "example": "{{join [1, 2, 3]}} -> 1, 2, 3", "description": "

Join all elements of array into a string, optionally using a given separator.

\n", "requiresBlock": false }, "equalsLength": { - "args": [ - "value", - "length" - ], + "args": ["value", "length"], "numArgs": 2, "example": "{{equalsLength [1, 2, 3] 3}} -> true", "description": "

Returns true if the the length of the given value is equal to the given length. Can be used as a block or inline helper.

\n", "requiresBlock": false }, "last": { - "args": [ - "value", - "n" - ], + "args": ["value", "n"], "numArgs": 2, "example": "{{last [1, 2, 3]}} -> 3", "description": "

Returns the last item, or last n items of an array or string. Opposite of first.

\n", "requiresBlock": false }, "length": { - "args": [ - "value" - ], + "args": ["value"], "numArgs": 1, "example": "{{length [1, 2, 3]}} -> 3", "description": "

Returns the length of the given string or array.

\n", "requiresBlock": false }, "lengthEqual": { - "args": [ - "value", - "length" - ], + "args": ["value", "length"], "numArgs": 2, "example": "{{equalsLength [1, 2, 3] 3}} -> true", "description": "

Returns true if the the length of the given value is equal to the given length. Can be used as a block or inline helper.

\n", "requiresBlock": false }, "map": { - "args": [ - "array", - "fn" - ], + "args": ["array", "fn"], "numArgs": 2, "example": "{{map [1, 2, 3] double}} -> [2, 4, 6]", "description": "

Returns a new array, created by calling function on each element of the given array. For example,

\n", "requiresBlock": false }, "pluck": { - "args": [ - "collection", - "prop" - ], + "args": ["collection", "prop"], "numArgs": 2, "example": "{{pluck [{ 'name': 'Bob' }] 'name' }} -> ['Bob']", "description": "

Map over the given object or array or objects and create an array of values from the given prop. Dot-notation may be used (as a string) to get nested properties.

\n", "requiresBlock": false }, "reverse": { - "args": [ - "value" - ], + "args": ["value"], "numArgs": 1, "example": "{{reverse [1, 2, 3]}} -> [3, 2, 1]", "description": "

Reverse the elements in an array, or the characters in a string.

\n", "requiresBlock": false }, "some": { - "args": [ - "array", - "iter", - "provided" - ], + "args": ["array", "iter", "provided"], "numArgs": 3, "example": "{{#some [1, \"b\", 3] isString}} string found {{else}} No string found {{/some}} -> ' string found '", "description": "

Block helper that returns the block if the callback returns true for some value in the given array.

\n", "requiresBlock": true }, "sort": { - "args": [ - "array", - "key" - ], + "args": ["array", "key"], "numArgs": 2, "example": "{{ sort ['b', 'a', 'c'] }} -> ['a', 'b', 'c']", "description": "

Sort the given array. If an array of objects is passed, you may optionally pass a key to sort on as the second argument. You may alternatively pass a sorting function as the second argument.

\n", "requiresBlock": false }, "sortBy": { - "args": [ - "array", - "props" - ], + "args": ["array", "props"], "numArgs": 2, "example": "{{ sortBy [{'a': 'zzz'}, {'a': 'aaa'}] 'a' }} -> [{'a':'aaa'},{'a':'zzz'}]", "description": "

Sort an array. If an array of objects is passed, you may optionally pass a key to sort on as the second argument. You may alternatively pass a sorting function as the second argument.

\n", "requiresBlock": false }, "withAfter": { - "args": [ - "array", - "idx", - "options" - ], + "args": ["array", "idx", "options"], "numArgs": 3, "example": "{{#withAfter [1, 2, 3] 1 }} {{this}} {{/withAfter}} -> ' 2 3 '", "description": "

Use the items in the array after the specified index as context inside a block. Opposite of withBefore.

\n", "requiresBlock": true }, "withBefore": { - "args": [ - "array", - "idx", - "options" - ], + "args": ["array", "idx", "options"], "numArgs": 3, "example": "{{#withBefore [1, 2, 3] 2 }} {{this}} {{/withBefore}} -> ' 1 '", "description": "

Use the items in the array before the specified index as context inside a block. Opposite of withAfter.

\n", "requiresBlock": true }, "withFirst": { - "args": [ - "array", - "idx", - "options" - ], + "args": ["array", "idx", "options"], "numArgs": 3, "example": "{{#withFirst [1, 2, 3] }}{{this}}{{/withFirst}} -> 1", "description": "

Use the first item in a collection inside a handlebars block expression. Opposite of withLast.

\n", "requiresBlock": true }, "withGroup": { - "args": [ - "array", - "size", - "options" - ], + "args": ["array", "size", "options"], "numArgs": 3, "example": "{{#withGroup [1, 2, 3, 4] 2}}{{#each this}}{{.}}{{/each}}
{{/withGroup}} -> 12
34
", "description": "

Block helper that groups array elements by given group size.

\n", "requiresBlock": true }, "withLast": { - "args": [ - "array", - "idx", - "options" - ], + "args": ["array", "idx", "options"], "numArgs": 3, "example": "{{#withLast [1, 2, 3, 4]}}{{this}}{{/withLast}} -> 4", "description": "

Use the last item or n items in an array as context inside a block. Opposite of withFirst.

\n", "requiresBlock": true }, "withSort": { - "args": [ - "array", - "prop", - "options" - ], + "args": ["array", "prop", "options"], "numArgs": 3, "example": "{{#withSort ['b', 'a', 'c']}}{{this}}{{/withSort}} -> abc", "description": "

Block helper that sorts a collection and exposes the sorted collection as context inside the block.

\n", "requiresBlock": true }, "unique": { - "args": [ - "array", - "options" - ], + "args": ["array", "options"], "numArgs": 2, "example": "{{#each (unique ['a', 'a', 'c', 'b', 'e', 'e']) }}{{.}}{{/each}} -> acbe", "description": "

Block helper that return an array with all duplicate values removed. Best used along with a each helper.

\n", @@ -434,83 +306,61 @@ }, "number": { "bytes": { - "args": [ - "number" - ], + "args": ["number"], "numArgs": 1, "example": "{{ bytes 1386 1 }} -> 1.4 kB", "description": "

Format a number to it's equivalent in bytes. If a string is passed, it's length will be formatted and returned. Examples: - 'foo' => 3 B - 13661855 => 13.66 MB - 825399 => 825.39 kB - 1396 => 1.4 kB

\n", "requiresBlock": false }, "addCommas": { - "args": [ - "num" - ], + "args": ["num"], "numArgs": 1, "example": "{{ addCommas 1000000 }} -> 1,000,000", "description": "

Add commas to numbers

\n", "requiresBlock": false }, "phoneNumber": { - "args": [ - "num" - ], + "args": ["num"], "numArgs": 1, "example": "{{ phoneNumber 8005551212 }} -> (800) 555-1212", "description": "

Convert a string or number to a formatted phone number.

\n", "requiresBlock": false }, "toAbbr": { - "args": [ - "number", - "precision" - ], + "args": ["number", "precision"], "numArgs": 2, "example": "{{ toAbbr 10123 2 }} -> 10.12k", "description": "

Abbreviate numbers to the given number of precision. This for general numbers, not size in bytes.

\n", "requiresBlock": false }, "toExponential": { - "args": [ - "number", - "fractionDigits" - ], + "args": ["number", "fractionDigits"], "numArgs": 2, "example": "{{ toExponential 10123 2 }} -> 1.01e+4", "description": "

Returns a string representing the given number in exponential notation.

\n", "requiresBlock": false }, "toFixed": { - "args": [ - "number", - "digits" - ], + "args": ["number", "digits"], "numArgs": 2, "example": "{{ toFixed 1.1234 2 }} -> 1.12", "description": "

Formats the given number using fixed-point notation.

\n", "requiresBlock": false }, "toFloat": { - "args": [ - "number" - ], + "args": ["number"], "numArgs": 1, "description": "

Convert input to a float.

\n", "requiresBlock": false }, "toInt": { - "args": [ - "number" - ], + "args": ["number"], "numArgs": 1, "description": "

Convert input to an integer.

\n", "requiresBlock": false }, "toPrecision": { - "args": [ - "number", - "precision" - ], + "args": ["number", "precision"], "numArgs": 2, "example": "{{toPrecision '1.1234' 2}} -> 1.1", "description": "

Returns a string representing the Number object to the specified precision.

\n", @@ -519,64 +369,49 @@ }, "url": { "encodeURI": { - "args": [ - "str" - ], + "args": ["str"], "numArgs": 1, "example": "{{ encodeURI 'https://myurl?Hello There' }} -> https%3A%2F%2Fmyurl%3FHello%20There", "description": "

Encodes a Uniform Resource Identifier (URI) component by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character.

\n", "requiresBlock": false }, "escape": { - "args": [ - "str" - ], + "args": ["str"], "numArgs": 1, "example": "{{ escape 'https://myurl?Hello+There' }} -> https%3A%2F%2Fmyurl%3FHello%2BThere", "description": "

Escape the given string by replacing characters with escape sequences. Useful for allowing the string to be used in a URL, etc.

\n", "requiresBlock": false }, "decodeURI": { - "args": [ - "str" - ], + "args": ["str"], "numArgs": 1, "example": "{{ decodeURI 'https://myurl?Hello%20There' }} -> https://myurl?Hello There", "description": "

Decode a Uniform Resource Identifier (URI) component.

\n", "requiresBlock": false }, "urlResolve": { - "args": [ - "base", - "href" - ], + "args": ["base", "href"], "numArgs": 2, "example": "{{ urlResolve 'https://myurl' '/api/test' }} -> https://myurl/api/test", "description": "

Take a base URL, and a href URL, and resolve them as a browser would for an anchor tag.

\n", "requiresBlock": false }, "urlParse": { - "args": [ - "str" - ], + "args": ["str"], "numArgs": 1, "example": "{{ urlParse 'https://myurl/api/test' }}", "description": "

Parses a url string into an object.

\n", "requiresBlock": false }, "stripQuerystring": { - "args": [ - "url" - ], + "args": ["url"], "numArgs": 1, "example": "{{ stripQuerystring 'https://myurl/api/test?foo=bar' }} -> 'https://myurl/api/test'", "description": "

Strip the query string from the given url.

\n", "requiresBlock": false }, "stripProtocol": { - "args": [ - "str" - ], + "args": ["str"], "numArgs": 1, "example": "{{ stripProtocol 'https://myurl/api/test' }} -> '//myurl/api/test'", "description": "

Strip protocol from a url. Useful for displaying media that may have an 'http' protocol on secure connections.

\n", @@ -585,595 +420,422 @@ }, "string": { "append": { - "args": [ - "str", - "suffix" - ], + "args": ["str", "suffix"], "numArgs": 2, "example": "{{append 'index' '.html'}} -> index.html", "description": "

Append the specified suffix to the given string.

\n", "requiresBlock": false }, "camelcase": { - "args": [ - "string" - ], + "args": ["string"], "numArgs": 1, "example": "{{camelcase 'foo bar baz'}} -> fooBarBaz", "description": "

camelCase the characters in the given string.

\n", "requiresBlock": false }, "capitalize": { - "args": [ - "str" - ], + "args": ["str"], "numArgs": 1, "example": "{{capitalize 'foo bar baz'}} -> Foo bar baz", "description": "

Capitalize the first word in a sentence.

\n", "requiresBlock": false }, "capitalizeAll": { - "args": [ - "str" - ], + "args": ["str"], "numArgs": 1, "example": "{{ capitalizeAll 'foo bar baz'}} -> Foo Bar Baz", "description": "

Capitalize all words in a string.

\n", "requiresBlock": false }, "center": { - "args": [ - "str", - "spaces" - ], + "args": ["str", "spaces"], "numArgs": 2, "example": "{{ center 'test' 1}} -> ' test '", "description": "

Center a string using non-breaking spaces

\n", "requiresBlock": false }, "chop": { - "args": [ - "string" - ], + "args": ["string"], "numArgs": 1, "example": "{{ chop ' ABC '}} -> ABC", "description": "

Like trim, but removes both extraneous whitespace and non-word characters from the beginning and end of a string.

\n", "requiresBlock": false }, "dashcase": { - "args": [ - "string" - ], + "args": ["string"], "numArgs": 1, "example": "{{dashcase 'a-b-c d_e'}} -> a-b-c-d-e", "description": "

dash-case the characters in string. Replaces non-word characters and periods with hyphens.

\n", "requiresBlock": false }, "dotcase": { - "args": [ - "string" - ], + "args": ["string"], "numArgs": 1, "example": "{{dotcase 'a-b-c d_e'}} -> a.b.c.d.e", "description": "

dot.case the characters in string.

\n", "requiresBlock": false }, "downcase": { - "args": [ - "string" - ], + "args": ["string"], "numArgs": 1, "example": "{{downcase 'aBcDeF'}} -> abcdef", "description": "

Lowercase all of the characters in the given string. Alias for lowercase.

\n", "requiresBlock": false }, "ellipsis": { - "args": [ - "str", - "length" - ], + "args": ["str", "length"], "numArgs": 2, "example": "{{ellipsis 'foo bar baz' 7}} -> foo bar…", "description": "

Truncates a string to the specified length, and appends it with an elipsis, .

\n", "requiresBlock": false }, "hyphenate": { - "args": [ - "str" - ], + "args": ["str"], "numArgs": 1, "example": "{{hyphenate 'foo bar baz qux'}} -> foo-bar-baz-qux", "description": "

Replace spaces in a string with hyphens.

\n", "requiresBlock": false }, "isString": { - "args": [ - "value" - ], + "args": ["value"], "numArgs": 1, "example": "{{isString 'foo'}} -> true", "description": "

Return true if value is a string.

\n", "requiresBlock": false }, "lowercase": { - "args": [ - "str" - ], + "args": ["str"], "numArgs": 1, "example": "{{lowercase 'Foo BAR baZ'}} -> foo bar baz", "description": "

Lowercase all characters in the given string.

\n", "requiresBlock": false }, "occurrences": { - "args": [ - "str", - "substring" - ], + "args": ["str", "substring"], "numArgs": 2, "example": "{{occurrences 'foo bar foo bar baz' 'foo'}} -> 2", "description": "

Return the number of occurrences of substring within the given string.

\n", "requiresBlock": false }, "pascalcase": { - "args": [ - "string" - ], + "args": ["string"], "numArgs": 1, "example": "{{pascalcase 'foo bar baz'}} -> FooBarBaz", "description": "

PascalCase the characters in string.

\n", "requiresBlock": false }, "pathcase": { - "args": [ - "string" - ], + "args": ["string"], "numArgs": 1, "example": "{{pathcase 'a-b-c d_e'}} -> a/b/c/d/e", "description": "

path/case the characters in string.

\n", "requiresBlock": false }, "plusify": { - "args": [ - "str" - ], + "args": ["str"], "numArgs": 1, "example": "{{plusify 'foo bar baz'}} -> foo+bar+baz", "description": "

Replace spaces in the given string with pluses.

\n", "requiresBlock": false }, "prepend": { - "args": [ - "str", - "prefix" - ], + "args": ["str", "prefix"], "numArgs": 2, "example": "{{prepend 'bar' 'foo-'}} -> foo-bar", "description": "

Prepends the given string with the specified prefix.

\n", "requiresBlock": false }, "remove": { - "args": [ - "str", - "substring" - ], + "args": ["str", "substring"], "numArgs": 2, "example": "{{remove 'a b a b a b' 'a '}} -> b b b", "description": "

Remove all occurrences of substring from the given str.

\n", "requiresBlock": false }, "removeFirst": { - "args": [ - "str", - "substring" - ], + "args": ["str", "substring"], "numArgs": 2, "example": "{{removeFirst 'a b a b a b' 'a'}} -> ' b a b a b'", "description": "

Remove the first occurrence of substring from the given str.

\n", "requiresBlock": false }, "replace": { - "args": [ - "str", - "a", - "b" - ], + "args": ["str", "a", "b"], "numArgs": 3, "example": "{{replace 'a b a b a b' 'a' 'z'}} -> z b z b z b", "description": "

Replace all occurrences of substring a with substring b.

\n", "requiresBlock": false }, "replaceFirst": { - "args": [ - "str", - "a", - "b" - ], + "args": ["str", "a", "b"], "numArgs": 3, "example": "{{replaceFirst 'a b a b a b' 'a' 'z'}} -> z b a b a b", "description": "

Replace the first occurrence of substring a with substring b.

\n", "requiresBlock": false }, "sentence": { - "args": [ - "str" - ], + "args": ["str"], "numArgs": 1, "example": "{{sentence 'hello world. goodbye world.'}} -> Hello world. Goodbye world.", "description": "

Sentence case the given string

\n", "requiresBlock": false }, "snakecase": { - "args": [ - "string" - ], + "args": ["string"], "numArgs": 1, "example": "{{snakecase 'a-b-c d_e'}} -> a_b_c_d_e", "description": "

snake_case the characters in the given string.

\n", "requiresBlock": false }, "split": { - "args": [ - "string" - ], + "args": ["string"], "numArgs": 1, "example": "{{split 'a,b,c'}} -> ['a', 'b', 'c']", "description": "

Split string by the given character.

\n", "requiresBlock": false }, "startsWith": { - "args": [ - "prefix", - "testString", - "options" - ], + "args": ["prefix", "testString", "options"], "numArgs": 3, "example": "{{#startsWith 'Goodbye' 'Hello, world!'}}Yep{{else}}Nope{{/startsWith}} -> Nope", "description": "

Tests whether a string begins with the given prefix.

\n", "requiresBlock": true }, "titleize": { - "args": [ - "str" - ], + "args": ["str"], "numArgs": 1, "example": "{{titleize 'this is title case' }} -> This Is Title Case", "description": "

Title case the given string.

\n", "requiresBlock": false }, "trim": { - "args": [ - "string" - ], + "args": ["string"], "numArgs": 1, "example": "{{trim ' ABC ' }} -> ABC", "description": "

Removes extraneous whitespace from the beginning and end of a string.

\n", "requiresBlock": false }, "trimLeft": { - "args": [ - "string" - ], + "args": ["string"], "numArgs": 1, "example": "{{trimLeft ' ABC ' }} -> 'ABC '", "description": "

Removes extraneous whitespace from the beginning of a string.

\n", "requiresBlock": false }, "trimRight": { - "args": [ - "string" - ], + "args": ["string"], "numArgs": 1, "example": "{{trimRight ' ABC ' }} -> ' ABC'", "description": "

Removes extraneous whitespace from the end of a string.

\n", "requiresBlock": false }, "truncate": { - "args": [ - "str", - "limit", - "suffix" - ], + "args": ["str", "limit", "suffix"], "numArgs": 3, "example": "{{truncate 'foo bar baz' 7 }} -> foo bar", "description": "

Truncate a string to the specified length. Also see ellipsis.

\n", "requiresBlock": false }, "truncateWords": { - "args": [ - "str", - "limit", - "suffix" - ], + "args": ["str", "limit", "suffix"], "numArgs": 3, "example": "{{truncateWords 'foo bar baz' 1 }} -> foo…", "description": "

Truncate a string to have the specified number of words. Also see truncate.

\n", "requiresBlock": false }, "upcase": { - "args": [ - "string" - ], + "args": ["string"], "numArgs": 1, "example": "{{upcase 'aBcDef'}} -> ABCDEF", "description": "

Uppercase all of the characters in the given string. Alias for uppercase.

\n", "requiresBlock": false }, "uppercase": { - "args": [ - "str", - "options" - ], + "args": ["str", "options"], "numArgs": 2, "example": "{{uppercase 'aBcDef'}} -> ABCDEF", "description": "

Uppercase all of the characters in the given string. If used as a block helper it will uppercase the entire block. This helper does not support inverse blocks.

\n", "requiresBlock": false + }, + "lorem": { + "args": ["num"], + "numArgs": 1, + "example": "{{lorem 11}} -> Lorem ipsum", + "description": "

Takes a number and returns that many charaters of Lorem Ipsum

\n", + "requiresBlock": false } }, "comparison": { "and": { - "args": [ - "a", - "b", - "options" - ], + "args": ["a", "b", "options"], "numArgs": 3, "example": "{{#and great magnificent}}both{{else}}no{{/and}} -> no", "description": "

Helper that renders the block if both of the given values are truthy. If an inverse block is specified it will be rendered when falsy. Works as a block helper, inline helper or subexpression.

\n", "requiresBlock": true }, "compare": { - "args": [ - "a", - "operator", - "b", - "options" - ], + "args": ["a", "operator", "b", "options"], "numArgs": 4, "example": "{{compare 10 '<' 5 }} -> false", "description": "

Render a block when a comparison of the first and third arguments returns true. The second argument is the [arithemetic operator][operators] to use. You may also optionally specify an inverse block to render when falsy.

\n", "requiresBlock": false }, "contains": { - "args": [ - "collection", - "value", - "[startIndex=0]", - "options" - ], + "args": ["collection", "value", "[startIndex=0]", "options"], "numArgs": 4, "example": "{{#contains ['a', 'b', 'c'] 'd'}} This will not be rendered. {{else}} This will be rendered. {{/contains}} -> ' This will be rendered. '", "description": "

Block helper that renders the block if collection has the given value, using strict equality (===) for comparison, otherwise the inverse block is rendered (if specified). If a startIndex is specified and is negative, it is used as the offset from the end of the collection.

\n", "requiresBlock": true }, "default": { - "args": [ - "value", - "defaultValue" - ], + "args": ["value", "defaultValue"], "numArgs": 2, "example": "{{default null null 'default'}} -> default", "description": "

Returns the first value that is not undefined, otherwise the 'default' value is returned.

\n", "requiresBlock": false }, "eq": { - "args": [ - "a", - "b", - "options" - ], + "args": ["a", "b", "options"], "numArgs": 3, "example": "{{#eq 3 3}}equal{{else}}not equal{{/eq}} -> equal", "description": "

Block helper that renders a block if a is equal to b. If an inverse block is specified it will be rendered when falsy. You may optionally use the compare='' hash argument for the second value.

\n", "requiresBlock": true }, "gt": { - "args": [ - "a", - "b", - "options" - ], + "args": ["a", "b", "options"], "numArgs": 3, "example": "{{#gt 4 3}} greater than{{else}} not greater than{{/gt}} -> ' greater than'", "description": "

Block helper that renders a block if a is greater than b. If an inverse block is specified it will be rendered when falsy. You may optionally use the compare='' hash argument for the second value.

\n", "requiresBlock": true }, "gte": { - "args": [ - "a", - "b", - "options" - ], + "args": ["a", "b", "options"], "numArgs": 3, "example": "{{#gte 4 3}} greater than or equal{{else}} not greater than{{/gte}} -> ' greater than or equal'", "description": "

Block helper that renders a block if a is greater than or equal to b. If an inverse block is specified it will be rendered when falsy. You may optionally use the compare='' hash argument for the second value.

\n", "requiresBlock": true }, "has": { - "args": [ - "val", - "pattern", - "options" - ], + "args": ["val", "pattern", "options"], "numArgs": 3, "example": "{{#has 'foobar' 'foo'}}has it{{else}}doesn't{{/has}} -> has it", "description": "

Block helper that renders a block if value has pattern. If an inverse block is specified it will be rendered when falsy.

\n", "requiresBlock": true }, "isFalsey": { - "args": [ - "val", - "options" - ], + "args": ["val", "options"], "numArgs": 2, "example": "{{isFalsey '' }} -> true", "description": "

Returns true if the given value is falsey. Uses the [falsey][] library for comparisons. Please see that library for more information or to report bugs with this helper.

\n", "requiresBlock": false }, "isTruthy": { - "args": [ - "val", - "options" - ], + "args": ["val", "options"], "numArgs": 2, "example": "{{isTruthy '12' }} -> true", "description": "

Returns true if the given value is truthy. Uses the [falsey][] library for comparisons. Please see that library for more information or to report bugs with this helper.

\n", "requiresBlock": false }, "ifEven": { - "args": [ - "number", - "options" - ], + "args": ["number", "options"], "numArgs": 2, "example": "{{#ifEven 2}} even {{else}} odd {{/ifEven}} -> ' even '", "description": "

Return true if the given value is an even number.

\n", "requiresBlock": true }, "ifNth": { - "args": [ - "a", - "b", - "options" - ], + "args": ["a", "b", "options"], "numArgs": 3, "example": "{{#ifNth 2 10}}remainder{{else}}no remainder{{/ifNth}} -> remainder", "description": "

Conditionally renders a block if the remainder is zero when b operand is divided by a. If an inverse block is specified it will be rendered when the remainder is not zero.

\n", "requiresBlock": true }, "ifOdd": { - "args": [ - "value", - "options" - ], + "args": ["value", "options"], "numArgs": 2, "example": "{{#ifOdd 3}}odd{{else}}even{{/ifOdd}} -> odd", "description": "

Block helper that renders a block if value is an odd number. If an inverse block is specified it will be rendered when falsy.

\n", "requiresBlock": true }, "is": { - "args": [ - "a", - "b", - "options" - ], + "args": ["a", "b", "options"], "numArgs": 3, "example": "{{#is 3 3}} is {{else}} is not {{/is}} -> ' is '", "description": "

Block helper that renders a block if a is equal to b. If an inverse block is specified it will be rendered when falsy. Similar to eq but does not do strict equality.

\n", "requiresBlock": true }, "isnt": { - "args": [ - "a", - "b", - "options" - ], + "args": ["a", "b", "options"], "numArgs": 3, "example": "{{#isnt 3 3}} isnt {{else}} is {{/isnt}} -> ' is '", "description": "

Block helper that renders a block if a is not equal to b. If an inverse block is specified it will be rendered when falsy. Similar to unlessEq but does not use strict equality for comparisons.

\n", "requiresBlock": true }, "lt": { - "args": [ - "context", - "options" - ], + "args": ["context", "options"], "numArgs": 2, "example": "{{#lt 2 3}} less than {{else}} more than or equal {{/lt}} -> ' less than '", "description": "

Block helper that renders a block if a is less than b. If an inverse block is specified it will be rendered when falsy. You may optionally use the compare='' hash argument for the second value.

\n", "requiresBlock": true }, "lte": { - "args": [ - "a", - "b", - "options" - ], + "args": ["a", "b", "options"], "numArgs": 3, "example": "{{#lte 2 3}} less than or equal {{else}} more than {{/lte}} -> ' less than or equal '", "description": "

Block helper that renders a block if a is less than or equal to b. If an inverse block is specified it will be rendered when falsy. You may optionally use the compare='' hash argument for the second value.

\n", "requiresBlock": true }, "neither": { - "args": [ - "a", - "b", - "options" - ], + "args": ["a", "b", "options"], "numArgs": 3, "example": "{{#neither null null}}both falsey{{else}}both not falsey{{/neither}} -> both falsey", "description": "

Block helper that renders a block if neither of the given values are truthy. If an inverse block is specified it will be rendered when falsy.

\n", "requiresBlock": true }, "not": { - "args": [ - "val", - "options" - ], + "args": ["val", "options"], "numArgs": 2, "example": "{{#not undefined }}falsey{{else}}not falsey{{/not}} -> falsey", "description": "

Returns true if val is falsey. Works as a block or inline helper.

\n", "requiresBlock": true }, "or": { - "args": [ - "arguments", - "options" - ], + "args": ["arguments", "options"], "numArgs": 2, "example": "{{#or 1 2 undefined }} at least one truthy {{else}} all falsey {{/or}} -> ' at least one truthy '", "description": "

Block helper that renders a block if any of the given values is truthy. If an inverse block is specified it will be rendered when falsy.

\n", "requiresBlock": true }, "unlessEq": { - "args": [ - "a", - "b", - "options" - ], + "args": ["a", "b", "options"], "numArgs": 3, "example": "{{#unlessEq 2 1 }} not equal {{else}} equal {{/unlessEq}} -> ' not equal '", "description": "

Block helper that always renders the inverse block unless a is equal to b.

\n", "requiresBlock": true }, "unlessGt": { - "args": [ - "a", - "b", - "options" - ], + "args": ["a", "b", "options"], "numArgs": 3, "example": "{{#unlessGt 20 1 }} not greater than {{else}} greater than {{/unlessGt}} -> ' greater than '", "description": "

Block helper that always renders the inverse block unless a is greater than b.

\n", "requiresBlock": true }, "unlessLt": { - "args": [ - "a", - "b", - "options" - ], + "args": ["a", "b", "options"], "numArgs": 3, "example": "{{#unlessLt 20 1 }}greater than or equal{{else}}less than{{/unlessLt}} -> greater than or equal", "description": "

Block helper that always renders the inverse block unless a is less than b.

\n", "requiresBlock": true }, "unlessGteq": { - "args": [ - "a", - "b", - "options" - ], + "args": ["a", "b", "options"], "numArgs": 3, "example": "{{#unlessGteq 20 1 }} less than {{else}}greater than or equal to{{/unlessGteq}} -> greater than or equal to", "description": "

Block helper that always renders the inverse block unless a is greater than or equal to b.

\n", "requiresBlock": true }, "unlessLteq": { - "args": [ - "a", - "b", - "options" - ], + "args": ["a", "b", "options"], "numArgs": 3, "example": "{{#unlessLteq 20 1 }} greater than {{else}} less than or equal to {{/unlessLteq}} -> ' greater than '", "description": "

Block helper that always renders the inverse block unless a is less than or equal to b.

\n", @@ -1182,122 +844,85 @@ }, "object": { "extend": { - "args": [ - "objects" - ], + "args": ["objects"], "numArgs": 1, "description": "

Extend the context with the properties of other objects. A shallow merge is performed to avoid mutating the context.

\n", "requiresBlock": false }, "forIn": { - "args": [ - "context", - "options" - ], + "args": ["context", "options"], "numArgs": 2, "description": "

Block helper that iterates over the properties of an object, exposing each key and value on the context.

\n", "requiresBlock": true }, "forOwn": { - "args": [ - "obj", - "options" - ], + "args": ["obj", "options"], "numArgs": 2, "description": "

Block helper that iterates over the own properties of an object, exposing each key and value on the context.

\n", "requiresBlock": true }, "toPath": { - "args": [ - "prop" - ], + "args": ["prop"], "numArgs": 1, "description": "

Take arguments and, if they are string or number, convert them to a dot-delineated object property path.

\n", "requiresBlock": false }, "get": { - "args": [ - "prop", - "context", - "options" - ], + "args": ["prop", "context", "options"], "numArgs": 3, "description": "

Use property paths (a.b.c) to get a value or nested value from the context. Works as a regular helper or block helper.

\n", "requiresBlock": true }, "getObject": { - "args": [ - "prop", - "context" - ], + "args": ["prop", "context"], "numArgs": 2, "description": "

Use property paths (a.b.c) to get an object from the context. Differs from the get helper in that this helper will return the actual object, including the given property key. Also, this helper does not work as a block helper.

\n", "requiresBlock": false }, "hasOwn": { - "args": [ - "key", - "context" - ], + "args": ["key", "context"], "numArgs": 2, "description": "

Return true if key is an own, enumerable property of the given context object.

\n", "requiresBlock": false }, "isObject": { - "args": [ - "value" - ], + "args": ["value"], "numArgs": 1, "description": "

Return true if value is an object.

\n", "requiresBlock": false }, "JSONparse": { - "args": [ - "string" - ], + "args": ["string"], "numArgs": 1, "description": "

Parses the given string using JSON.parse.

\n", "requiresBlock": true }, "JSONstringify": { - "args": [ - "obj" - ], + "args": ["obj"], "numArgs": 1, "description": "

Stringify an object using JSON.stringify.

\n", "requiresBlock": false }, "merge": { - "args": [ - "object", - "objects" - ], + "args": ["object", "objects"], "numArgs": 2, "description": "

Deeply merge the properties of the given objects with the context object.

\n", "requiresBlock": false }, "parseJSON": { - "args": [ - "string" - ], + "args": ["string"], "numArgs": 1, "description": "

Parses the given string using JSON.parse.

\n", "requiresBlock": true }, "pick": { - "args": [ - "properties", - "context", - "options" - ], + "args": ["properties", "context", "options"], "numArgs": 3, "description": "

Pick properties from the context object.

\n", "requiresBlock": true }, "stringify": { - "args": [ - "obj" - ], + "args": ["obj"], "numArgs": 1, "description": "

Stringify an object using JSON.stringify.

\n", "requiresBlock": false @@ -1314,22 +939,16 @@ }, "date": { "date": { - "args": [ - "datetime", - "format" - ], + "args": ["datetime", "format"], "numArgs": 2, "example": "{{date now \"DD-MM-YYYY\" \"America/New_York\" }} -> 21-01-2021", "description": "

Format a date using moment.js date formatting - the timezone is optional and uses the tz database.

\n" }, "duration": { - "args": [ - "time", - "durationType" - ], + "args": ["time", "durationType"], "numArgs": 2, "example": "{{duration 8 \"seconds\"}} -> a few seconds", "description": "

Produce a humanized duration left/until given an amount of time and the type of time measurement.

\n" } } -} \ No newline at end of file +} From 457e9235f07001a5083dbb2e3b7eee920336054c Mon Sep 17 00:00:00 2001 From: mikesealey Date: Thu, 4 Jul 2024 16:47:56 +0100 Subject: [PATCH 2/5] Revert "updates Handlebar-Helper manifest for Lorem helper" This reverts commit fcdd933f7dd566075b01803c7b4fc0c68a4c3a96. --- packages/string-templates/package.json | 2 +- packages/string-templates/src/manifest.json | 665 +++++++++++++++----- 2 files changed, 524 insertions(+), 143 deletions(-) diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 17f26604a3..ca7c7485cd 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -26,7 +26,7 @@ "manifest": "ts-node ./scripts/gen-collection-info.ts" }, "dependencies": { - "@budibase/handlebars-helpers": "^0.13.2", + "@budibase/handlebars-helpers": "^0.13.1", "dayjs": "^1.10.8", "handlebars": "^4.7.8", "lodash.clonedeep": "^4.5.0" diff --git a/packages/string-templates/src/manifest.json b/packages/string-templates/src/manifest.json index 5387f1e746..dce4af8665 100644 --- a/packages/string-templates/src/manifest.json +++ b/packages/string-templates/src/manifest.json @@ -1,105 +1,144 @@ { "math": { "abs": { - "args": ["a"], + "args": [ + "a" + ], "numArgs": 1, "example": "{{ abs 12012.1000 }} -> 12012.1", "description": "

Return the magnitude of a.

\n", "requiresBlock": false }, "add": { - "args": ["a", "b"], + "args": [ + "a", + "b" + ], "numArgs": 2, "example": "{{ add 1 2 }} -> 3", "description": "

Return the sum of a plus b.

\n", "requiresBlock": false }, "avg": { - "args": ["array"], + "args": [ + "array" + ], "numArgs": 1, "example": "{{ avg 1 2 3 4 5 }} -> 3", "description": "

Returns the average of all numbers in the given array.

\n", "requiresBlock": false }, "ceil": { - "args": ["value"], + "args": [ + "value" + ], "numArgs": 1, "example": "{{ ceil 1.2 }} -> 2", "description": "

Get the Math.ceil() of the given value.

\n", "requiresBlock": false }, "divide": { - "args": ["a", "b"], + "args": [ + "a", + "b" + ], "numArgs": 2, "example": "{{ divide 10 5 }} -> 2", "description": "

Divide a by b

\n", "requiresBlock": false }, "floor": { - "args": ["value"], + "args": [ + "value" + ], "numArgs": 1, "example": "{{ floor 1.2 }} -> 1", "description": "

Get the Math.floor() of the given value.

\n", "requiresBlock": false }, "minus": { - "args": ["a", "b"], + "args": [ + "a", + "b" + ], "numArgs": 2, "example": "{{ subtract 10 5 }} -> 5", "description": "

Return the product of a minus b.

\n", "requiresBlock": false }, "modulo": { - "args": ["a", "b"], + "args": [ + "a", + "b" + ], "numArgs": 2, "example": "{{ modulo 10 5 }} -> 0", "description": "

Get the remainder of a division operation.

\n", "requiresBlock": false }, "multiply": { - "args": ["a", "b"], + "args": [ + "a", + "b" + ], "numArgs": 2, "example": "{{ multiply 10 5 }} -> 50", "description": "

Multiply number a by number b.

\n", "requiresBlock": false }, "plus": { - "args": ["a", "b"], + "args": [ + "a", + "b" + ], "numArgs": 2, "example": "{{ plus 10 5 }} -> 15", "description": "

Add a by b.

\n", "requiresBlock": false }, "random": { - "args": ["min", "max"], + "args": [ + "min", + "max" + ], "numArgs": 2, "example": "{{ random 0 20 }} -> 10", "description": "

Generate a random number between two values

\n", "requiresBlock": false }, "remainder": { - "args": ["a", "b"], + "args": [ + "a", + "b" + ], "numArgs": 2, "example": "{{ remainder 10 6 }} -> 4", "description": "

Get the remainder when a is divided by b.

\n", "requiresBlock": false }, "round": { - "args": ["number"], + "args": [ + "number" + ], "numArgs": 1, "example": "{{ round 10.3 }} -> 10", "description": "

Round the given number.

\n", "requiresBlock": false }, "subtract": { - "args": ["a", "b"], + "args": [ + "a", + "b" + ], "numArgs": 2, "example": "{{ subtract 10 5 }} -> 5", "description": "

Return the product of a minus b.

\n", "requiresBlock": false }, "sum": { - "args": ["array"], + "args": [ + "array" + ], "numArgs": 1, "example": "{{ sum [1, 2, 3] }} -> 6", "description": "

Returns the sum of all numbers in the given array.

\n", @@ -108,196 +147,285 @@ }, "array": { "after": { - "args": ["array", "n"], + "args": [ + "array", + "n" + ], "numArgs": 2, "example": "{{ after ['a', 'b', 'c', 'd'] 2}} -> ['c', 'd']", "description": "

Returns all of the items in an array after the specified index. Opposite of before.

\n", "requiresBlock": false }, "arrayify": { - "args": ["value"], + "args": [ + "value" + ], "numArgs": 1, "example": "{{ arrayify 'foo' }} -> ['foo']", "description": "

Cast the given value to an array.

\n", "requiresBlock": false }, "before": { - "args": ["array", "n"], + "args": [ + "array", + "n" + ], "numArgs": 2, "example": "{{ before ['a', 'b', 'c', 'd'] 3}} -> ['a', 'b']", "description": "

Return all of the items in the collection before the specified count. Opposite of after.

\n", "requiresBlock": false }, "eachIndex": { - "args": ["array", "options"], + "args": [ + "array", + "options" + ], "numArgs": 2, "example": "{{#eachIndex [1, 2, 3]}} {{item}} is {{index}} {{/eachIndex}} -> ' 1 is 0 2 is 1 3 is 2 '", "description": "

Iterates the array, listing an item and the index of it.

\n", "requiresBlock": true }, "filter": { - "args": ["array", "value", "options"], + "args": [ + "array", + "value", + "options" + ], "numArgs": 3, "example": "{{#filter [1, 2, 3] 2}}2 Found{{else}}2 not found{{/filter}} -> 2 Found", "description": "

Block helper that filters the given array and renders the block for values that evaluate to true, otherwise the inverse block is returned.

\n", "requiresBlock": true }, "first": { - "args": ["array", "n"], + "args": [ + "array", + "n" + ], "numArgs": 2, "example": "{{first [1, 2, 3, 4] 2}} -> 1,2", "description": "

Returns the first item, or first n items of an array.

\n", "requiresBlock": false }, "forEach": { - "args": ["array", "options"], + "args": [ + "array", + "options" + ], "numArgs": 2, "example": "{{#forEach [{ 'name': 'John' }] }} {{ name }} {{/forEach}} -> ' John '", "description": "

Iterates over each item in an array and exposes the current item in the array as context to the inner block. In addition to the current array item, the helper exposes the following variables to the inner block: - index - total - isFirst - isLast Also, @index is exposed as a private variable, and additional private variables may be defined as hash arguments.

\n", "requiresBlock": true }, "inArray": { - "args": ["array", "value", "options"], + "args": [ + "array", + "value", + "options" + ], "numArgs": 3, "example": "{{#inArray [1, 2, 3] 2}} 2 exists {{else}} 2 does not exist {{/inArray}} -> ' 2 exists '", "description": "

Block helper that renders the block if an array has the given value. Optionally specify an inverse block to render when the array does not have the given value.

\n", "requiresBlock": true }, "isArray": { - "args": ["value"], + "args": [ + "value" + ], "numArgs": 1, "example": "{{isArray [1, 2]}} -> true", "description": "

Returns true if value is an es5 array.

\n", "requiresBlock": false }, "itemAt": { - "args": ["array", "idx"], + "args": [ + "array", + "idx" + ], "numArgs": 2, "example": "{{itemAt [1, 2, 3] 1}} -> 2", "description": "

Returns the item from array at index idx.

\n", "requiresBlock": false }, "join": { - "args": ["array", "separator"], + "args": [ + "array", + "separator" + ], "numArgs": 2, "example": "{{join [1, 2, 3]}} -> 1, 2, 3", "description": "

Join all elements of array into a string, optionally using a given separator.

\n", "requiresBlock": false }, "equalsLength": { - "args": ["value", "length"], + "args": [ + "value", + "length" + ], "numArgs": 2, "example": "{{equalsLength [1, 2, 3] 3}} -> true", "description": "

Returns true if the the length of the given value is equal to the given length. Can be used as a block or inline helper.

\n", "requiresBlock": false }, "last": { - "args": ["value", "n"], + "args": [ + "value", + "n" + ], "numArgs": 2, "example": "{{last [1, 2, 3]}} -> 3", "description": "

Returns the last item, or last n items of an array or string. Opposite of first.

\n", "requiresBlock": false }, "length": { - "args": ["value"], + "args": [ + "value" + ], "numArgs": 1, "example": "{{length [1, 2, 3]}} -> 3", "description": "

Returns the length of the given string or array.

\n", "requiresBlock": false }, "lengthEqual": { - "args": ["value", "length"], + "args": [ + "value", + "length" + ], "numArgs": 2, "example": "{{equalsLength [1, 2, 3] 3}} -> true", "description": "

Returns true if the the length of the given value is equal to the given length. Can be used as a block or inline helper.

\n", "requiresBlock": false }, "map": { - "args": ["array", "fn"], + "args": [ + "array", + "fn" + ], "numArgs": 2, "example": "{{map [1, 2, 3] double}} -> [2, 4, 6]", "description": "

Returns a new array, created by calling function on each element of the given array. For example,

\n", "requiresBlock": false }, "pluck": { - "args": ["collection", "prop"], + "args": [ + "collection", + "prop" + ], "numArgs": 2, "example": "{{pluck [{ 'name': 'Bob' }] 'name' }} -> ['Bob']", "description": "

Map over the given object or array or objects and create an array of values from the given prop. Dot-notation may be used (as a string) to get nested properties.

\n", "requiresBlock": false }, "reverse": { - "args": ["value"], + "args": [ + "value" + ], "numArgs": 1, "example": "{{reverse [1, 2, 3]}} -> [3, 2, 1]", "description": "

Reverse the elements in an array, or the characters in a string.

\n", "requiresBlock": false }, "some": { - "args": ["array", "iter", "provided"], + "args": [ + "array", + "iter", + "provided" + ], "numArgs": 3, "example": "{{#some [1, \"b\", 3] isString}} string found {{else}} No string found {{/some}} -> ' string found '", "description": "

Block helper that returns the block if the callback returns true for some value in the given array.

\n", "requiresBlock": true }, "sort": { - "args": ["array", "key"], + "args": [ + "array", + "key" + ], "numArgs": 2, "example": "{{ sort ['b', 'a', 'c'] }} -> ['a', 'b', 'c']", "description": "

Sort the given array. If an array of objects is passed, you may optionally pass a key to sort on as the second argument. You may alternatively pass a sorting function as the second argument.

\n", "requiresBlock": false }, "sortBy": { - "args": ["array", "props"], + "args": [ + "array", + "props" + ], "numArgs": 2, "example": "{{ sortBy [{'a': 'zzz'}, {'a': 'aaa'}] 'a' }} -> [{'a':'aaa'},{'a':'zzz'}]", "description": "

Sort an array. If an array of objects is passed, you may optionally pass a key to sort on as the second argument. You may alternatively pass a sorting function as the second argument.

\n", "requiresBlock": false }, "withAfter": { - "args": ["array", "idx", "options"], + "args": [ + "array", + "idx", + "options" + ], "numArgs": 3, "example": "{{#withAfter [1, 2, 3] 1 }} {{this}} {{/withAfter}} -> ' 2 3 '", "description": "

Use the items in the array after the specified index as context inside a block. Opposite of withBefore.

\n", "requiresBlock": true }, "withBefore": { - "args": ["array", "idx", "options"], + "args": [ + "array", + "idx", + "options" + ], "numArgs": 3, "example": "{{#withBefore [1, 2, 3] 2 }} {{this}} {{/withBefore}} -> ' 1 '", "description": "

Use the items in the array before the specified index as context inside a block. Opposite of withAfter.

\n", "requiresBlock": true }, "withFirst": { - "args": ["array", "idx", "options"], + "args": [ + "array", + "idx", + "options" + ], "numArgs": 3, "example": "{{#withFirst [1, 2, 3] }}{{this}}{{/withFirst}} -> 1", "description": "

Use the first item in a collection inside a handlebars block expression. Opposite of withLast.

\n", "requiresBlock": true }, "withGroup": { - "args": ["array", "size", "options"], + "args": [ + "array", + "size", + "options" + ], "numArgs": 3, "example": "{{#withGroup [1, 2, 3, 4] 2}}{{#each this}}{{.}}{{/each}}
{{/withGroup}} -> 12
34
", "description": "

Block helper that groups array elements by given group size.

\n", "requiresBlock": true }, "withLast": { - "args": ["array", "idx", "options"], + "args": [ + "array", + "idx", + "options" + ], "numArgs": 3, "example": "{{#withLast [1, 2, 3, 4]}}{{this}}{{/withLast}} -> 4", "description": "

Use the last item or n items in an array as context inside a block. Opposite of withFirst.

\n", "requiresBlock": true }, "withSort": { - "args": ["array", "prop", "options"], + "args": [ + "array", + "prop", + "options" + ], "numArgs": 3, "example": "{{#withSort ['b', 'a', 'c']}}{{this}}{{/withSort}} -> abc", "description": "

Block helper that sorts a collection and exposes the sorted collection as context inside the block.

\n", "requiresBlock": true }, "unique": { - "args": ["array", "options"], + "args": [ + "array", + "options" + ], "numArgs": 2, "example": "{{#each (unique ['a', 'a', 'c', 'b', 'e', 'e']) }}{{.}}{{/each}} -> acbe", "description": "

Block helper that return an array with all duplicate values removed. Best used along with a each helper.

\n", @@ -306,61 +434,83 @@ }, "number": { "bytes": { - "args": ["number"], + "args": [ + "number" + ], "numArgs": 1, "example": "{{ bytes 1386 1 }} -> 1.4 kB", "description": "

Format a number to it's equivalent in bytes. If a string is passed, it's length will be formatted and returned. Examples: - 'foo' => 3 B - 13661855 => 13.66 MB - 825399 => 825.39 kB - 1396 => 1.4 kB

\n", "requiresBlock": false }, "addCommas": { - "args": ["num"], + "args": [ + "num" + ], "numArgs": 1, "example": "{{ addCommas 1000000 }} -> 1,000,000", "description": "

Add commas to numbers

\n", "requiresBlock": false }, "phoneNumber": { - "args": ["num"], + "args": [ + "num" + ], "numArgs": 1, "example": "{{ phoneNumber 8005551212 }} -> (800) 555-1212", "description": "

Convert a string or number to a formatted phone number.

\n", "requiresBlock": false }, "toAbbr": { - "args": ["number", "precision"], + "args": [ + "number", + "precision" + ], "numArgs": 2, "example": "{{ toAbbr 10123 2 }} -> 10.12k", "description": "

Abbreviate numbers to the given number of precision. This for general numbers, not size in bytes.

\n", "requiresBlock": false }, "toExponential": { - "args": ["number", "fractionDigits"], + "args": [ + "number", + "fractionDigits" + ], "numArgs": 2, "example": "{{ toExponential 10123 2 }} -> 1.01e+4", "description": "

Returns a string representing the given number in exponential notation.

\n", "requiresBlock": false }, "toFixed": { - "args": ["number", "digits"], + "args": [ + "number", + "digits" + ], "numArgs": 2, "example": "{{ toFixed 1.1234 2 }} -> 1.12", "description": "

Formats the given number using fixed-point notation.

\n", "requiresBlock": false }, "toFloat": { - "args": ["number"], + "args": [ + "number" + ], "numArgs": 1, "description": "

Convert input to a float.

\n", "requiresBlock": false }, "toInt": { - "args": ["number"], + "args": [ + "number" + ], "numArgs": 1, "description": "

Convert input to an integer.

\n", "requiresBlock": false }, "toPrecision": { - "args": ["number", "precision"], + "args": [ + "number", + "precision" + ], "numArgs": 2, "example": "{{toPrecision '1.1234' 2}} -> 1.1", "description": "

Returns a string representing the Number object to the specified precision.

\n", @@ -369,49 +519,64 @@ }, "url": { "encodeURI": { - "args": ["str"], + "args": [ + "str" + ], "numArgs": 1, "example": "{{ encodeURI 'https://myurl?Hello There' }} -> https%3A%2F%2Fmyurl%3FHello%20There", "description": "

Encodes a Uniform Resource Identifier (URI) component by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character.

\n", "requiresBlock": false }, "escape": { - "args": ["str"], + "args": [ + "str" + ], "numArgs": 1, "example": "{{ escape 'https://myurl?Hello+There' }} -> https%3A%2F%2Fmyurl%3FHello%2BThere", "description": "

Escape the given string by replacing characters with escape sequences. Useful for allowing the string to be used in a URL, etc.

\n", "requiresBlock": false }, "decodeURI": { - "args": ["str"], + "args": [ + "str" + ], "numArgs": 1, "example": "{{ decodeURI 'https://myurl?Hello%20There' }} -> https://myurl?Hello There", "description": "

Decode a Uniform Resource Identifier (URI) component.

\n", "requiresBlock": false }, "urlResolve": { - "args": ["base", "href"], + "args": [ + "base", + "href" + ], "numArgs": 2, "example": "{{ urlResolve 'https://myurl' '/api/test' }} -> https://myurl/api/test", "description": "

Take a base URL, and a href URL, and resolve them as a browser would for an anchor tag.

\n", "requiresBlock": false }, "urlParse": { - "args": ["str"], + "args": [ + "str" + ], "numArgs": 1, "example": "{{ urlParse 'https://myurl/api/test' }}", "description": "

Parses a url string into an object.

\n", "requiresBlock": false }, "stripQuerystring": { - "args": ["url"], + "args": [ + "url" + ], "numArgs": 1, "example": "{{ stripQuerystring 'https://myurl/api/test?foo=bar' }} -> 'https://myurl/api/test'", "description": "

Strip the query string from the given url.

\n", "requiresBlock": false }, "stripProtocol": { - "args": ["str"], + "args": [ + "str" + ], "numArgs": 1, "example": "{{ stripProtocol 'https://myurl/api/test' }} -> '//myurl/api/test'", "description": "

Strip protocol from a url. Useful for displaying media that may have an 'http' protocol on secure connections.

\n", @@ -420,422 +585,595 @@ }, "string": { "append": { - "args": ["str", "suffix"], + "args": [ + "str", + "suffix" + ], "numArgs": 2, "example": "{{append 'index' '.html'}} -> index.html", "description": "

Append the specified suffix to the given string.

\n", "requiresBlock": false }, "camelcase": { - "args": ["string"], + "args": [ + "string" + ], "numArgs": 1, "example": "{{camelcase 'foo bar baz'}} -> fooBarBaz", "description": "

camelCase the characters in the given string.

\n", "requiresBlock": false }, "capitalize": { - "args": ["str"], + "args": [ + "str" + ], "numArgs": 1, "example": "{{capitalize 'foo bar baz'}} -> Foo bar baz", "description": "

Capitalize the first word in a sentence.

\n", "requiresBlock": false }, "capitalizeAll": { - "args": ["str"], + "args": [ + "str" + ], "numArgs": 1, "example": "{{ capitalizeAll 'foo bar baz'}} -> Foo Bar Baz", "description": "

Capitalize all words in a string.

\n", "requiresBlock": false }, "center": { - "args": ["str", "spaces"], + "args": [ + "str", + "spaces" + ], "numArgs": 2, "example": "{{ center 'test' 1}} -> ' test '", "description": "

Center a string using non-breaking spaces

\n", "requiresBlock": false }, "chop": { - "args": ["string"], + "args": [ + "string" + ], "numArgs": 1, "example": "{{ chop ' ABC '}} -> ABC", "description": "

Like trim, but removes both extraneous whitespace and non-word characters from the beginning and end of a string.

\n", "requiresBlock": false }, "dashcase": { - "args": ["string"], + "args": [ + "string" + ], "numArgs": 1, "example": "{{dashcase 'a-b-c d_e'}} -> a-b-c-d-e", "description": "

dash-case the characters in string. Replaces non-word characters and periods with hyphens.

\n", "requiresBlock": false }, "dotcase": { - "args": ["string"], + "args": [ + "string" + ], "numArgs": 1, "example": "{{dotcase 'a-b-c d_e'}} -> a.b.c.d.e", "description": "

dot.case the characters in string.

\n", "requiresBlock": false }, "downcase": { - "args": ["string"], + "args": [ + "string" + ], "numArgs": 1, "example": "{{downcase 'aBcDeF'}} -> abcdef", "description": "

Lowercase all of the characters in the given string. Alias for lowercase.

\n", "requiresBlock": false }, "ellipsis": { - "args": ["str", "length"], + "args": [ + "str", + "length" + ], "numArgs": 2, "example": "{{ellipsis 'foo bar baz' 7}} -> foo bar…", "description": "

Truncates a string to the specified length, and appends it with an elipsis, .

\n", "requiresBlock": false }, "hyphenate": { - "args": ["str"], + "args": [ + "str" + ], "numArgs": 1, "example": "{{hyphenate 'foo bar baz qux'}} -> foo-bar-baz-qux", "description": "

Replace spaces in a string with hyphens.

\n", "requiresBlock": false }, "isString": { - "args": ["value"], + "args": [ + "value" + ], "numArgs": 1, "example": "{{isString 'foo'}} -> true", "description": "

Return true if value is a string.

\n", "requiresBlock": false }, "lowercase": { - "args": ["str"], + "args": [ + "str" + ], "numArgs": 1, "example": "{{lowercase 'Foo BAR baZ'}} -> foo bar baz", "description": "

Lowercase all characters in the given string.

\n", "requiresBlock": false }, "occurrences": { - "args": ["str", "substring"], + "args": [ + "str", + "substring" + ], "numArgs": 2, "example": "{{occurrences 'foo bar foo bar baz' 'foo'}} -> 2", "description": "

Return the number of occurrences of substring within the given string.

\n", "requiresBlock": false }, "pascalcase": { - "args": ["string"], + "args": [ + "string" + ], "numArgs": 1, "example": "{{pascalcase 'foo bar baz'}} -> FooBarBaz", "description": "

PascalCase the characters in string.

\n", "requiresBlock": false }, "pathcase": { - "args": ["string"], + "args": [ + "string" + ], "numArgs": 1, "example": "{{pathcase 'a-b-c d_e'}} -> a/b/c/d/e", "description": "

path/case the characters in string.

\n", "requiresBlock": false }, "plusify": { - "args": ["str"], + "args": [ + "str" + ], "numArgs": 1, "example": "{{plusify 'foo bar baz'}} -> foo+bar+baz", "description": "

Replace spaces in the given string with pluses.

\n", "requiresBlock": false }, "prepend": { - "args": ["str", "prefix"], + "args": [ + "str", + "prefix" + ], "numArgs": 2, "example": "{{prepend 'bar' 'foo-'}} -> foo-bar", "description": "

Prepends the given string with the specified prefix.

\n", "requiresBlock": false }, "remove": { - "args": ["str", "substring"], + "args": [ + "str", + "substring" + ], "numArgs": 2, "example": "{{remove 'a b a b a b' 'a '}} -> b b b", "description": "

Remove all occurrences of substring from the given str.

\n", "requiresBlock": false }, "removeFirst": { - "args": ["str", "substring"], + "args": [ + "str", + "substring" + ], "numArgs": 2, "example": "{{removeFirst 'a b a b a b' 'a'}} -> ' b a b a b'", "description": "

Remove the first occurrence of substring from the given str.

\n", "requiresBlock": false }, "replace": { - "args": ["str", "a", "b"], + "args": [ + "str", + "a", + "b" + ], "numArgs": 3, "example": "{{replace 'a b a b a b' 'a' 'z'}} -> z b z b z b", "description": "

Replace all occurrences of substring a with substring b.

\n", "requiresBlock": false }, "replaceFirst": { - "args": ["str", "a", "b"], + "args": [ + "str", + "a", + "b" + ], "numArgs": 3, "example": "{{replaceFirst 'a b a b a b' 'a' 'z'}} -> z b a b a b", "description": "

Replace the first occurrence of substring a with substring b.

\n", "requiresBlock": false }, "sentence": { - "args": ["str"], + "args": [ + "str" + ], "numArgs": 1, "example": "{{sentence 'hello world. goodbye world.'}} -> Hello world. Goodbye world.", "description": "

Sentence case the given string

\n", "requiresBlock": false }, "snakecase": { - "args": ["string"], + "args": [ + "string" + ], "numArgs": 1, "example": "{{snakecase 'a-b-c d_e'}} -> a_b_c_d_e", "description": "

snake_case the characters in the given string.

\n", "requiresBlock": false }, "split": { - "args": ["string"], + "args": [ + "string" + ], "numArgs": 1, "example": "{{split 'a,b,c'}} -> ['a', 'b', 'c']", "description": "

Split string by the given character.

\n", "requiresBlock": false }, "startsWith": { - "args": ["prefix", "testString", "options"], + "args": [ + "prefix", + "testString", + "options" + ], "numArgs": 3, "example": "{{#startsWith 'Goodbye' 'Hello, world!'}}Yep{{else}}Nope{{/startsWith}} -> Nope", "description": "

Tests whether a string begins with the given prefix.

\n", "requiresBlock": true }, "titleize": { - "args": ["str"], + "args": [ + "str" + ], "numArgs": 1, "example": "{{titleize 'this is title case' }} -> This Is Title Case", "description": "

Title case the given string.

\n", "requiresBlock": false }, "trim": { - "args": ["string"], + "args": [ + "string" + ], "numArgs": 1, "example": "{{trim ' ABC ' }} -> ABC", "description": "

Removes extraneous whitespace from the beginning and end of a string.

\n", "requiresBlock": false }, "trimLeft": { - "args": ["string"], + "args": [ + "string" + ], "numArgs": 1, "example": "{{trimLeft ' ABC ' }} -> 'ABC '", "description": "

Removes extraneous whitespace from the beginning of a string.

\n", "requiresBlock": false }, "trimRight": { - "args": ["string"], + "args": [ + "string" + ], "numArgs": 1, "example": "{{trimRight ' ABC ' }} -> ' ABC'", "description": "

Removes extraneous whitespace from the end of a string.

\n", "requiresBlock": false }, "truncate": { - "args": ["str", "limit", "suffix"], + "args": [ + "str", + "limit", + "suffix" + ], "numArgs": 3, "example": "{{truncate 'foo bar baz' 7 }} -> foo bar", "description": "

Truncate a string to the specified length. Also see ellipsis.

\n", "requiresBlock": false }, "truncateWords": { - "args": ["str", "limit", "suffix"], + "args": [ + "str", + "limit", + "suffix" + ], "numArgs": 3, "example": "{{truncateWords 'foo bar baz' 1 }} -> foo…", "description": "

Truncate a string to have the specified number of words. Also see truncate.

\n", "requiresBlock": false }, "upcase": { - "args": ["string"], + "args": [ + "string" + ], "numArgs": 1, "example": "{{upcase 'aBcDef'}} -> ABCDEF", "description": "

Uppercase all of the characters in the given string. Alias for uppercase.

\n", "requiresBlock": false }, "uppercase": { - "args": ["str", "options"], + "args": [ + "str", + "options" + ], "numArgs": 2, "example": "{{uppercase 'aBcDef'}} -> ABCDEF", "description": "

Uppercase all of the characters in the given string. If used as a block helper it will uppercase the entire block. This helper does not support inverse blocks.

\n", "requiresBlock": false - }, - "lorem": { - "args": ["num"], - "numArgs": 1, - "example": "{{lorem 11}} -> Lorem ipsum", - "description": "

Takes a number and returns that many charaters of Lorem Ipsum

\n", - "requiresBlock": false } }, "comparison": { "and": { - "args": ["a", "b", "options"], + "args": [ + "a", + "b", + "options" + ], "numArgs": 3, "example": "{{#and great magnificent}}both{{else}}no{{/and}} -> no", "description": "

Helper that renders the block if both of the given values are truthy. If an inverse block is specified it will be rendered when falsy. Works as a block helper, inline helper or subexpression.

\n", "requiresBlock": true }, "compare": { - "args": ["a", "operator", "b", "options"], + "args": [ + "a", + "operator", + "b", + "options" + ], "numArgs": 4, "example": "{{compare 10 '<' 5 }} -> false", "description": "

Render a block when a comparison of the first and third arguments returns true. The second argument is the [arithemetic operator][operators] to use. You may also optionally specify an inverse block to render when falsy.

\n", "requiresBlock": false }, "contains": { - "args": ["collection", "value", "[startIndex=0]", "options"], + "args": [ + "collection", + "value", + "[startIndex=0]", + "options" + ], "numArgs": 4, "example": "{{#contains ['a', 'b', 'c'] 'd'}} This will not be rendered. {{else}} This will be rendered. {{/contains}} -> ' This will be rendered. '", "description": "

Block helper that renders the block if collection has the given value, using strict equality (===) for comparison, otherwise the inverse block is rendered (if specified). If a startIndex is specified and is negative, it is used as the offset from the end of the collection.

\n", "requiresBlock": true }, "default": { - "args": ["value", "defaultValue"], + "args": [ + "value", + "defaultValue" + ], "numArgs": 2, "example": "{{default null null 'default'}} -> default", "description": "

Returns the first value that is not undefined, otherwise the 'default' value is returned.

\n", "requiresBlock": false }, "eq": { - "args": ["a", "b", "options"], + "args": [ + "a", + "b", + "options" + ], "numArgs": 3, "example": "{{#eq 3 3}}equal{{else}}not equal{{/eq}} -> equal", "description": "

Block helper that renders a block if a is equal to b. If an inverse block is specified it will be rendered when falsy. You may optionally use the compare='' hash argument for the second value.

\n", "requiresBlock": true }, "gt": { - "args": ["a", "b", "options"], + "args": [ + "a", + "b", + "options" + ], "numArgs": 3, "example": "{{#gt 4 3}} greater than{{else}} not greater than{{/gt}} -> ' greater than'", "description": "

Block helper that renders a block if a is greater than b. If an inverse block is specified it will be rendered when falsy. You may optionally use the compare='' hash argument for the second value.

\n", "requiresBlock": true }, "gte": { - "args": ["a", "b", "options"], + "args": [ + "a", + "b", + "options" + ], "numArgs": 3, "example": "{{#gte 4 3}} greater than or equal{{else}} not greater than{{/gte}} -> ' greater than or equal'", "description": "

Block helper that renders a block if a is greater than or equal to b. If an inverse block is specified it will be rendered when falsy. You may optionally use the compare='' hash argument for the second value.

\n", "requiresBlock": true }, "has": { - "args": ["val", "pattern", "options"], + "args": [ + "val", + "pattern", + "options" + ], "numArgs": 3, "example": "{{#has 'foobar' 'foo'}}has it{{else}}doesn't{{/has}} -> has it", "description": "

Block helper that renders a block if value has pattern. If an inverse block is specified it will be rendered when falsy.

\n", "requiresBlock": true }, "isFalsey": { - "args": ["val", "options"], + "args": [ + "val", + "options" + ], "numArgs": 2, "example": "{{isFalsey '' }} -> true", "description": "

Returns true if the given value is falsey. Uses the [falsey][] library for comparisons. Please see that library for more information or to report bugs with this helper.

\n", "requiresBlock": false }, "isTruthy": { - "args": ["val", "options"], + "args": [ + "val", + "options" + ], "numArgs": 2, "example": "{{isTruthy '12' }} -> true", "description": "

Returns true if the given value is truthy. Uses the [falsey][] library for comparisons. Please see that library for more information or to report bugs with this helper.

\n", "requiresBlock": false }, "ifEven": { - "args": ["number", "options"], + "args": [ + "number", + "options" + ], "numArgs": 2, "example": "{{#ifEven 2}} even {{else}} odd {{/ifEven}} -> ' even '", "description": "

Return true if the given value is an even number.

\n", "requiresBlock": true }, "ifNth": { - "args": ["a", "b", "options"], + "args": [ + "a", + "b", + "options" + ], "numArgs": 3, "example": "{{#ifNth 2 10}}remainder{{else}}no remainder{{/ifNth}} -> remainder", "description": "

Conditionally renders a block if the remainder is zero when b operand is divided by a. If an inverse block is specified it will be rendered when the remainder is not zero.

\n", "requiresBlock": true }, "ifOdd": { - "args": ["value", "options"], + "args": [ + "value", + "options" + ], "numArgs": 2, "example": "{{#ifOdd 3}}odd{{else}}even{{/ifOdd}} -> odd", "description": "

Block helper that renders a block if value is an odd number. If an inverse block is specified it will be rendered when falsy.

\n", "requiresBlock": true }, "is": { - "args": ["a", "b", "options"], + "args": [ + "a", + "b", + "options" + ], "numArgs": 3, "example": "{{#is 3 3}} is {{else}} is not {{/is}} -> ' is '", "description": "

Block helper that renders a block if a is equal to b. If an inverse block is specified it will be rendered when falsy. Similar to eq but does not do strict equality.

\n", "requiresBlock": true }, "isnt": { - "args": ["a", "b", "options"], + "args": [ + "a", + "b", + "options" + ], "numArgs": 3, "example": "{{#isnt 3 3}} isnt {{else}} is {{/isnt}} -> ' is '", "description": "

Block helper that renders a block if a is not equal to b. If an inverse block is specified it will be rendered when falsy. Similar to unlessEq but does not use strict equality for comparisons.

\n", "requiresBlock": true }, "lt": { - "args": ["context", "options"], + "args": [ + "context", + "options" + ], "numArgs": 2, "example": "{{#lt 2 3}} less than {{else}} more than or equal {{/lt}} -> ' less than '", "description": "

Block helper that renders a block if a is less than b. If an inverse block is specified it will be rendered when falsy. You may optionally use the compare='' hash argument for the second value.

\n", "requiresBlock": true }, "lte": { - "args": ["a", "b", "options"], + "args": [ + "a", + "b", + "options" + ], "numArgs": 3, "example": "{{#lte 2 3}} less than or equal {{else}} more than {{/lte}} -> ' less than or equal '", "description": "

Block helper that renders a block if a is less than or equal to b. If an inverse block is specified it will be rendered when falsy. You may optionally use the compare='' hash argument for the second value.

\n", "requiresBlock": true }, "neither": { - "args": ["a", "b", "options"], + "args": [ + "a", + "b", + "options" + ], "numArgs": 3, "example": "{{#neither null null}}both falsey{{else}}both not falsey{{/neither}} -> both falsey", "description": "

Block helper that renders a block if neither of the given values are truthy. If an inverse block is specified it will be rendered when falsy.

\n", "requiresBlock": true }, "not": { - "args": ["val", "options"], + "args": [ + "val", + "options" + ], "numArgs": 2, "example": "{{#not undefined }}falsey{{else}}not falsey{{/not}} -> falsey", "description": "

Returns true if val is falsey. Works as a block or inline helper.

\n", "requiresBlock": true }, "or": { - "args": ["arguments", "options"], + "args": [ + "arguments", + "options" + ], "numArgs": 2, "example": "{{#or 1 2 undefined }} at least one truthy {{else}} all falsey {{/or}} -> ' at least one truthy '", "description": "

Block helper that renders a block if any of the given values is truthy. If an inverse block is specified it will be rendered when falsy.

\n", "requiresBlock": true }, "unlessEq": { - "args": ["a", "b", "options"], + "args": [ + "a", + "b", + "options" + ], "numArgs": 3, "example": "{{#unlessEq 2 1 }} not equal {{else}} equal {{/unlessEq}} -> ' not equal '", "description": "

Block helper that always renders the inverse block unless a is equal to b.

\n", "requiresBlock": true }, "unlessGt": { - "args": ["a", "b", "options"], + "args": [ + "a", + "b", + "options" + ], "numArgs": 3, "example": "{{#unlessGt 20 1 }} not greater than {{else}} greater than {{/unlessGt}} -> ' greater than '", "description": "

Block helper that always renders the inverse block unless a is greater than b.

\n", "requiresBlock": true }, "unlessLt": { - "args": ["a", "b", "options"], + "args": [ + "a", + "b", + "options" + ], "numArgs": 3, "example": "{{#unlessLt 20 1 }}greater than or equal{{else}}less than{{/unlessLt}} -> greater than or equal", "description": "

Block helper that always renders the inverse block unless a is less than b.

\n", "requiresBlock": true }, "unlessGteq": { - "args": ["a", "b", "options"], + "args": [ + "a", + "b", + "options" + ], "numArgs": 3, "example": "{{#unlessGteq 20 1 }} less than {{else}}greater than or equal to{{/unlessGteq}} -> greater than or equal to", "description": "

Block helper that always renders the inverse block unless a is greater than or equal to b.

\n", "requiresBlock": true }, "unlessLteq": { - "args": ["a", "b", "options"], + "args": [ + "a", + "b", + "options" + ], "numArgs": 3, "example": "{{#unlessLteq 20 1 }} greater than {{else}} less than or equal to {{/unlessLteq}} -> ' greater than '", "description": "

Block helper that always renders the inverse block unless a is less than or equal to b.

\n", @@ -844,85 +1182,122 @@ }, "object": { "extend": { - "args": ["objects"], + "args": [ + "objects" + ], "numArgs": 1, "description": "

Extend the context with the properties of other objects. A shallow merge is performed to avoid mutating the context.

\n", "requiresBlock": false }, "forIn": { - "args": ["context", "options"], + "args": [ + "context", + "options" + ], "numArgs": 2, "description": "

Block helper that iterates over the properties of an object, exposing each key and value on the context.

\n", "requiresBlock": true }, "forOwn": { - "args": ["obj", "options"], + "args": [ + "obj", + "options" + ], "numArgs": 2, "description": "

Block helper that iterates over the own properties of an object, exposing each key and value on the context.

\n", "requiresBlock": true }, "toPath": { - "args": ["prop"], + "args": [ + "prop" + ], "numArgs": 1, "description": "

Take arguments and, if they are string or number, convert them to a dot-delineated object property path.

\n", "requiresBlock": false }, "get": { - "args": ["prop", "context", "options"], + "args": [ + "prop", + "context", + "options" + ], "numArgs": 3, "description": "

Use property paths (a.b.c) to get a value or nested value from the context. Works as a regular helper or block helper.

\n", "requiresBlock": true }, "getObject": { - "args": ["prop", "context"], + "args": [ + "prop", + "context" + ], "numArgs": 2, "description": "

Use property paths (a.b.c) to get an object from the context. Differs from the get helper in that this helper will return the actual object, including the given property key. Also, this helper does not work as a block helper.

\n", "requiresBlock": false }, "hasOwn": { - "args": ["key", "context"], + "args": [ + "key", + "context" + ], "numArgs": 2, "description": "

Return true if key is an own, enumerable property of the given context object.

\n", "requiresBlock": false }, "isObject": { - "args": ["value"], + "args": [ + "value" + ], "numArgs": 1, "description": "

Return true if value is an object.

\n", "requiresBlock": false }, "JSONparse": { - "args": ["string"], + "args": [ + "string" + ], "numArgs": 1, "description": "

Parses the given string using JSON.parse.

\n", "requiresBlock": true }, "JSONstringify": { - "args": ["obj"], + "args": [ + "obj" + ], "numArgs": 1, "description": "

Stringify an object using JSON.stringify.

\n", "requiresBlock": false }, "merge": { - "args": ["object", "objects"], + "args": [ + "object", + "objects" + ], "numArgs": 2, "description": "

Deeply merge the properties of the given objects with the context object.

\n", "requiresBlock": false }, "parseJSON": { - "args": ["string"], + "args": [ + "string" + ], "numArgs": 1, "description": "

Parses the given string using JSON.parse.

\n", "requiresBlock": true }, "pick": { - "args": ["properties", "context", "options"], + "args": [ + "properties", + "context", + "options" + ], "numArgs": 3, "description": "

Pick properties from the context object.

\n", "requiresBlock": true }, "stringify": { - "args": ["obj"], + "args": [ + "obj" + ], "numArgs": 1, "description": "

Stringify an object using JSON.stringify.

\n", "requiresBlock": false @@ -939,16 +1314,22 @@ }, "date": { "date": { - "args": ["datetime", "format"], + "args": [ + "datetime", + "format" + ], "numArgs": 2, "example": "{{date now \"DD-MM-YYYY\" \"America/New_York\" }} -> 21-01-2021", "description": "

Format a date using moment.js date formatting - the timezone is optional and uses the tz database.

\n" }, "duration": { - "args": ["time", "durationType"], + "args": [ + "time", + "durationType" + ], "numArgs": 2, "example": "{{duration 8 \"seconds\"}} -> a few seconds", "description": "

Produce a humanized duration left/until given an amount of time and the type of time measurement.

\n" } } -} +} \ No newline at end of file From 004db2d414414c8eee75a5566e6074f3f7ed3eb7 Mon Sep 17 00:00:00 2001 From: mikesealey Date: Thu, 4 Jul 2024 16:56:25 +0100 Subject: [PATCH 3/5] prepares manifest for Lorem Ipsum handlebar helper --- packages/string-templates/package.json | 2 +- packages/string-templates/src/manifest.json | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index ca7c7485cd..17f26604a3 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -26,7 +26,7 @@ "manifest": "ts-node ./scripts/gen-collection-info.ts" }, "dependencies": { - "@budibase/handlebars-helpers": "^0.13.1", + "@budibase/handlebars-helpers": "^0.13.2", "dayjs": "^1.10.8", "handlebars": "^4.7.8", "lodash.clonedeep": "^4.5.0" diff --git a/packages/string-templates/src/manifest.json b/packages/string-templates/src/manifest.json index dce4af8665..2af84caa08 100644 --- a/packages/string-templates/src/manifest.json +++ b/packages/string-templates/src/manifest.json @@ -907,6 +907,15 @@ "example": "{{uppercase 'aBcDef'}} -> ABCDEF", "description": "

Uppercase all of the characters in the given string. If used as a block helper it will uppercase the entire block. This helper does not support inverse blocks.

\n", "requiresBlock": false + }, + "lorem": { + "args": [ + "num" + ], + "numArgs": 1, + "example": "{{lorem 11}} -> Lorem ipsum", + "description": "

Takes a number and returns that many charaters of Lorem Ipsum

\n", + "requiresBlock": false } }, "comparison": { From e41f5c6d92aba955ffb264c89ff4779eedd4d157 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 5 Jul 2024 12:45:19 +0100 Subject: [PATCH 4/5] Updating bundle and adding specific test for ipsum --- .../bundles/index-helpers.ivm.bundle.js | 24 ++++++++++++++++++- .../src/jsRunner/tests/jsRunner.spec.ts | 10 +++++++- yarn.lock | 10 ++++---- 3 files changed, 37 insertions(+), 7 deletions(-) diff --git a/packages/server/src/jsRunner/bundles/index-helpers.ivm.bundle.js b/packages/server/src/jsRunner/bundles/index-helpers.ivm.bundle.js index 55af2db6e2..89b2afb706 100644 --- a/packages/server/src/jsRunner/bundles/index-helpers.ivm.bundle.js +++ b/packages/server/src/jsRunner/bundles/index-helpers.ivm.bundle.js @@ -1,4 +1,26 @@ -"use strict";var helpers=(()=>{var Mn=Object.create;var je=Object.defineProperty;var An=Object.getOwnPropertyDescriptor;var kn=Object.getOwnPropertyNames;var Dn=Object.getPrototypeOf,Un=Object.prototype.hasOwnProperty;var oe=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var V=(e,t)=>()=>(e&&(t=e(e=0)),t);var T=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),mt=(e,t)=>{for(var r in t)je(e,r,{get:t[r],enumerable:!0})},yt=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of kn(t))!Un.call(e,i)&&i!==r&&je(e,i,{get:()=>t[i],enumerable:!(n=An(t,i))||n.enumerable});return e};var F=(e,t,r)=>(r=e!=null?Mn(Dn(e)):{},yt(t||!e||!e.__esModule?je(r,"default",{value:e,enumerable:!0}):r,e)),gt=e=>yt(je({},"__esModule",{value:!0}),e);var vt=T((Ye,Ce)=>{(function(e,t){typeof Ye=="object"&&typeof Ce<"u"?Ce.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs=t()})(Ye,function(){"use strict";var e=1e3,t=6e4,r=36e5,n="millisecond",i="second",u="minute",s="hour",f="day",w="week",y="month",l="quarter",x="year",v="date",a="Invalid Date",U=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,q=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,I={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function($){var h=["th","st","nd","rd"],c=$%100;return"["+$+(h[(c-20)%10]||h[c]||h[0])+"]"}},C=function($,h,c){var b=String($);return!b||b.length>=h?$:""+Array(h+1-b.length).join(c)+$},H={s:C,z:function($){var h=-$.utcOffset(),c=Math.abs(h),b=Math.floor(c/60),d=c%60;return(h<=0?"+":"-")+C(b,2,"0")+":"+C(d,2,"0")},m:function $(h,c){if(h.date()1)return $(M[0])}else{var W=h.name;S[W]=h,d=W}return!b&&d&&(Y=d),d||!b&&Y},j=function($,h){if(o($))return $.clone();var c=typeof h=="object"?h:{};return c.date=$,c.args=arguments,new z(c)},O=H;O.l=D,O.i=o,O.w=function($,h){return j($,{locale:h.$L,utc:h.$u,x:h.$x,$offset:h.$offset})};var z=function(){function $(c){this.$L=D(c.locale,null,!0),this.parse(c),this.$x=this.$x||c.x||{},this[p]=!0}var h=$.prototype;return h.parse=function(c){this.$d=function(b){var d=b.date,N=b.utc;if(d===null)return new Date(NaN);if(O.u(d))return new Date;if(d instanceof Date)return new Date(d);if(typeof d=="string"&&!/Z$/i.test(d)){var M=d.match(U);if(M){var W=M[2]-1||0,B=(M[7]||"0").substring(0,3);return N?new Date(Date.UTC(M[1],W,M[3]||1,M[4]||0,M[5]||0,M[6]||0,B)):new Date(M[1],W,M[3]||1,M[4]||0,M[5]||0,M[6]||0,B)}}return new Date(d)}(c),this.init()},h.init=function(){var c=this.$d;this.$y=c.getFullYear(),this.$M=c.getMonth(),this.$D=c.getDate(),this.$W=c.getDay(),this.$H=c.getHours(),this.$m=c.getMinutes(),this.$s=c.getSeconds(),this.$ms=c.getMilliseconds()},h.$utils=function(){return O},h.isValid=function(){return this.$d.toString()!==a},h.isSame=function(c,b){var d=j(c);return this.startOf(b)<=d&&d<=this.endOf(b)},h.isAfter=function(c,b){return j(c){(function(e,t){typeof Ee=="object"&&typeof qe<"u"?qe.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs_plugin_duration=t()})(Ee,function(){"use strict";var e,t,r=1e3,n=6e4,i=36e5,u=864e5,s=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,f=31536e6,w=2628e6,y=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,l={years:f,months:w,days:u,hours:i,minutes:n,seconds:r,milliseconds:1,weeks:6048e5},x=function(S){return S instanceof H},v=function(S,p,o){return new H(S,o,p.$l)},a=function(S){return t.p(S)+"s"},U=function(S){return S<0},q=function(S){return U(S)?Math.ceil(S):Math.floor(S)},I=function(S){return Math.abs(S)},C=function(S,p){return S?U(S)?{negative:!0,format:""+I(S)+p}:{negative:!1,format:""+S+p}:{negative:!1,format:""}},H=function(){function S(o,D,j){var O=this;if(this.$d={},this.$l=j,o===void 0&&(this.$ms=0,this.parseFromMilliseconds()),D)return v(o*l[a(D)],this);if(typeof o=="number")return this.$ms=o,this.parseFromMilliseconds(),this;if(typeof o=="object")return Object.keys(o).forEach(function($){O.$d[a($)]=o[$]}),this.calMilliseconds(),this;if(typeof o=="string"){var z=o.match(y);if(z){var J=z.slice(2).map(function($){return $!=null?Number($):0});return this.$d.years=J[0],this.$d.months=J[1],this.$d.weeks=J[2],this.$d.days=J[3],this.$d.hours=J[4],this.$d.minutes=J[5],this.$d.seconds=J[6],this.calMilliseconds(),this}}return this}var p=S.prototype;return p.calMilliseconds=function(){var o=this;this.$ms=Object.keys(this.$d).reduce(function(D,j){return D+(o.$d[j]||0)*l[j]},0)},p.parseFromMilliseconds=function(){var o=this.$ms;this.$d.years=q(o/f),o%=f,this.$d.months=q(o/w),o%=w,this.$d.days=q(o/u),o%=u,this.$d.hours=q(o/i),o%=i,this.$d.minutes=q(o/n),o%=n,this.$d.seconds=q(o/r),o%=r,this.$d.milliseconds=o},p.toISOString=function(){var o=C(this.$d.years,"Y"),D=C(this.$d.months,"M"),j=+this.$d.days||0;this.$d.weeks&&(j+=7*this.$d.weeks);var O=C(j,"D"),z=C(this.$d.hours,"H"),J=C(this.$d.minutes,"M"),$=this.$d.seconds||0;this.$d.milliseconds&&($+=this.$d.milliseconds/1e3,$=Math.round(1e3*$)/1e3);var h=C($,"S"),c=o.negative||D.negative||O.negative||z.negative||J.negative||h.negative,b=z.format||J.format||h.format?"T":"",d=(c?"-":"")+"P"+o.format+D.format+O.format+b+z.format+J.format+h.format;return d==="P"||d==="-P"?"P0D":d},p.toJSON=function(){return this.toISOString()},p.format=function(o){var D=o||"YYYY-MM-DDTHH:mm:ss",j={Y:this.$d.years,YY:t.s(this.$d.years,2,"0"),YYYY:t.s(this.$d.years,4,"0"),M:this.$d.months,MM:t.s(this.$d.months,2,"0"),D:this.$d.days,DD:t.s(this.$d.days,2,"0"),H:this.$d.hours,HH:t.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:t.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:t.s(this.$d.seconds,2,"0"),SSS:t.s(this.$d.milliseconds,3,"0")};return D.replace(s,function(O,z){return z||String(j[O])})},p.as=function(o){return this.$ms/l[a(o)]},p.get=function(o){var D=this.$ms,j=a(o);return j==="milliseconds"?D%=1e3:D=j==="weeks"?q(D/l[j]):this.$d[j],D||0},p.add=function(o,D,j){var O;return O=D?o*l[a(D)]:x(o)?o.$ms:v(o,this).$ms,v(this.$ms+O*(j?-1:1),this)},p.subtract=function(o,D){return this.add(o,D,!0)},p.locale=function(o){var D=this.clone();return D.$l=o,D},p.clone=function(){return v(this.$ms,this)},p.humanize=function(o){return e().add(this.$ms,"ms").locale(this.$l).fromNow(!o)},p.valueOf=function(){return this.asMilliseconds()},p.milliseconds=function(){return this.get("milliseconds")},p.asMilliseconds=function(){return this.as("milliseconds")},p.seconds=function(){return this.get("seconds")},p.asSeconds=function(){return this.as("seconds")},p.minutes=function(){return this.get("minutes")},p.asMinutes=function(){return this.as("minutes")},p.hours=function(){return this.get("hours")},p.asHours=function(){return this.as("hours")},p.days=function(){return this.get("days")},p.asDays=function(){return this.as("days")},p.weeks=function(){return this.get("weeks")},p.asWeeks=function(){return this.as("weeks")},p.months=function(){return this.get("months")},p.asMonths=function(){return this.as("months")},p.years=function(){return this.get("years")},p.asYears=function(){return this.as("years")},S}(),Y=function(S,p,o){return S.add(p.years()*o,"y").add(p.months()*o,"M").add(p.days()*o,"d").add(p.hours()*o,"h").add(p.minutes()*o,"m").add(p.seconds()*o,"s").add(p.milliseconds()*o,"ms")};return function(S,p,o){e=o,t=o().$utils(),o.duration=function(O,z){var J=o.locale();return v(O,{$l:J},z)},o.isDuration=x;var D=p.prototype.add,j=p.prototype.subtract;p.prototype.add=function(O,z){return x(O)?Y(this,O,1):D.bind(this)(O,z)},p.prototype.subtract=function(O,z){return x(O)?Y(this,O,-1):j.bind(this)(O,z)}}})});var bt=T((Ie,We)=>{(function(e,t){typeof Ie=="object"&&typeof We<"u"?We.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs_plugin_advancedFormat=t()})(Ie,function(){"use strict";return function(e,t){var r=t.prototype,n=r.format;r.format=function(i){var u=this,s=this.$locale();if(!this.isValid())return n.bind(this)(i);var f=this.$utils(),w=(i||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,function(y){switch(y){case"Q":return Math.ceil((u.$M+1)/3);case"Do":return s.ordinal(u.$D);case"gggg":return u.weekYear();case"GGGG":return u.isoWeekYear();case"wo":return s.ordinal(u.week(),"W");case"w":case"ww":return f.s(u.week(),y==="w"?1:2,"0");case"W":case"WW":return f.s(u.isoWeek(),y==="W"?1:2,"0");case"k":case"kk":return f.s(String(u.$H===0?24:u.$H),y==="k"?1:2,"0");case"X":return Math.floor(u.$d.getTime()/1e3);case"x":return u.$d.getTime();case"z":return"["+u.offsetName()+"]";case"zzz":return"["+u.offsetName("long")+"]";default:return y}});return n.bind(this)(w)}}})});var wt=T((_e,Fe)=>{(function(e,t){typeof _e=="object"&&typeof Fe<"u"?Fe.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs_plugin_isoWeek=t()})(_e,function(){"use strict";var e="day";return function(t,r,n){var i=function(f){return f.add(4-f.isoWeekday(),e)},u=r.prototype;u.isoWeekYear=function(){return i(this).year()},u.isoWeek=function(f){if(!this.$utils().u(f))return this.add(7*(f-this.isoWeek()),e);var w,y,l,x,v=i(this),a=(w=this.isoWeekYear(),y=this.$u,l=(y?n.utc:n)().year(w).startOf("year"),x=4-l.isoWeekday(),l.isoWeekday()>4&&(x+=7),l.add(x,e));return v.diff(a,"week")+1},u.isoWeekday=function(f){return this.$utils().u(f)?this.day()||7:this.day(this.day()%7?f:f-7)};var s=u.startOf;u.startOf=function(f,w){var y=this.$utils(),l=!!y.u(w)||w;return y.p(f)==="isoweek"?l?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):s.bind(this)(f,w)}}})});var Ot=T((He,Be)=>{(function(e,t){typeof He=="object"&&typeof Be<"u"?Be.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs_plugin_weekYear=t()})(He,function(){"use strict";return function(e,t){t.prototype.weekYear=function(){var r=this.month(),n=this.week(),i=this.year();return n===1&&r===11?i+1:r===0&&n>=52?i-1:i}}})});var xt=T((ze,Le)=>{(function(e,t){typeof ze=="object"&&typeof Le<"u"?Le.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs_plugin_weekOfYear=t()})(ze,function(){"use strict";var e="week",t="year";return function(r,n,i){var u=n.prototype;u.week=function(s){if(s===void 0&&(s=null),s!==null)return this.add(7*(s-this.week()),"day");var f=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var w=i(this).startOf(t).add(1,t).date(f),y=i(this).endOf(e);if(w.isBefore(y))return 1}var l=i(this).startOf(t).date(f).startOf(e).subtract(1,"millisecond"),x=this.diff(l,e,!0);return x<0?i(this).startOf("week").week():Math.ceil(x)},u.weeks=function(s){return s===void 0&&(s=null),this.week(s)}}})});var St=T((Pe,Re)=>{(function(e,t){typeof Pe=="object"&&typeof Re<"u"?Re.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs_plugin_relativeTime=t()})(Pe,function(){"use strict";return function(e,t,r){e=e||{};var n=t.prototype,i={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function u(f,w,y,l){return n.fromToBase(f,w,y,l)}r.en.relativeTime=i,n.fromToBase=function(f,w,y,l,x){for(var v,a,U,q=y.$locale().relativeTime||i,I=e.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],C=I.length,H=0;H0,S<=Y.r||!Y.r){S<=1&&H>0&&(Y=I[H-1]);var p=q[Y.l];x&&(S=x(""+S)),a=typeof p=="string"?p.replace("%d",S):p(S,w,Y.l,U);break}}if(w)return a;var o=U?q.future:q.past;return typeof o=="function"?o(a):o.replace("%s",a)},n.to=function(f,w){return u(f,w,this,!0)},n.from=function(f,w){return u(f,w,this)};var s=function(f){return f.$u?r.utc():r()};n.toNow=function(f){return this.to(s(this),f)},n.fromNow=function(f){return this.from(s(this),f)}}})});var jt=T((Ge,Je)=>{(function(e,t){typeof Ge=="object"&&typeof Je<"u"?Je.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs_plugin_utc=t()})(Ge,function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(n,i,u){var s=i.prototype;u.utc=function(a){var U={date:a,utc:!0,args:arguments};return new i(U)},s.utc=function(a){var U=u(this.toDate(),{locale:this.$L,utc:!0});return a?U.add(this.utcOffset(),e):U},s.local=function(){return u(this.toDate(),{locale:this.$L,utc:!1})};var f=s.parse;s.parse=function(a){a.utc&&(this.$u=!0),this.$utils().u(a.$offset)||(this.$offset=a.$offset),f.call(this,a)};var w=s.init;s.init=function(){if(this.$u){var a=this.$d;this.$y=a.getUTCFullYear(),this.$M=a.getUTCMonth(),this.$D=a.getUTCDate(),this.$W=a.getUTCDay(),this.$H=a.getUTCHours(),this.$m=a.getUTCMinutes(),this.$s=a.getUTCSeconds(),this.$ms=a.getUTCMilliseconds()}else w.call(this)};var y=s.utcOffset;s.utcOffset=function(a,U){var q=this.$utils().u;if(q(a))return this.$u?0:q(this.$offset)?y.call(this):this.$offset;if(typeof a=="string"&&(a=function(Y){Y===void 0&&(Y="");var S=Y.match(t);if(!S)return null;var p=(""+S[0]).match(r)||["-",0,0],o=p[0],D=60*+p[1]+ +p[2];return D===0?0:o==="+"?D:-D}(a),a===null))return this;var I=Math.abs(a)<=16?60*a:a,C=this;if(U)return C.$offset=I,C.$u=a===0,C;if(a!==0){var H=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(C=this.local().add(I+H,e)).$offset=I,C.$x.$localOffset=H}else C=this.utc();return C};var l=s.format;s.format=function(a){var U=a||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return l.call(this,U)},s.valueOf=function(){var a=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*a},s.isUTC=function(){return!!this.$u},s.toISOString=function(){return this.toDate().toISOString()},s.toString=function(){return this.toDate().toUTCString()};var x=s.toDate;s.toDate=function(a){return a==="s"&&this.$offset?u(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():x.call(this)};var v=s.diff;s.diff=function(a,U,q){if(a&&this.$u===a.$u)return v.call(this,a,U,q);var I=this.local(),C=u(a).local();return v.call(I,C,U,q)}}})});var Nt=T((Ze,Ve)=>{(function(e,t){typeof Ze=="object"&&typeof Ve<"u"?Ve.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs_plugin_timezone=t()})(Ze,function(){"use strict";var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(r,n,i){var u,s=function(l,x,v){v===void 0&&(v={});var a=new Date(l),U=function(q,I){I===void 0&&(I={});var C=I.timeZoneName||"short",H=q+"|"+C,Y=t[H];return Y||(Y=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:q,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:C}),t[H]=Y),Y}(x,v);return U.formatToParts(a)},f=function(l,x){for(var v=s(l,x),a=[],U=0;U=0&&(a[H]=parseInt(C,10))}var Y=a[3],S=Y===24?0:Y,p=a[0]+"-"+a[1]+"-"+a[2]+" "+S+":"+a[4]+":"+a[5]+":000",o=+l;return(i.utc(p).valueOf()-(o-=o%1e3))/6e4},w=n.prototype;w.tz=function(l,x){l===void 0&&(l=u);var v=this.utcOffset(),a=this.toDate(),U=a.toLocaleString("en-US",{timeZone:l}),q=Math.round((a-new Date(U))/1e3/60),I=i(U,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(15*-Math.round(a.getTimezoneOffset()/15)-q,!0);if(x){var C=I.utcOffset();I=I.add(v-C,"minute")}return I.$x.$timezone=l,I},w.offsetName=function(l){var x=this.$x.$timezone||i.tz.guess(),v=s(this.valueOf(),x,{timeZoneName:l}).find(function(a){return a.type.toLowerCase()==="timezonename"});return v&&v.value};var y=w.startOf;w.startOf=function(l,x){if(!this.$x||!this.$x.$timezone)return y.call(this,l,x);var v=i(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return y.call(v,l,x).tz(this.$x.$timezone,!0)},i.tz=function(l,x,v){var a=v&&x,U=v||x||u,q=f(+i(),U);if(typeof l!="string")return i(l).tz(U);var I=function(S,p,o){var D=S-60*p*1e3,j=f(D,o);if(p===j)return[D,p];var O=f(D-=60*(j-p)*1e3,o);return j===O?[D,j]:[S-60*Math.min(j,O)*1e3,Math.max(j,O)]}(i.utc(l,a).valueOf(),q,U),C=I[0],H=I[1],Y=i(C).utcOffset(H);return Y.$x.$timezone=U,Y},i.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},i.tz.setDefault=function(l){u=l}}})});var et=T((Pi,_t)=>{_t.exports=function(e){return e!=null&&(Wt(e)||Tn(e)||!!e._isBuffer)};function Wt(e){return!!e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function Tn(e){return typeof e.readFloatLE=="function"&&typeof e.slice=="function"&&Wt(e.slice(0,0))}});var Ht=T((Ri,Ft)=>{var Yn=et(),Cn=Object.prototype.toString;Ft.exports=function(t){if(typeof t>"u")return"undefined";if(t===null)return"null";if(t===!0||t===!1||t instanceof Boolean)return"boolean";if(typeof t=="string"||t instanceof String)return"string";if(typeof t=="number"||t instanceof Number)return"number";if(typeof t=="function"||t instanceof Function)return"function";if(typeof Array.isArray<"u"&&Array.isArray(t))return"array";if(t instanceof RegExp)return"regexp";if(t instanceof Date)return"date";var r=Cn.call(t);return r==="[object RegExp]"?"regexp":r==="[object Date]"?"date":r==="[object Arguments]"?"arguments":r==="[object Error]"?"error":Yn(t)?"buffer":r==="[object Set]"?"set":r==="[object WeakSet]"?"weakset":r==="[object Map]"?"map":r==="[object WeakMap]"?"weakmap":r==="[object Symbol]"?"symbol":r==="[object Int8Array]"?"int8array":r==="[object Uint8Array]"?"uint8array":r==="[object Uint8ClampedArray]"?"uint8clampedarray":r==="[object Int16Array]"?"int16array":r==="[object Uint16Array]"?"uint16array":r==="[object Int32Array]"?"int32array":r==="[object Uint32Array]"?"uint32array":r==="[object Float32Array]"?"float32array":r==="[object Float64Array]"?"float64array":"object"}});var Pt=T((Gi,Lt)=>{"use strict";var Bt=Ht(),zt={arguments:"an arguments object",array:"an array",boolean:"a boolean",buffer:"a buffer",date:"a date",error:"an error",float32array:"a float32array",float64array:"a float64array",function:"a function",int16array:"an int16array",int32array:"an int32array",int8array:"an int8array",map:"a Map",null:"null",number:"a number",object:"an object",regexp:"a regular expression",set:"a Set",string:"a string",symbol:"a symbol",uint16array:"an uint16array",uint32array:"an uint32array",uint8array:"an uint8array",uint8clampedarray:"an uint8clampedarray",undefined:"undefined",weakmap:"a WeakMap",weakset:"a WeakSet"};function tt(e){return zt[Bt(e)]}tt.types=zt;tt.typeOf=Bt;Lt.exports=tt});var Ne=T((Ji,Gt)=>{var En=Object.prototype.toString;Gt.exports=function(t){if(t===void 0)return"undefined";if(t===null)return"null";var r=typeof t;if(r==="boolean")return"boolean";if(r==="string")return"string";if(r==="number")return"number";if(r==="symbol")return"symbol";if(r==="function")return Fn(t)?"generatorfunction":"function";if(qn(t))return"array";if(zn(t))return"buffer";if(Bn(t))return"arguments";if(Wn(t))return"date";if(In(t))return"error";if(_n(t))return"regexp";switch(Rt(t)){case"Symbol":return"symbol";case"Promise":return"promise";case"WeakMap":return"weakmap";case"WeakSet":return"weakset";case"Map":return"map";case"Set":return"set";case"Int8Array":return"int8array";case"Uint8Array":return"uint8array";case"Uint8ClampedArray":return"uint8clampedarray";case"Int16Array":return"int16array";case"Uint16Array":return"uint16array";case"Int32Array":return"int32array";case"Uint32Array":return"uint32array";case"Float32Array":return"float32array";case"Float64Array":return"float64array"}if(Hn(t))return"generator";switch(r=En.call(t),r){case"[object Object]":return"object";case"[object Map Iterator]":return"mapiterator";case"[object Set Iterator]":return"setiterator";case"[object String Iterator]":return"stringiterator";case"[object Array Iterator]":return"arrayiterator"}return r.slice(8,-1).toLowerCase().replace(/\s/g,"")};function Rt(e){return typeof e.constructor=="function"?e.constructor.name:null}function qn(e){return Array.isArray?Array.isArray(e):e instanceof Array}function In(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function Wn(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function _n(e){return e instanceof RegExp?!0:typeof e.flags=="string"&&typeof e.ignoreCase=="boolean"&&typeof e.multiline=="boolean"&&typeof e.global=="boolean"}function Fn(e,t){return Rt(e)==="GeneratorFunction"}function Hn(e){return typeof e.throw=="function"&&typeof e.return=="function"&&typeof e.next=="function"}function Bn(e){try{if(typeof e.length=="number"&&typeof e.callee=="function")return!0}catch(t){if(t.message.indexOf("callee")!==-1)return!0}return!1}function zn(e){return e.constructor&&typeof e.constructor.isBuffer=="function"?e.constructor.isBuffer(e):!1}});var te=T((Vt,Qt)=>{"use strict";var Ln=oe("util"),Jt=Pt(),Pn=Ne(),m=Vt=Qt.exports;m.extend=Zt;m.indexOf=Qn;m.escapeExpression=Xn;m.isEmpty=ri;m.createFrame=Kn;m.blockParams=ei;m.appendContextPath=ti;var Rn={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},Gn=/[&<>"'`=]/g,Jn=/[&<>"'`=]/;function Zn(e){return Rn[e]}function Zt(e){for(var t=1;t{"use strict";var ni=te();me.contains=function(e,t,r){return e==null||t==null||isNaN(e.length)?!1:e.indexOf(t,r)!==-1};me.chop=function(e){if(typeof e!="string")return"";var t=/^[-_.\W\s]+|[-_.\W\s]+$/g;return e.trim().replace(t,"")};me.changecase=function(e,t){if(typeof e!="string")return"";if(e.length===1)return e.toLowerCase();e=me.chop(e).toLowerCase(),typeof t!="function"&&(t=ni.identity);var r=/[-_.\W\s]+(\w|$)/g;return e.replace(r,function(n,i){return t(i)})};me.random=function(e,t){return e+Math.floor(Math.random()*(t-e+1))}});var Kt=T((Vi,Xt)=>{"use strict";var ii=Me(),Q=Xt.exports;Q.abs=function(e){if(isNaN(e))throw new TypeError("expected a number");return Math.abs(e)};Q.add=function(e,t){return!isNaN(e)&&!isNaN(t)?Number(e)+Number(t):typeof e=="string"&&typeof t=="string"?e+t:""};Q.avg=function(){let e=[].concat.apply([],arguments);return e.pop(),Q.sum(e)/e.length};Q.ceil=function(e){if(isNaN(e))throw new TypeError("expected a number");return Math.ceil(e)};Q.divide=function(e,t){if(isNaN(e))throw new TypeError("expected the first argument to be a number");if(isNaN(t))throw new TypeError("expected the second argument to be a number");return Number(e)/Number(t)};Q.floor=function(e){if(isNaN(e))throw new TypeError("expected a number");return Math.floor(e)};Q.minus=function(e,t){if(isNaN(e))throw new TypeError("expected the first argument to be a number");if(isNaN(t))throw new TypeError("expected the second argument to be a number");return Number(e)-Number(t)};Q.modulo=function(e,t){if(isNaN(e))throw new TypeError("expected the first argument to be a number");if(isNaN(t))throw new TypeError("expected the second argument to be a number");return Number(e)%Number(t)};Q.multiply=function(e,t){if(isNaN(e))throw new TypeError("expected the first argument to be a number");if(isNaN(t))throw new TypeError("expected the second argument to be a number");return Number(e)*Number(t)};Q.plus=function(e,t){if(isNaN(e))throw new TypeError("expected the first argument to be a number");if(isNaN(t))throw new TypeError("expected the second argument to be a number");return Number(e)+Number(t)};Q.random=function(e,t){if(isNaN(e))throw new TypeError("expected minimum to be a number");if(isNaN(t))throw new TypeError("expected maximum to be a number");return ii.random(e,t)};Q.remainder=function(e,t){return e%t};Q.round=function(e){if(isNaN(e))throw new TypeError("expected a number");return Math.round(e)};Q.subtract=function(e,t){if(isNaN(e))throw new TypeError("expected the first argument to be a number");if(isNaN(t))throw new TypeError("expected the second argument to be a number");return Number(e)-Number(t)};Q.sum=function(){for(var e=[].concat.apply([],arguments),t=e.length,r=0;t--;)isNaN(e[t])||(r+=Number(e[t]));return r}});var tr=T((Qi,er)=>{"use strict";er.exports=function(t){return t!=null&&typeof t=="object"&&Array.isArray(t)===!1}});var Ae=T((Xi,ur)=>{var ir=tr();ur.exports=function(e,t,r){if(ir(r)||(r={default:r}),!nr(e))return typeof r.default<"u"?r.default:e;typeof t=="number"&&(t=String(t));let n=Array.isArray(t),i=typeof t=="string",u=r.separator||".",s=r.joinChar||(typeof u=="string"?u:".");if(!i&&!n)return e;if(i&&t in e)return it(t,e,r)?e[t]:r.default;let f=n?t:ui(t,u,r),w=f.length,y=0;do{let l=f[y];for(typeof l=="number"&&(l=String(l));l&&l.slice(-1)==="\\";)l=rr([l.slice(0,-1),f[++y]||""],s,r);if(l in e){if(!it(l,e,r))return r.default;e=e[l]}else{let x=!1,v=y+1;for(;v{"use strict";sr.exports=function(t){if(typeof t!="object")throw new TypeError("createFrame expects data to be an object");var r=Object.assign({},t);if(r._parent=t,r.extend=function(s){Object.assign(this,s)},arguments.length>1)for(var n=[].slice.call(arguments,1),i=n.length,u=-1;++u{"use strict";var g=te(),E=fr.exports,ce=Ae(),si=ut();E.after=function(e,t){return g.isUndefined(e)?"":(e=g.result(e),Array.isArray(e)?e.slice(t):"")};E.arrayify=function(e){return g.isUndefined(e)?[]:e?Array.isArray(e)?e:[e]:[]};E.before=function(e,t){return g.isUndefined(e)?"":(e=g.result(e),Array.isArray(e)?e.slice(0,t-1):"")};E.eachIndex=function(e,t){var r="";if(g.isUndefined(e))return"";if(e=g.result(e),Array.isArray(e))for(var n=0;n0){for(var s=0;s-1,this,r):"")};E.isArray=function(e){return Array.isArray(e)};E.itemAt=function(e,t){if(g.isUndefined(e))return null;if(e=g.result(e),Array.isArray(e)){if(t=isNaN(t)?0:+t,t<0)return e[e.length+t];if(ti[t]>u[t]?1:-1)}return""};E.withAfter=function(e,t,r){if(g.isUndefined(e))return"";if(e=g.result(e),Array.isArray(e)){e=e.slice(t);for(var n="",i=0;i0){for(var i=[],u=0;u0&&u%t===0&&(n+=r.fn(i),i=[]),i.push(e[u]);n+=r.fn(i)}return n};E.withLast=function(e,t,r){if(g.isUndefined(e))return"";if(e=g.result(e),Array.isArray(e)){if(g.isUndefined(t)||(t=parseFloat(g.result(t))),g.isUndefined(t))return r=t,r.fn(e[e.length-1]);e=e.slice(-t);for(var n=e.length,i=-1,u="";++iy?1:w{"use strict";var or=te(),re=ar.exports;re.bytes=function(e,t,r){if(e==null||isNaN(e)&&(e=e.length,!e))return"0 B";isNaN(t)&&(t=2);var n=["B","kB","MB","GB","TB","PB","EB","ZB","YB"];t=Math.pow(10,t),e=Number(e);for(var i=n.length-1;i-->=0;){var u=Math.pow(10,i*3);if(u<=e+1){e=Math.round(e*t/u)/t,e+=" "+n[i];break}}return e};re.addCommas=function(e){return e.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,")};re.phoneNumber=function(e){return e=e.toString(),"("+e.substr(0,3)+") "+e.substr(3,3)+"-"+e.substr(6,4)};re.toAbbr=function(e,t){isNaN(e)&&(e=0),or.isUndefined(t)&&(t=2),e=Number(e),t=Math.pow(10,t);for(var r=["k","m","b","t","q"],n=r.length-1;n>=0;){var i=Math.pow(10,(n+1)*3);if(i<=e+1){e=Math.round(e*t/i)/t,e+=r[n];break}n--}return e};re.toExponential=function(e,t){return isNaN(e)&&(e=0),or.isUndefined(t)&&(t=0),Number(e).toExponential(t)};re.toFixed=function(e,t){return isNaN(e)&&(e=0),isNaN(t)&&(t=0),Number(e).toFixed(t)};re.toFloat=function(e){return parseFloat(e)};re.toInt=function(e){return parseInt(e,10)};re.toPrecision=function(e,t){return isNaN(e)&&(e=0),isNaN(t)&&(t=1),Number(e).toPrecision(t)}});var dr=T((ru,lr)=>{"use strict";var st=oe("url"),ve=te(),fi=oe("querystring"),le=lr.exports;le.encodeURI=function(e){if(ve.isString(e))return encodeURIComponent(e)};le.escape=function(e){if(ve.isString(e))return fi.escape(e)};le.decodeURI=function(e){if(ve.isString(e))return decodeURIComponent(e)};le.urlResolve=function(e,t){return st.resolve(e,t)};le.urlParse=function(e){return st.parse(e)};le.stripQuerystring=function(e){if(ve.isString(e))return e.split("?")[0]};le.stripProtocol=function(e){if(ve.isString(e)){var t=st.parse(e);return t.protocol="",t.format()}}});var mr=T((hr,pr)=>{"use strict";var P=te(),de=Me(),A=pr.exports;A.append=function(e,t){return typeof e=="string"&&typeof t=="string"?e+t:e};A.camelcase=function(e){return typeof e!="string"?"":de.changecase(e,function(t){return t.toUpperCase()})};A.capitalize=function(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)};A.capitalizeAll=function(e){if(typeof e!="string")return"";if(P.isString(e))return e.replace(/\w\S*/g,function(t){return A.capitalize(t)})};A.center=function(e,t){if(typeof e!="string")return"";for(var r="",n=0;n-1;)i++,n+=r;return i};A.pascalcase=function(e){return typeof e!="string"?"":(e=de.changecase(e,function(t){return t.toUpperCase()}),e.charAt(0).toUpperCase()+e.slice(1))};A.pathcase=function(e){return typeof e!="string"?"":de.changecase(e,function(t){return"/"+t})};A.plusify=function(e,t){return typeof e!="string"?"":(P.isString(t)||(t=" "),e.split(t).join("+"))};A.prepend=function(e,t){return typeof e=="string"&&typeof t=="string"?t+e:e};A.raw=function(e){var t=e.fn(),r=P.options(this,e);if(r.escape!==!1)for(var n=0;(n=t.indexOf("{{",n))!==-1;)t[n-1]!=="\\"&&(t=t.slice(0,n)+"\\"+t.slice(n)),n+=3;return t};A.remove=function(e,t){return typeof e!="string"?"":P.isString(t)?e.split(t).join(""):e};A.removeFirst=function(e,t){return typeof e!="string"?"":P.isString(t)?e.replace(t,""):e};A.replace=function(e,t,r){return typeof e!="string"?"":P.isString(t)?(P.isString(r)||(r=""),e.split(t).join(r)):e};A.replaceFirst=function(e,t,r){return typeof e!="string"?"":P.isString(t)?(P.isString(r)||(r=""),e.replace(t,r)):e};A.reverse=ke().reverse;A.sentence=function(e){return typeof e!="string"?"":e.replace(/((?:\S[^\.\?\!]*)[\.\?\!]*)/g,function(t){return t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()})};A.snakecase=function(e){return typeof e!="string"?"":de.changecase(e,function(t){return"_"+t})};A.split=function(e,t){return typeof e!="string"?"":(P.isString(t)||(t=","),e.split(t))};A.startsWith=function(e,t,r){var n=[].slice.call(arguments);return r=n.pop(),P.isString(t)&&t.indexOf(e)===0?r.fn(this):typeof r.inverse=="function"?r.inverse(this):""};A.titleize=function(e){if(typeof e!="string")return"";for(var t=e.replace(/[- _]+/g," "),r=t.split(" "),n=r.length,i=[],u=0;n--;){var s=r[u++];i.push(hr.capitalize(s))}return i.join(" ")};A.trim=function(e){return typeof e=="string"?e.trim():""};A.trimLeft=function(e){if(P.isString(e))return e.replace(/^\s+/,"")};A.trimRight=function(e){if(P.isString(e))return e.replace(/\s+$/,"")};A.truncate=function(e,t,r){if(P.isString(e))return typeof r!="string"&&(r=""),e.length>t?e.slice(0,t-r.length)+r:e};A.truncateWords=function(e,t,r){if(P.isString(e)&&!isNaN(t)){typeof r!="string"&&(r="\u2026");var n=Number(t),i=e.split(/[ \t]/);if(n>=i.length)return e;i=i.slice(0,n);var u=i.join(" ").trim();return u+r}};A.upcase=function(){return A.uppercase.apply(this,arguments)};A.uppercase=function(e){return P.isObject(e)&&e.fn?e.fn(this).toUpperCase():typeof e!="string"?"":e.toUpperCase()}});var gr=T((nu,yr)=>{"use strict";var oi=Ne();yr.exports=function e(t){switch(oi(t)){case"boolean":case"date":case"function":case"null":case"number":return!0;case"undefined":return!1;case"regexp":return t.source!=="(?:)"&&t.source!=="";case"buffer":return t.toString()!=="";case"error":return t.message!=="";case"string":case"arguments":return t.length!==0;case"file":case"map":case"set":return t.size!==0;case"array":case"object":for(let r of Object.keys(t))if(e(t[r]))return!0;return!1;default:return!0}}});var $r=T((iu,vr)=>{"use strict";var ai=Ae(),ci=gr();vr.exports=function(e,t,r){return li(e)&&(typeof t=="string"||Array.isArray(t))?ci(ai(e,t,r)):!1};function li(e){return e!=null&&(typeof e=="object"||typeof e=="function"||Array.isArray(e))}});var wr=T((uu,br)=>{"use strict";function ft(e,t){if(!e)return!0;let r=t||ft.keywords;Array.isArray(r)||(r=[r]);let n=typeof e=="string"?e.toLowerCase():null;for(let i of r)if(i===e||i===n)return!0;return!1}ft.keywords=["0","false","nada","nil","nay","nah","negative","no","none","nope","nul","null","nix","nyet","uh-uh","veto","zero"];br.exports=ft});var xr=T((su,Or)=>{"use strict";Or.exports=function(t){let r=Math.abs(t);if(isNaN(r))throw new TypeError("expected a number");if(!Number.isInteger(r))throw new Error("expected an integer");if(!Number.isSafeInteger(r))throw new Error("value exceeds maximum safe integer");return r%2===1}});var Mr=T((fu,Nr)=>{"use strict";var di=$r(),k=te(),hi=Me(),Sr=wr(),jr=xr(),_=Nr.exports;_.and=function(){for(var e=arguments.length-1,t=arguments[e],r=!0,n=0;n":i=e>r;break;case"<=":i=e<=r;break;case">=":i=e>=r;break;case"typeof":i=typeof e===r;break;default:throw new Error("helper {{compare}}: invalid operator: `"+t+"`")}return k.value(i,this,n)};_.contains=function(e,t,r,n){typeof r=="object"&&(n=r,r=void 0);var i=hi.contains(e,t,r);return k.value(i,this,n)};_.default=function(){for(var e=0;et,this,r)};_.gte=function(e,t,r){return arguments.length===2&&(r=t,t=r.hash.compare),k.value(e>=t,this,r)};_.has=function(e,t,r){return k.isOptions(e)&&(r=e,t=null,e=null),k.isOptions(t)&&(r=t,t=null),e===null?k.value(!1,this,r):arguments.length===2?k.value(di(this,e),this,r):(Array.isArray(e)||k.isString(e))&&k.isString(t)&&e.indexOf(t)>-1?k.fn(!0,this,r):k.isObject(e)&&k.isString(t)&&t in e?k.fn(!0,this,r):k.inverse(!1,this,r)};_.isFalsey=function(e,t){return k.value(Sr(e),this,t)};_.isTruthy=function(e,t){return k.value(!Sr(e),this,t)};_.ifEven=function(e,t){return k.value(!jr(e),this,t)};_.ifNth=function(e,t,r){var n=!isNaN(e)&&!isNaN(t)&&t%e===0;return k.value(n,this,r)};_.ifOdd=function(e,t){return k.value(jr(e),this,t)};_.is=function(e,t,r){return arguments.length===2&&(r=t,t=r.hash.compare),k.value(e==t,this,r)};_.isnt=function(e,t,r){return arguments.length===2&&(r=t,t=r.hash.compare),k.value(e!=t,this,r)};_.lt=function(e,t,r){return arguments.length===2&&(r=t,t=r.hash.compare),k.value(e=t,this,r)};_.unlessGteq=function(e,t,r){return k.isOptions(t)&&(r=t,t=r.hash.compare),k.value(et,this,r)}});var kr=T((ou,Ar)=>{var pi=et(),mi=Object.prototype.toString;Ar.exports=function(t){if(typeof t>"u")return"undefined";if(t===null)return"null";if(t===!0||t===!1||t instanceof Boolean)return"boolean";if(typeof t=="string"||t instanceof String)return"string";if(typeof t=="number"||t instanceof Number)return"number";if(typeof t=="function"||t instanceof Function)return"function";if(typeof Array.isArray<"u"&&Array.isArray(t))return"array";if(t instanceof RegExp)return"regexp";if(t instanceof Date)return"date";var r=mi.call(t);return r==="[object RegExp]"?"regexp":r==="[object Date]"?"date":r==="[object Arguments]"?"arguments":r==="[object Error]"?"error":pi(t)?"buffer":r==="[object Set]"?"set":r==="[object WeakSet]"?"weakset":r==="[object Map]"?"map":r==="[object WeakMap]"?"weakmap":r==="[object Symbol]"?"symbol":r==="[object Int8Array]"?"int8array":r==="[object Uint8Array]"?"uint8array":r==="[object Uint8ClampedArray]"?"uint8clampedarray":r==="[object Int16Array]"?"int16array":r==="[object Uint16Array]"?"uint16array":r==="[object Int32Array]"?"int32array":r==="[object Uint32Array]"?"uint32array":r==="[object Float32Array]"?"float32array":r==="[object Float64Array]"?"float64array":"object"}});var Ur=T((au,Dr)=>{"use strict";var yi=kr();Dr.exports=function(t){var r=yi(t);if(r!=="number"&&r!=="string")return!1;var n=+t;return n-n+1>=0&&t!==""}});var Yr=T((cu,Tr)=>{"use strict";var gi=Ur();Tr.exports=function(t,r){if(!r)return t;if(!t)return{};for(var n=String(r).split(/[[.\]]/).filter(Boolean),i=n[n.length-1],u={};r=n.shift();)if(t=t[r],!t)return{};return gi(i)?[t]:(u[i]=t,u)}});var Ir=T((lu,qr)=>{"use strict";var vi=Object.hasOwnProperty,$e=te(),$i=ke(),R=qr.exports,bi=Ae(),Cr=Yr(),Er=ut();R.extend=function(){var e=[].slice.call(arguments),t={};$e.isOptions(e[e.length-1])&&(t=e.pop().hash,e.push(t));for(var r={},n=0;n{"use strict";var wi=te(),Wr=_r.exports,Oi=Ne();Wr.toRegex=function(e,t,r){var n=wi.options({},t,r);return new RegExp(e,n.flags)};Wr.test=function(e,t){if(typeof e!="string")return!1;if(Oi(t)!=="regexp")throw new TypeError("expected a regular expression");return t.test(e)}});function be(){return De>Ue.length-16&&(Hr.default.randomFillSync(Ue),De=0),Ue.slice(De,De+=16)}var Hr,Ue,De,ot=V(()=>{Hr=F(oe("crypto")),Ue=new Uint8Array(256),De=Ue.length});var Br,zr=V(()=>{Br=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i});function xi(e){return typeof e=="string"&&Br.test(e)}var ue,we=V(()=>{zr();ue=xi});function he(e,t=0){return G[e[t+0]]+G[e[t+1]]+G[e[t+2]]+G[e[t+3]]+"-"+G[e[t+4]]+G[e[t+5]]+"-"+G[e[t+6]]+G[e[t+7]]+"-"+G[e[t+8]]+G[e[t+9]]+"-"+G[e[t+10]]+G[e[t+11]]+G[e[t+12]]+G[e[t+13]]+G[e[t+14]]+G[e[t+15]]}function Si(e,t=0){let r=he(e,t);if(!ue(r))throw TypeError("Stringified UUID is invalid");return r}var G,Lr,Oe=V(()=>{we();G=[];for(let e=0;e<256;++e)G.push((e+256).toString(16).slice(1));Lr=Si});function ji(e,t,r){let n=t&&r||0,i=t||new Array(16);e=e||{};let u=e.node||Pr,s=e.clockseq!==void 0?e.clockseq:at;if(u==null||s==null){let v=e.random||(e.rng||be)();u==null&&(u=Pr=[v[0]|1,v[1],v[2],v[3],v[4],v[5]]),s==null&&(s=at=(v[6]<<8|v[7])&16383)}let f=e.msecs!==void 0?e.msecs:Date.now(),w=e.nsecs!==void 0?e.nsecs:lt+1,y=f-ct+(w-lt)/1e4;if(y<0&&e.clockseq===void 0&&(s=s+1&16383),(y<0||f>ct)&&e.nsecs===void 0&&(w=0),w>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");ct=f,lt=w,at=s,f+=122192928e5;let l=((f&268435455)*1e4+w)%4294967296;i[n++]=l>>>24&255,i[n++]=l>>>16&255,i[n++]=l>>>8&255,i[n++]=l&255;let x=f/4294967296*1e4&268435455;i[n++]=x>>>8&255,i[n++]=x&255,i[n++]=x>>>24&15|16,i[n++]=x>>>16&255,i[n++]=s>>>8|128,i[n++]=s&255;for(let v=0;v<6;++v)i[n+v]=u[v];return t||he(i)}var Pr,at,ct,lt,Rr,Gr=V(()=>{ot();Oe();ct=0,lt=0;Rr=ji});function Ni(e){if(!ue(e))throw TypeError("Invalid UUID");let t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=t&255,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=t&255,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=t&255,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=t&255,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=t&255,r}var Te,dt=V(()=>{we();Te=Ni});function Mi(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r{Oe();dt();Ai="6ba7b810-9dad-11d1-80b4-00c04fd430c8",ki="6ba7b811-9dad-11d1-80b4-00c04fd430c8"});function Di(e){return Array.isArray(e)?e=Buffer.from(e):typeof e=="string"&&(e=Buffer.from(e,"utf8")),Jr.default.createHash("md5").update(e).digest()}var Jr,Zr,Vr=V(()=>{Jr=F(oe("crypto"));Zr=Di});var Ui,Qr,Xr=V(()=>{ht();Vr();Ui=xe("v3",48,Zr),Qr=Ui});var Kr,pt,en=V(()=>{Kr=F(oe("crypto")),pt={randomUUID:Kr.default.randomUUID}});function Ti(e,t,r){if(pt.randomUUID&&!t&&!e)return pt.randomUUID();e=e||{};let n=e.random||(e.rng||be)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let i=0;i<16;++i)t[r+i]=n[i];return t}return he(n)}var tn,rn=V(()=>{en();ot();Oe();tn=Ti});function Yi(e){return Array.isArray(e)?e=Buffer.from(e):typeof e=="string"&&(e=Buffer.from(e,"utf8")),nn.default.createHash("sha1").update(e).digest()}var nn,un,sn=V(()=>{nn=F(oe("crypto"));un=Yi});var Ci,fn,on=V(()=>{ht();sn();Ci=xe("v5",80,un),fn=Ci});var an,cn=V(()=>{an="00000000-0000-0000-0000-000000000000"});function Ei(e){if(!ue(e))throw TypeError("Invalid UUID");return parseInt(e.slice(14,15),16)}var ln,dn=V(()=>{we();ln=Ei});var hn={};mt(hn,{NIL:()=>an,parse:()=>Te,stringify:()=>Lr,v1:()=>Rr,v3:()=>Qr,v4:()=>tn,v5:()=>fn,validate:()=>ue,version:()=>ln});var pn=V(()=>{Gr();Xr();rn();on();cn();dn();we();Oe();dt()});var yn=T((Xu,mn)=>{var qi=(pn(),gt(hn)),Ii=mn.exports;Ii.uuid=function(){return qi.v4()}});var Bi={};mt(Bi,{default:()=>Hi});var X=F(vt()),Mt=F($t()),At=F(bt()),kt=F(wt()),Dt=F(Ot()),Ut=F(xt()),Tt=F(St()),Yt=F(jt()),Ct=F(Nt());X.default.extend(Mt.default);X.default.extend(At.default);X.default.extend(kt.default);X.default.extend(Dt.default);X.default.extend(Ut.default);X.default.extend(Tt.default);X.default.extend(Yt.default);X.default.extend(Ct.default);function ae(e){return typeof e=="object"&&typeof e.hash=="object"}function Qe(e){return typeof e=="object"&&typeof e.options=="object"&&typeof e.app=="object"}function Xe(e,t,r){if(ae(e))return Xe({},t,e);if(ae(t))return Xe(e,r,t);let n=Qe(e)?e.context:{};r=r||{},ae(r)||(t=Object.assign({},t,r)),ae(r)&&r.hash.root===!0&&(t=Object.assign({},r.data.root,t));let i=Object.assign({},n,t,r.hash);return Qe(e)||(i=Object.assign({},e,i)),Qe(e)&&e.view&&e.view.data&&(i=Object.assign({},i,e.view.data)),i}function Ke(e,t,r){return ae(t)&&(r=t,t=null),ae(e)&&(r=e,t=null,e=null),{str:e,pattern:t,options:r}}function Et(e,t,r){let n=Ke(e,t,r),i={lang:"en",date:new Date(n.str)},u=Xe(this,i,{});X.default.locale(u.lang||u.language)}var qt=(e,t,r)=>{let n=Ke(e,t,r);if(n.str==null&&n.pattern==null)return X.default.locale("en"),(0,X.default)().format("MMMM DD, YYYY");Et(n.str,n.pattern,n.options);let i=(0,X.default)(new Date(n.str));return typeof n.options=="string"?i=n.options.toLowerCase()==="utc"?i.utc():i.tz(n.options):i=i.tz(X.default.tz.guess()),n.pattern===""?i.toISOString():i.format(n.pattern)},It=(e,t,r)=>{let n=Ke(e,t);Et(n.str,n.pattern);let i=X.default.duration(n.str,n.pattern);return r&&!ae(r)?i.format(r):i.humanize()};var gn=F(Kt()),vn=F(ke()),$n=F(cr()),bn=F(dr()),wn=F(mr()),On=F(Mr()),xn=F(Ir()),Sn=F(Fr()),jn=F(yn()),Wi={math:gn.default,array:vn.default,number:$n.default,url:bn.default,string:wn.default,comparison:On.default,object:xn.default,regex:Sn.default,uuid:jn.default},_i=["sortBy"],Fi={date:qt,duration:It},ne;function Nn(){if(ne)return ne;ne={};for(let e of Object.values(Wi))for(let[t,r]of Object.entries(e))ne[t]=(...n)=>r(...n,{});ne={...ne,...Fi};for(let e of _i)delete ne[e];return Object.freeze(ne),ne}var Hi={...Nn(),stripProtocol:helpersStripProtocol};return gt(Bi);})(); +"use strict";var helpers=(()=>{var An=Object.create;var Se=Object.defineProperty;var Dn=Object.getOwnPropertyDescriptor;var kn=Object.getOwnPropertyNames;var Un=Object.getPrototypeOf,Tn=Object.prototype.hasOwnProperty;var oe=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Z=(e,t)=>()=>(e&&(t=e(e=0)),t);var k=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),pt=(e,t)=>{for(var r in t)Se(e,r,{get:t[r],enumerable:!0})},gt=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of kn(t))!Tn.call(e,i)&&i!==r&&Se(e,i,{get:()=>t[i],enumerable:!(n=Dn(t,i))||n.enumerable});return e};var _=(e,t,r)=>(r=e!=null?An(Un(e)):{},gt(t||!e||!e.__esModule?Se(r,"default",{value:e,enumerable:!0}):r,e)),yt=e=>gt(Se({},"__esModule",{value:!0}),e);var vt=k((Te,Ce)=>{(function(e,t){typeof Te=="object"&&typeof Ce<"u"?Ce.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs=t()})(Te,function(){"use strict";var e=1e3,t=6e4,r=36e5,n="millisecond",i="second",u="minute",s="hour",a="day",w="week",g="month",l="quarter",x="year",v="date",f="Invalid Date",U=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,I=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,Y={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(b){var m=["th","st","nd","rd"],c=b%100;return"["+b+(m[(c-20)%10]||m[c]||m[0])+"]"}},C=function(b,m,c){var $=String(b);return!$||$.length>=m?b:""+Array(m+1-$.length).join(c)+b},F={s:C,z:function(b){var m=-b.utcOffset(),c=Math.abs(m),$=Math.floor(c/60),d=c%60;return(m<=0?"+":"-")+C($,2,"0")+":"+C(d,2,"0")},m:function b(m,c){if(m.date()1)return b(j[0])}else{var E=m.name;N[E]=m,d=E}return!$&&d&&(T=d),d||!$&&T},S=function(b,m){if(o(b))return b.clone();var c=typeof m=="object"?m:{};return c.date=b,c.args=arguments,new L(c)},O=F;O.l=D,O.i=o,O.w=function(b,m){return S(b,{locale:m.$L,utc:m.$u,x:m.$x,$offset:m.$offset})};var L=function(){function b(c){this.$L=D(c.locale,null,!0),this.parse(c),this.$x=this.$x||c.x||{},this[h]=!0}var m=b.prototype;return m.parse=function(c){this.$d=function($){var d=$.date,q=$.utc;if(d===null)return new Date(NaN);if(O.u(d))return new Date;if(d instanceof Date)return new Date(d);if(typeof d=="string"&&!/Z$/i.test(d)){var j=d.match(U);if(j){var E=j[2]-1||0,H=(j[7]||"0").substring(0,3);return q?new Date(Date.UTC(j[1],E,j[3]||1,j[4]||0,j[5]||0,j[6]||0,H)):new Date(j[1],E,j[3]||1,j[4]||0,j[5]||0,j[6]||0,H)}}return new Date(d)}(c),this.init()},m.init=function(){var c=this.$d;this.$y=c.getFullYear(),this.$M=c.getMonth(),this.$D=c.getDate(),this.$W=c.getDay(),this.$H=c.getHours(),this.$m=c.getMinutes(),this.$s=c.getSeconds(),this.$ms=c.getMilliseconds()},m.$utils=function(){return O},m.isValid=function(){return this.$d.toString()!==f},m.isSame=function(c,$){var d=S(c);return this.startOf($)<=d&&d<=this.endOf($)},m.isAfter=function(c,$){return S(c){(function(e,t){typeof Pe=="object"&&typeof Ie<"u"?Ie.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs_plugin_duration=t()})(Pe,function(){"use strict";var e,t,r=1e3,n=6e4,i=36e5,u=864e5,s=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,a=31536e6,w=2628e6,g=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,l={years:a,months:w,days:u,hours:i,minutes:n,seconds:r,milliseconds:1,weeks:6048e5},x=function(N){return N instanceof F},v=function(N,h,o){return new F(N,o,h.$l)},f=function(N){return t.p(N)+"s"},U=function(N){return N<0},I=function(N){return U(N)?Math.ceil(N):Math.floor(N)},Y=function(N){return Math.abs(N)},C=function(N,h){return N?U(N)?{negative:!0,format:""+Y(N)+h}:{negative:!1,format:""+N+h}:{negative:!1,format:""}},F=function(){function N(o,D,S){var O=this;if(this.$d={},this.$l=S,o===void 0&&(this.$ms=0,this.parseFromMilliseconds()),D)return v(o*l[f(D)],this);if(typeof o=="number")return this.$ms=o,this.parseFromMilliseconds(),this;if(typeof o=="object")return Object.keys(o).forEach(function(b){O.$d[f(b)]=o[b]}),this.calMilliseconds(),this;if(typeof o=="string"){var L=o.match(g);if(L){var G=L.slice(2).map(function(b){return b!=null?Number(b):0});return this.$d.years=G[0],this.$d.months=G[1],this.$d.weeks=G[2],this.$d.days=G[3],this.$d.hours=G[4],this.$d.minutes=G[5],this.$d.seconds=G[6],this.calMilliseconds(),this}}return this}var h=N.prototype;return h.calMilliseconds=function(){var o=this;this.$ms=Object.keys(this.$d).reduce(function(D,S){return D+(o.$d[S]||0)*l[S]},0)},h.parseFromMilliseconds=function(){var o=this.$ms;this.$d.years=I(o/a),o%=a,this.$d.months=I(o/w),o%=w,this.$d.days=I(o/u),o%=u,this.$d.hours=I(o/i),o%=i,this.$d.minutes=I(o/n),o%=n,this.$d.seconds=I(o/r),o%=r,this.$d.milliseconds=o},h.toISOString=function(){var o=C(this.$d.years,"Y"),D=C(this.$d.months,"M"),S=+this.$d.days||0;this.$d.weeks&&(S+=7*this.$d.weeks);var O=C(S,"D"),L=C(this.$d.hours,"H"),G=C(this.$d.minutes,"M"),b=this.$d.seconds||0;this.$d.milliseconds&&(b+=this.$d.milliseconds/1e3,b=Math.round(1e3*b)/1e3);var m=C(b,"S"),c=o.negative||D.negative||O.negative||L.negative||G.negative||m.negative,$=L.format||G.format||m.format?"T":"",d=(c?"-":"")+"P"+o.format+D.format+O.format+$+L.format+G.format+m.format;return d==="P"||d==="-P"?"P0D":d},h.toJSON=function(){return this.toISOString()},h.format=function(o){var D=o||"YYYY-MM-DDTHH:mm:ss",S={Y:this.$d.years,YY:t.s(this.$d.years,2,"0"),YYYY:t.s(this.$d.years,4,"0"),M:this.$d.months,MM:t.s(this.$d.months,2,"0"),D:this.$d.days,DD:t.s(this.$d.days,2,"0"),H:this.$d.hours,HH:t.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:t.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:t.s(this.$d.seconds,2,"0"),SSS:t.s(this.$d.milliseconds,3,"0")};return D.replace(s,function(O,L){return L||String(S[O])})},h.as=function(o){return this.$ms/l[f(o)]},h.get=function(o){var D=this.$ms,S=f(o);return S==="milliseconds"?D%=1e3:D=S==="weeks"?I(D/l[S]):this.$d[S],D||0},h.add=function(o,D,S){var O;return O=D?o*l[f(D)]:x(o)?o.$ms:v(o,this).$ms,v(this.$ms+O*(S?-1:1),this)},h.subtract=function(o,D){return this.add(o,D,!0)},h.locale=function(o){var D=this.clone();return D.$l=o,D},h.clone=function(){return v(this.$ms,this)},h.humanize=function(o){return e().add(this.$ms,"ms").locale(this.$l).fromNow(!o)},h.valueOf=function(){return this.asMilliseconds()},h.milliseconds=function(){return this.get("milliseconds")},h.asMilliseconds=function(){return this.as("milliseconds")},h.seconds=function(){return this.get("seconds")},h.asSeconds=function(){return this.as("seconds")},h.minutes=function(){return this.get("minutes")},h.asMinutes=function(){return this.as("minutes")},h.hours=function(){return this.get("hours")},h.asHours=function(){return this.as("hours")},h.days=function(){return this.get("days")},h.asDays=function(){return this.as("days")},h.weeks=function(){return this.get("weeks")},h.asWeeks=function(){return this.as("weeks")},h.months=function(){return this.get("months")},h.asMonths=function(){return this.as("months")},h.years=function(){return this.get("years")},h.asYears=function(){return this.as("years")},N}(),T=function(N,h,o){return N.add(h.years()*o,"y").add(h.months()*o,"M").add(h.days()*o,"d").add(h.hours()*o,"h").add(h.minutes()*o,"m").add(h.seconds()*o,"s").add(h.milliseconds()*o,"ms")};return function(N,h,o){e=o,t=o().$utils(),o.duration=function(O,L){var G=o.locale();return v(O,{$l:G},L)},o.isDuration=x;var D=h.prototype.add,S=h.prototype.subtract;h.prototype.add=function(O,L){return x(O)?T(this,O,1):D.bind(this)(O,L)},h.prototype.subtract=function(O,L){return x(O)?T(this,O,-1):S.bind(this)(O,L)}}})});var $t=k((Ye,Ee)=>{(function(e,t){typeof Ye=="object"&&typeof Ee<"u"?Ee.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs_plugin_advancedFormat=t()})(Ye,function(){"use strict";return function(e,t){var r=t.prototype,n=r.format;r.format=function(i){var u=this,s=this.$locale();if(!this.isValid())return n.bind(this)(i);var a=this.$utils(),w=(i||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,function(g){switch(g){case"Q":return Math.ceil((u.$M+1)/3);case"Do":return s.ordinal(u.$D);case"gggg":return u.weekYear();case"GGGG":return u.isoWeekYear();case"wo":return s.ordinal(u.week(),"W");case"w":case"ww":return a.s(u.week(),g==="w"?1:2,"0");case"W":case"WW":return a.s(u.isoWeek(),g==="W"?1:2,"0");case"k":case"kk":return a.s(String(u.$H===0?24:u.$H),g==="k"?1:2,"0");case"X":return Math.floor(u.$d.getTime()/1e3);case"x":return u.$d.getTime();case"z":return"["+u.offsetName()+"]";case"zzz":return"["+u.offsetName("long")+"]";default:return g}});return n.bind(this)(w)}}})});var wt=k((We,_e)=>{(function(e,t){typeof We=="object"&&typeof _e<"u"?_e.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs_plugin_isoWeek=t()})(We,function(){"use strict";var e="day";return function(t,r,n){var i=function(a){return a.add(4-a.isoWeekday(),e)},u=r.prototype;u.isoWeekYear=function(){return i(this).year()},u.isoWeek=function(a){if(!this.$utils().u(a))return this.add(7*(a-this.isoWeek()),e);var w,g,l,x,v=i(this),f=(w=this.isoWeekYear(),g=this.$u,l=(g?n.utc:n)().year(w).startOf("year"),x=4-l.isoWeekday(),l.isoWeekday()>4&&(x+=7),l.add(x,e));return v.diff(f,"week")+1},u.isoWeekday=function(a){return this.$utils().u(a)?this.day()||7:this.day(this.day()%7?a:a-7)};var s=u.startOf;u.startOf=function(a,w){var g=this.$utils(),l=!!g.u(w)||w;return g.p(a)==="isoweek"?l?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):s.bind(this)(a,w)}}})});var Ot=k((Fe,He)=>{(function(e,t){typeof Fe=="object"&&typeof He<"u"?He.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs_plugin_weekYear=t()})(Fe,function(){"use strict";return function(e,t){t.prototype.weekYear=function(){var r=this.month(),n=this.week(),i=this.year();return n===1&&r===11?i+1:r===0&&n>=52?i-1:i}}})});var xt=k((Le,Be)=>{(function(e,t){typeof Le=="object"&&typeof Be<"u"?Be.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs_plugin_weekOfYear=t()})(Le,function(){"use strict";var e="week",t="year";return function(r,n,i){var u=n.prototype;u.week=function(s){if(s===void 0&&(s=null),s!==null)return this.add(7*(s-this.week()),"day");var a=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var w=i(this).startOf(t).add(1,t).date(a),g=i(this).endOf(e);if(w.isBefore(g))return 1}var l=i(this).startOf(t).date(a).startOf(e).subtract(1,"millisecond"),x=this.diff(l,e,!0);return x<0?i(this).startOf("week").week():Math.ceil(x)},u.weeks=function(s){return s===void 0&&(s=null),this.week(s)}}})});var Nt=k((ze,Ve)=>{(function(e,t){typeof ze=="object"&&typeof Ve<"u"?Ve.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs_plugin_relativeTime=t()})(ze,function(){"use strict";return function(e,t,r){e=e||{};var n=t.prototype,i={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function u(a,w,g,l){return n.fromToBase(a,w,g,l)}r.en.relativeTime=i,n.fromToBase=function(a,w,g,l,x){for(var v,f,U,I=g.$locale().relativeTime||i,Y=e.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],C=Y.length,F=0;F0,N<=T.r||!T.r){N<=1&&F>0&&(T=Y[F-1]);var h=I[T.l];x&&(N=x(""+N)),f=typeof h=="string"?h.replace("%d",N):h(N,w,T.l,U);break}}if(w)return f;var o=U?I.future:I.past;return typeof o=="function"?o(f):o.replace("%s",f)},n.to=function(a,w){return u(a,w,this,!0)},n.from=function(a,w){return u(a,w,this)};var s=function(a){return a.$u?r.utc():r()};n.toNow=function(a){return this.to(s(this),a)},n.fromNow=function(a){return this.from(s(this),a)}}})});var St=k((Re,Ge)=>{(function(e,t){typeof Re=="object"&&typeof Ge<"u"?Ge.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs_plugin_utc=t()})(Re,function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(n,i,u){var s=i.prototype;u.utc=function(f){var U={date:f,utc:!0,args:arguments};return new i(U)},s.utc=function(f){var U=u(this.toDate(),{locale:this.$L,utc:!0});return f?U.add(this.utcOffset(),e):U},s.local=function(){return u(this.toDate(),{locale:this.$L,utc:!1})};var a=s.parse;s.parse=function(f){f.utc&&(this.$u=!0),this.$utils().u(f.$offset)||(this.$offset=f.$offset),a.call(this,f)};var w=s.init;s.init=function(){if(this.$u){var f=this.$d;this.$y=f.getUTCFullYear(),this.$M=f.getUTCMonth(),this.$D=f.getUTCDate(),this.$W=f.getUTCDay(),this.$H=f.getUTCHours(),this.$m=f.getUTCMinutes(),this.$s=f.getUTCSeconds(),this.$ms=f.getUTCMilliseconds()}else w.call(this)};var g=s.utcOffset;s.utcOffset=function(f,U){var I=this.$utils().u;if(I(f))return this.$u?0:I(this.$offset)?g.call(this):this.$offset;if(typeof f=="string"&&(f=function(T){T===void 0&&(T="");var N=T.match(t);if(!N)return null;var h=(""+N[0]).match(r)||["-",0,0],o=h[0],D=60*+h[1]+ +h[2];return D===0?0:o==="+"?D:-D}(f),f===null))return this;var Y=Math.abs(f)<=16?60*f:f,C=this;if(U)return C.$offset=Y,C.$u=f===0,C;if(f!==0){var F=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(C=this.local().add(Y+F,e)).$offset=Y,C.$x.$localOffset=F}else C=this.utc();return C};var l=s.format;s.format=function(f){var U=f||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return l.call(this,U)},s.valueOf=function(){var f=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*f},s.isUTC=function(){return!!this.$u},s.toISOString=function(){return this.toDate().toISOString()},s.toString=function(){return this.toDate().toUTCString()};var x=s.toDate;s.toDate=function(f){return f==="s"&&this.$offset?u(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():x.call(this)};var v=s.diff;s.diff=function(f,U,I){if(f&&this.$u===f.$u)return v.call(this,f,U,I);var Y=this.local(),C=u(f).local();return v.call(Y,C,U,I)}}})});var qt=k((Je,Ze)=>{(function(e,t){typeof Je=="object"&&typeof Ze<"u"?Ze.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs_plugin_timezone=t()})(Je,function(){"use strict";var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(r,n,i){var u,s=function(l,x,v){v===void 0&&(v={});var f=new Date(l),U=function(I,Y){Y===void 0&&(Y={});var C=Y.timeZoneName||"short",F=I+"|"+C,T=t[F];return T||(T=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:I,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:C}),t[F]=T),T}(x,v);return U.formatToParts(f)},a=function(l,x){for(var v=s(l,x),f=[],U=0;U=0&&(f[F]=parseInt(C,10))}var T=f[3],N=T===24?0:T,h=f[0]+"-"+f[1]+"-"+f[2]+" "+N+":"+f[4]+":"+f[5]+":000",o=+l;return(i.utc(h).valueOf()-(o-=o%1e3))/6e4},w=n.prototype;w.tz=function(l,x){l===void 0&&(l=u);var v=this.utcOffset(),f=this.toDate(),U=f.toLocaleString("en-US",{timeZone:l}),I=Math.round((f-new Date(U))/1e3/60),Y=i(U,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(15*-Math.round(f.getTimezoneOffset()/15)-I,!0);if(x){var C=Y.utcOffset();Y=Y.add(v-C,"minute")}return Y.$x.$timezone=l,Y},w.offsetName=function(l){var x=this.$x.$timezone||i.tz.guess(),v=s(this.valueOf(),x,{timeZoneName:l}).find(function(f){return f.type.toLowerCase()==="timezonename"});return v&&v.value};var g=w.startOf;w.startOf=function(l,x){if(!this.$x||!this.$x.$timezone)return g.call(this,l,x);var v=i(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return g.call(v,l,x).tz(this.$x.$timezone,!0)},i.tz=function(l,x,v){var f=v&&x,U=v||x||u,I=a(+i(),U);if(typeof l!="string")return i(l).tz(U);var Y=function(N,h,o){var D=N-60*h*1e3,S=a(D,o);if(h===S)return[D,h];var O=a(D-=60*(S-h)*1e3,o);return S===O?[D,S]:[N-60*Math.min(S,O)*1e3,Math.max(S,O)]}(i.utc(l,f).valueOf(),I,U),C=Y[0],F=Y[1],T=i(C).utcOffset(F);return T.$x.$timezone=U,T},i.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},i.tz.setDefault=function(l){u=l}}})});var et=k((Ji,Wt)=>{Wt.exports=function(e){return e!=null&&(Et(e)||Cn(e)||!!e._isBuffer)};function Et(e){return!!e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function Cn(e){return typeof e.readFloatLE=="function"&&typeof e.slice=="function"&&Et(e.slice(0,0))}});var Ft=k((Zi,_t)=>{var Pn=et(),In=Object.prototype.toString;_t.exports=function(t){if(typeof t>"u")return"undefined";if(t===null)return"null";if(t===!0||t===!1||t instanceof Boolean)return"boolean";if(typeof t=="string"||t instanceof String)return"string";if(typeof t=="number"||t instanceof Number)return"number";if(typeof t=="function"||t instanceof Function)return"function";if(typeof Array.isArray<"u"&&Array.isArray(t))return"array";if(t instanceof RegExp)return"regexp";if(t instanceof Date)return"date";var r=In.call(t);return r==="[object RegExp]"?"regexp":r==="[object Date]"?"date":r==="[object Arguments]"?"arguments":r==="[object Error]"?"error":Pn(t)?"buffer":r==="[object Set]"?"set":r==="[object WeakSet]"?"weakset":r==="[object Map]"?"map":r==="[object WeakMap]"?"weakmap":r==="[object Symbol]"?"symbol":r==="[object Int8Array]"?"int8array":r==="[object Uint8Array]"?"uint8array":r==="[object Uint8ClampedArray]"?"uint8clampedarray":r==="[object Int16Array]"?"int16array":r==="[object Uint16Array]"?"uint16array":r==="[object Int32Array]"?"int32array":r==="[object Uint32Array]"?"uint32array":r==="[object Float32Array]"?"float32array":r==="[object Float64Array]"?"float64array":"object"}});var zt=k((Qi,Bt)=>{"use strict";var Ht=Ft(),Lt={arguments:"an arguments object",array:"an array",boolean:"a boolean",buffer:"a buffer",date:"a date",error:"an error",float32array:"a float32array",float64array:"a float64array",function:"a function",int16array:"an int16array",int32array:"an int32array",int8array:"an int8array",map:"a Map",null:"null",number:"a number",object:"an object",regexp:"a regular expression",set:"a Set",string:"a string",symbol:"a symbol",uint16array:"an uint16array",uint32array:"an uint32array",uint8array:"an uint8array",uint8clampedarray:"an uint8clampedarray",undefined:"undefined",weakmap:"a WeakMap",weakset:"a WeakSet"};function tt(e){return Lt[Ht(e)]}tt.types=Lt;tt.typeOf=Ht;Bt.exports=tt});var qe=k((Xi,Rt)=>{var Yn=Object.prototype.toString;Rt.exports=function(t){if(t===void 0)return"undefined";if(t===null)return"null";var r=typeof t;if(r==="boolean")return"boolean";if(r==="string")return"string";if(r==="number")return"number";if(r==="symbol")return"symbol";if(r==="function")return Hn(t)?"generatorfunction":"function";if(En(t))return"array";if(zn(t))return"buffer";if(Bn(t))return"arguments";if(_n(t))return"date";if(Wn(t))return"error";if(Fn(t))return"regexp";switch(Vt(t)){case"Symbol":return"symbol";case"Promise":return"promise";case"WeakMap":return"weakmap";case"WeakSet":return"weakset";case"Map":return"map";case"Set":return"set";case"Int8Array":return"int8array";case"Uint8Array":return"uint8array";case"Uint8ClampedArray":return"uint8clampedarray";case"Int16Array":return"int16array";case"Uint16Array":return"uint16array";case"Int32Array":return"int32array";case"Uint32Array":return"uint32array";case"Float32Array":return"float32array";case"Float64Array":return"float64array"}if(Ln(t))return"generator";switch(r=Yn.call(t),r){case"[object Object]":return"object";case"[object Map Iterator]":return"mapiterator";case"[object Set Iterator]":return"setiterator";case"[object String Iterator]":return"stringiterator";case"[object Array Iterator]":return"arrayiterator"}return r.slice(8,-1).toLowerCase().replace(/\s/g,"")};function Vt(e){return typeof e.constructor=="function"?e.constructor.name:null}function En(e){return Array.isArray?Array.isArray(e):e instanceof Array}function Wn(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function _n(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function Fn(e){return e instanceof RegExp?!0:typeof e.flags=="string"&&typeof e.ignoreCase=="boolean"&&typeof e.multiline=="boolean"&&typeof e.global=="boolean"}function Hn(e,t){return Vt(e)==="GeneratorFunction"}function Ln(e){return typeof e.throw=="function"&&typeof e.return=="function"&&typeof e.next=="function"}function Bn(e){try{if(typeof e.length=="number"&&typeof e.callee=="function")return!0}catch(t){if(t.message.indexOf("callee")!==-1)return!0}return!1}function zn(e){return e.constructor&&typeof e.constructor.isBuffer=="function"?e.constructor.isBuffer(e):!1}});var te=k((Zt,Qt)=>{"use strict";var Vn=oe("util"),Gt=zt(),Rn=qe(),p=Zt=Qt.exports;p.extend=Jt;p.indexOf=Kn;p.escapeExpression=ei;p.isEmpty=ii;p.createFrame=ti;p.blockParams=ri;p.appendContextPath=ni;var Gn={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},Jn=/[&<>"'`=]/g,Zn=/[&<>"'`=]/;function Qn(e){return Gn[e]}function Jt(e){for(var t=1;t{"use strict";var ui=te();pe.contains=function(e,t,r){return e==null||t==null||isNaN(e.length)?!1:e.indexOf(t,r)!==-1};pe.chop=function(e){if(typeof e!="string")return"";var t=/^[-_.\W\s]+|[-_.\W\s]+$/g;return e.trim().replace(t,"")};pe.changecase=function(e,t){if(typeof e!="string")return"";if(e.length===1)return e.toLowerCase();e=pe.chop(e).toLowerCase(),typeof t!="function"&&(t=ui.identity);var r=/[-_.\W\s]+(\w|$)/g;return e.replace(r,function(n,i){return t(i)})};pe.random=function(e,t){return e+Math.floor(Math.random()*(t-e+1))}});var Kt=k((eu,Xt)=>{"use strict";var si=je(),Q=Xt.exports;Q.abs=function(e){if(isNaN(e))throw new TypeError("expected a number");return Math.abs(e)};Q.add=function(e,t){return!isNaN(e)&&!isNaN(t)?Number(e)+Number(t):typeof e=="string"&&typeof t=="string"?e+t:""};Q.avg=function(){let e=[].concat.apply([],arguments);return e.pop(),Q.sum(e)/e.length};Q.ceil=function(e){if(isNaN(e))throw new TypeError("expected a number");return Math.ceil(e)};Q.divide=function(e,t){if(isNaN(e))throw new TypeError("expected the first argument to be a number");if(isNaN(t))throw new TypeError("expected the second argument to be a number");return Number(e)/Number(t)};Q.floor=function(e){if(isNaN(e))throw new TypeError("expected a number");return Math.floor(e)};Q.minus=function(e,t){if(isNaN(e))throw new TypeError("expected the first argument to be a number");if(isNaN(t))throw new TypeError("expected the second argument to be a number");return Number(e)-Number(t)};Q.modulo=function(e,t){if(isNaN(e))throw new TypeError("expected the first argument to be a number");if(isNaN(t))throw new TypeError("expected the second argument to be a number");return Number(e)%Number(t)};Q.multiply=function(e,t){if(isNaN(e))throw new TypeError("expected the first argument to be a number");if(isNaN(t))throw new TypeError("expected the second argument to be a number");return Number(e)*Number(t)};Q.plus=function(e,t){if(isNaN(e))throw new TypeError("expected the first argument to be a number");if(isNaN(t))throw new TypeError("expected the second argument to be a number");return Number(e)+Number(t)};Q.random=function(e,t){if(isNaN(e))throw new TypeError("expected minimum to be a number");if(isNaN(t))throw new TypeError("expected maximum to be a number");return si.random(e,t)};Q.remainder=function(e,t){return e%t};Q.round=function(e){if(isNaN(e))throw new TypeError("expected a number");return Math.round(e)};Q.subtract=function(e,t){if(isNaN(e))throw new TypeError("expected the first argument to be a number");if(isNaN(t))throw new TypeError("expected the second argument to be a number");return Number(e)-Number(t)};Q.sum=function(){for(var e=[].concat.apply([],arguments),t=e.length,r=0;t--;)isNaN(e[t])||(r+=Number(e[t]));return r}});var tr=k((tu,er)=>{"use strict";er.exports=function(t){return t!=null&&typeof t=="object"&&Array.isArray(t)===!1}});var Me=k((ru,ur)=>{var ir=tr();ur.exports=function(e,t,r){if(ir(r)||(r={default:r}),!nr(e))return typeof r.default<"u"?r.default:e;typeof t=="number"&&(t=String(t));let n=Array.isArray(t),i=typeof t=="string",u=r.separator||".",s=r.joinChar||(typeof u=="string"?u:".");if(!i&&!n)return e;if(i&&t in e)return it(t,e,r)?e[t]:r.default;let a=n?t:ai(t,u,r),w=a.length,g=0;do{let l=a[g];for(typeof l=="number"&&(l=String(l));l&&l.slice(-1)==="\\";)l=rr([l.slice(0,-1),a[++g]||""],s,r);if(l in e){if(!it(l,e,r))return r.default;e=e[l]}else{let x=!1,v=g+1;for(;v{"use strict";sr.exports=function(t){if(typeof t!="object")throw new TypeError("createFrame expects data to be an object");var r=Object.assign({},t);if(r._parent=t,r.extend=function(s){Object.assign(this,s)},arguments.length>1)for(var n=[].slice.call(arguments,1),i=n.length,u=-1;++u{"use strict";var y=te(),P=ar.exports,ce=Me(),oi=ut();P.after=function(e,t){return y.isUndefined(e)?"":(e=y.result(e),Array.isArray(e)?e.slice(t):"")};P.arrayify=function(e){return y.isUndefined(e)?[]:e?Array.isArray(e)?e:[e]:[]};P.before=function(e,t){return y.isUndefined(e)?"":(e=y.result(e),Array.isArray(e)?e.slice(0,t-1):"")};P.eachIndex=function(e,t){var r="";if(y.isUndefined(e))return"";if(e=y.result(e),Array.isArray(e))for(var n=0;n0){for(var s=0;s-1,this,r):"")};P.isArray=function(e){return Array.isArray(e)};P.itemAt=function(e,t){if(y.isUndefined(e))return null;if(e=y.result(e),Array.isArray(e)){if(t=isNaN(t)?0:+t,t<0)return e[e.length+t];if(ti[t]>u[t]?1:-1)}return""};P.withAfter=function(e,t,r){if(y.isUndefined(e))return"";if(e=y.result(e),Array.isArray(e)){e=e.slice(t);for(var n="",i=0;i0){for(var i=[],u=0;u0&&u%t===0&&(n+=r.fn(i),i=[]),i.push(e[u]);n+=r.fn(i)}return n};P.withLast=function(e,t,r){if(y.isUndefined(e))return"";if(e=y.result(e),Array.isArray(e)){if(y.isUndefined(t)||(t=parseFloat(y.result(t))),y.isUndefined(t))return r=t,r.fn(e[e.length-1]);e=e.slice(-t);for(var n=e.length,i=-1,u="";++ig?1:w{"use strict";var or=te(),re=fr.exports;re.bytes=function(e,t,r){if(e==null||isNaN(e)&&(e=e.length,!e))return"0 B";isNaN(t)&&(t=2);var n=["B","kB","MB","GB","TB","PB","EB","ZB","YB"];t=Math.pow(10,t),e=Number(e);for(var i=n.length-1;i-->=0;){var u=Math.pow(10,i*3);if(u<=e+1){e=Math.round(e*t/u)/t,e+=" "+n[i];break}}return e};re.addCommas=function(e){return e.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,")};re.phoneNumber=function(e){return e=e.toString(),"("+e.substr(0,3)+") "+e.substr(3,3)+"-"+e.substr(6,4)};re.toAbbr=function(e,t){isNaN(e)&&(e=0),or.isUndefined(t)&&(t=2),e=Number(e),t=Math.pow(10,t);for(var r=["k","m","b","t","q"],n=r.length-1;n>=0;){var i=Math.pow(10,(n+1)*3);if(i<=e+1){e=Math.round(e*t/i)/t,e+=r[n];break}n--}return e};re.toExponential=function(e,t){return isNaN(e)&&(e=0),or.isUndefined(t)&&(t=0),Number(e).toExponential(t)};re.toFixed=function(e,t){return isNaN(e)&&(e=0),isNaN(t)&&(t=0),Number(e).toFixed(t)};re.toFloat=function(e){return parseFloat(e)};re.toInt=function(e){return parseInt(e,10)};re.toPrecision=function(e,t){return isNaN(e)&&(e=0),isNaN(t)&&(t=1),Number(e).toPrecision(t)}});var dr=k((su,lr)=>{"use strict";var st=oe("url"),ve=te(),fi=oe("querystring"),le=lr.exports;le.encodeURI=function(e){if(ve.isString(e))return encodeURIComponent(e)};le.escape=function(e){if(ve.isString(e))return fi.escape(e)};le.decodeURI=function(e){if(ve.isString(e))return decodeURIComponent(e)};le.urlResolve=function(e,t){return st.resolve(e,t)};le.urlParse=function(e){return st.parse(e)};le.stripQuerystring=function(e){if(ve.isString(e))return e.split("?")[0]};le.stripProtocol=function(e){if(ve.isString(e)){var t=st.parse(e);return t.protocol="",t.format()}}});var hr=k((au,mr)=>{var ci=`Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus imperdiet, nulla et dictum interdum, nisi lorem egestas odio, vitae scelerisque enim ligula venenatis dolor. Maecenas nisl est, ultrices nec congue eget, auctor vitae massa. Fusce luctus vestibulum augue ut aliquet. Mauris ante ligula, facilisis sed ornare eu, lobortis in odio. Praesent convallis urna a lacus interdum ut hendrerit risus congue. Nunc sagittis dictum nisi, sed ullamcorper ipsum dignissim ac. In at libero sed nunc venenatis imperdiet sed ornare turpis. Donec vitae dui eget tellus gravida venenatis. Integer fringilla congue eros non fermentum. Sed dapibus pulvinar nibh tempor porta. + + Crase tempor malesuada magna a vehicula. Nam sollicitudin vel turpis id fermentum. Ut sit amet nisl ac nulla vulputate ultrices vitae vitae urna. Quisque eget odio ac lectus vestibulum faucibus eget in metus. In pellentesque faucibus vestibulum. Nulla at nulla justo, eget luctus tortor. Nulla facilisi. Donec vulputate interdum sollicitudin. Nunc lacinia auctor quam sed pellentesque. Aliquam dui mauris, mattis quis lacus id, pellentesque lobortis odio. + + Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede. Donec nec justo eget felis facilisis fermentum. Aliquam porttitor mauris sit amet orci. Aenean dignissim pellentesque felis. Phasellus ultrices nulla quis nibh. Quisque a lectus. Donec consectetuer ligula vulputate sem tristique cursus. Nam nulla quam, gravida non, commodo a, sodales sit amet, nisi. Praesent id justo in neque elementum ultrices. Sed malesuada augue eu sapien sodales congue. Nam ut dui. Quisque a lectus. Donec consectetuer ligula vulputate sem tristique cursus. Nam nulla quam, gravida non, commodo a, sodales sit amet, nisi. Proin vel ante a orci tempus eleifend ut et magna. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus luctus urna sed urna ultricies ac tempor dui sagittis. In condimentum facilisis porta. Sed nec diam eu diam mattis viverra. Nulla fringilla, orci ac euismod semper, magna diam porttitor mauris, quis sollicitudin sapien justo in libero. Vestibulum mollis mauris enim. Morbi euismod magna ac lorem rutrum elementum. Donec viverra auctor lobortis. Pellentesque eu est a nulla placerat dignissim. Morbi a enim in magna semper bibendum. Etiam scelerisque, nunc ac egestas consequat, odio nibh euismod nulla, eget auctor orci nibh vel nisi. Aliquam erat volutpat. Sed quis velit. Nulla facilisi. Nulla libero. Vivamus fermentum nibh in augue. Praesent a lacus at urna congue rutrum. Nulla enim eros, porttitor eu, tempus id, varius non, nibh. Vestibulum imperdiet nibh vel magna lacinia ultrices. Sed id ligula quis est convallis tempor. + + Aliquam erat volutpat. Integer aliquam ultrices nunc. Ut lectus dui, tincidunt ac, scelerisque ac, ultrices vitae, risus. Donec vehicula augue eu neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris ut leo. Cras viverra metus rhoncus sem. Nulla et lectus vestibulum urna fringilla ultrices. Phasellus eu tellus sit amet tortor gravida placerat. Integer sapien est, iaculis in, pretium quis, viverra ac, nunc. Praesent eget sem vel leo ultrices bibendum. Aenean faucibus. Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac, nulla. Curabitur vehicula nisi a magna. Sed nec libero. Phasellus nonummy magna. Sed et libero nec ligula blandit fringilla. Ut pretium tempus gravida. Proin lacinia justo vel ipsum varius eget auctor est iaculis. + + Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Fusce luctus vestibulum augue ut aliquet. Nunc sagittis dictum nisi, sed ullamcorper ipsum dignissim ac. In at libero sed nunc venenatis imperdiet sed ornare turpis. Donec vitae dui eget tellus gravida venenatis. Integer fringilla congue eros non fermentum. Sed dapibus pulvinar nibh tempor porta. + + Nam dui erat, auctor a, dignissim quis. Aenean dignissim pellentesque felis. Sed gravida ante at nunc dictum placerat. Donec placerat nisl magna, et faucibus arcu condimentum sed. Curabitur et eros ac orci vehicula vestibulum sit amet at nunc. Maecenas non diam cursus, tincidunt nisi vitae, hendrerit enim. Donec vulputate felis id felis dapibus fermentum. + + Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede. Donec nec justo eget felis facilisis fermentum. Aliquam porttitor mauris sit amet orci. Aenean dignissim pellentesque felis. Phasellus ultrices nulla quis nibh. Quisque a lectus. Donec consectetuer ligula vulputate sem tristique cursus. Nam nulla quam, gravida non, commodo a, sodales sit amet, nisi. Praesent id justo in neque elementum ultrices. Sed malesuada augue eu sapien sodales congue. Nam ut dui. Quisque a lectus. Donec consectetuer ligula vulputate sem tristique cursus. Nam nulla quam, gravida non, commodo a, sodales sit amet, nisi. + + Pellentesque sit amet mauris eget lectus commodo viverra. Donec vulputate interdum sollicitudin. Nunc lacinia auctor quam sed pellentesque. Aliquam dui mauris, mattis quis lacus id, pellentesque lobortis odio. Cras ultricies ligula sed magna dictum porta. Curabitur aliquet quam id dui posuere blandit. Nulla porttitor accumsan tincidunt. Donec sollicitudin molestie malesuada. Curabitur arcu erat, accumsan id imperdiet et, porttitor at sem. Sed porttitor lectus nibh. Pellentesque in ipsum id orci porta dapibus. Vestibulum ac diam sit amet quam vehicula elementum sed sit amet dui. + + Cras ultricies ligula sed magna dictum porta. Donec rutrum congue leo eget malesuada. Nulla quis lorem ut libero malesuada feugiat. Proin eget tortor risus. Nulla quis lorem ut libero malesuada feugiat. Proin eget tortor risus. Curabitur aliquet quam id dui posuere blandit. Vestibulum ac diam sit amet quam vehicula elementum sed sit amet dui. Pellentesque in ipsum id orci porta dapibus. Curabitur non nulla sit amet nisl tempus convallis quis ac lectus. Donec rutrum congue leo eget malesuada. Vivamus suscipit tortor eget felis porttitor volutpat. Nulla porttitor accumsan tincidunt. + + Donec sollicitudin molestie malesuada. Pellentesque in ipsum id orci porta dapibus. Curabitur non nulla sit amet nisl tempus convallis quis ac lectus. Nulla quis lorem ut libero malesuada feugiat. Proin eget tortor risus. Cras ultricies ligula sed magna dictum porta. Donec sollicitudin molestie malesuada. Pellentesque in ipsum id orci porta dapibus. Vestibulum ac diam sit amet quam vehicula elementum sed sit amet dui. Curabitur non nulla sit amet nisl tempus convallis quis ac lectus. Nulla quis lorem ut libero malesuada feugiat. Proin eget tortor risus. Curabitur aliquet quam id dui posuere blandit. + + Vestibulum ac diam sit amet quam vehicula elementum sed sit amet dui. Curabitur non nulla sit amet nisl tempus convallis quis ac lectus. Nulla quis lorem ut libero malesuada feugiat. Proin eget tortor risus. Cras ultricies ligula sed magna dictum porta. Donec sollicitudin molestie malesuada. Pellentesque in ipsum id orci porta dapibus. Vestibulum ac diam sit amet quam vehicula elementum sed sit amet dui. Curabitur non nulla sit amet nisl tempus convallis quis ac lectus. Nulla quis lorem ut libero malesuada feugiat. Proin eget tortor risus. + + Curabitur aliquet quam id dui posuere blandit. Vestibulum ac diam sit amet quam vehicula elementum sed sit amet dui. Pellentesque in ipsum id orci porta dapibus. Curabitur non nulla sit amet nisl tempus convallis quis ac lectus. Nulla quis lorem ut libero malesuada feugiat. Proin eget tortor risus. Cras ultricies ligula sed magna dictum porta. Donec sollicitudin molestie malesuada. Pellentesque in ipsum id orci porta dapibus. Vestibulum ac diam sit amet quam vehicula elementum sed sit amet dui. Curabitur non nulla sit amet nisl tempus convallis quis ac lectus. Nulla quis lorem ut libero malesuada feugiat. Proin eget tortor risus. Curabitur aliquet quam id dui posuere blandit. Vestibulum ac diam sit amet quam vehicula elementum sed sit amet dui.`;mr.exports=ci});var yr=k((pr,gr)=>{"use strict";var z=te(),de=je(),M=gr.exports,li=hr();M.append=function(e,t){return typeof e=="string"&&typeof t=="string"?e+t:e};M.camelcase=function(e){return typeof e!="string"?"":de.changecase(e,function(t){return t.toUpperCase()})};M.capitalize=function(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)};M.capitalizeAll=function(e){if(typeof e!="string")return"";if(z.isString(e))return e.replace(/\w\S*/g,function(t){return M.capitalize(t)})};M.center=function(e,t){if(typeof e!="string")return"";for(var r="",n=0;n-1;)i++,n+=r;return i};M.pascalcase=function(e){return typeof e!="string"?"":(e=de.changecase(e,function(t){return t.toUpperCase()}),e.charAt(0).toUpperCase()+e.slice(1))};M.pathcase=function(e){return typeof e!="string"?"":de.changecase(e,function(t){return"/"+t})};M.plusify=function(e,t){return typeof e!="string"?"":(z.isString(t)||(t=" "),e.split(t).join("+"))};M.prepend=function(e,t){return typeof e=="string"&&typeof t=="string"?t+e:e};M.raw=function(e){var t=e.fn(),r=z.options(this,e);if(r.escape!==!1)for(var n=0;(n=t.indexOf("{{",n))!==-1;)t[n-1]!=="\\"&&(t=t.slice(0,n)+"\\"+t.slice(n)),n+=3;return t};M.remove=function(e,t){return typeof e!="string"?"":z.isString(t)?e.split(t).join(""):e};M.removeFirst=function(e,t){return typeof e!="string"?"":z.isString(t)?e.replace(t,""):e};M.replace=function(e,t,r){return typeof e!="string"?"":z.isString(t)?(z.isString(r)||(r=""),e.split(t).join(r)):e};M.replaceFirst=function(e,t,r){return typeof e!="string"?"":z.isString(t)?(z.isString(r)||(r=""),e.replace(t,r)):e};M.reverse=Ae().reverse;M.sentence=function(e){return typeof e!="string"?"":e.replace(/((?:\S[^\.\?\!]*)[\.\?\!]*)/g,function(t){return t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()})};M.snakecase=function(e){return typeof e!="string"?"":de.changecase(e,function(t){return"_"+t})};M.split=function(e,t){return typeof e!="string"?"":(z.isString(t)||(t=","),e.split(t))};M.startsWith=function(e,t,r){var n=[].slice.call(arguments);return r=n.pop(),z.isString(t)&&t.indexOf(e)===0?r.fn(this):typeof r.inverse=="function"?r.inverse(this):""};M.titleize=function(e){if(typeof e!="string")return"";for(var t=e.replace(/[- _]+/g," "),r=t.split(" "),n=r.length,i=[],u=0;n--;){var s=r[u++];i.push(pr.capitalize(s))}return i.join(" ")};M.trim=function(e){return typeof e=="string"?e.trim():""};M.trimLeft=function(e){if(z.isString(e))return e.replace(/^\s+/,"")};M.trimRight=function(e){if(z.isString(e))return e.replace(/\s+$/,"")};M.truncate=function(e,t,r){if(z.isString(e))return typeof r!="string"&&(r=""),e.length>t?e.slice(0,t-r.length)+r:e};M.truncateWords=function(e,t,r){if(z.isString(e)&&!isNaN(t)){typeof r!="string"&&(r="\u2026");var n=Number(t),i=e.split(/[ \t]/);if(n>=i.length)return e;i=i.slice(0,n);var u=i.join(" ").trim();return u+r}};M.upcase=function(){return M.uppercase.apply(this,arguments)};M.uppercase=function(e){return z.isObject(e)&&e.fn?e.fn(this).toUpperCase():typeof e!="string"?"":e.toUpperCase()};M.lorem=function(e){return(isNaN(e)||e<1||!e)&&(e=11),li.substring(0,e)}});var br=k((ou,vr)=>{"use strict";var di=qe();vr.exports=function e(t){switch(di(t)){case"boolean":case"date":case"function":case"null":case"number":return!0;case"undefined":return!1;case"regexp":return t.source!=="(?:)"&&t.source!=="";case"buffer":return t.toString()!=="";case"error":return t.message!=="";case"string":case"arguments":return t.length!==0;case"file":case"map":case"set":return t.size!==0;case"array":case"object":for(let r of Object.keys(t))if(e(t[r]))return!0;return!1;default:return!0}}});var wr=k((fu,$r)=>{"use strict";var mi=Me(),hi=br();$r.exports=function(e,t,r){return pi(e)&&(typeof t=="string"||Array.isArray(t))?hi(mi(e,t,r)):!1};function pi(e){return e!=null&&(typeof e=="object"||typeof e=="function"||Array.isArray(e))}});var xr=k((cu,Or)=>{"use strict";function at(e,t){if(!e)return!0;let r=t||at.keywords;Array.isArray(r)||(r=[r]);let n=typeof e=="string"?e.toLowerCase():null;for(let i of r)if(i===e||i===n)return!0;return!1}at.keywords=["0","false","nada","nil","nay","nah","negative","no","none","nope","nul","null","nix","nyet","uh-uh","veto","zero"];Or.exports=at});var Sr=k((lu,Nr)=>{"use strict";Nr.exports=function(t){let r=Math.abs(t);if(isNaN(r))throw new TypeError("expected a number");if(!Number.isInteger(r))throw new Error("expected an integer");if(!Number.isSafeInteger(r))throw new Error("value exceeds maximum safe integer");return r%2===1}});var Ar=k((du,Mr)=>{"use strict";var gi=wr(),A=te(),yi=je(),qr=xr(),jr=Sr(),W=Mr.exports;W.and=function(){for(var e=arguments.length-1,t=arguments[e],r=!0,n=0;n":i=e>r;break;case"<=":i=e<=r;break;case">=":i=e>=r;break;case"typeof":i=typeof e===r;break;default:throw new Error("helper {{compare}}: invalid operator: `"+t+"`")}return A.value(i,this,n)};W.contains=function(e,t,r,n){typeof r=="object"&&(n=r,r=void 0);var i=yi.contains(e,t,r);return A.value(i,this,n)};W.default=function(){for(var e=0;et,this,r)};W.gte=function(e,t,r){return arguments.length===2&&(r=t,t=r.hash.compare),A.value(e>=t,this,r)};W.has=function(e,t,r){return A.isOptions(e)&&(r=e,t=null,e=null),A.isOptions(t)&&(r=t,t=null),e===null?A.value(!1,this,r):arguments.length===2?A.value(gi(this,e),this,r):(Array.isArray(e)||A.isString(e))&&A.isString(t)&&e.indexOf(t)>-1?A.fn(!0,this,r):A.isObject(e)&&A.isString(t)&&t in e?A.fn(!0,this,r):A.inverse(!1,this,r)};W.isFalsey=function(e,t){return A.value(qr(e),this,t)};W.isTruthy=function(e,t){return A.value(!qr(e),this,t)};W.ifEven=function(e,t){return A.value(!jr(e),this,t)};W.ifNth=function(e,t,r){var n=!isNaN(e)&&!isNaN(t)&&t%e===0;return A.value(n,this,r)};W.ifOdd=function(e,t){return A.value(jr(e),this,t)};W.is=function(e,t,r){return arguments.length===2&&(r=t,t=r.hash.compare),A.value(e==t,this,r)};W.isnt=function(e,t,r){return arguments.length===2&&(r=t,t=r.hash.compare),A.value(e!=t,this,r)};W.lt=function(e,t,r){return arguments.length===2&&(r=t,t=r.hash.compare),A.value(e=t,this,r)};W.unlessGteq=function(e,t,r){return A.isOptions(t)&&(r=t,t=r.hash.compare),A.value(et,this,r)}});var kr=k((mu,Dr)=>{var vi=et(),bi=Object.prototype.toString;Dr.exports=function(t){if(typeof t>"u")return"undefined";if(t===null)return"null";if(t===!0||t===!1||t instanceof Boolean)return"boolean";if(typeof t=="string"||t instanceof String)return"string";if(typeof t=="number"||t instanceof Number)return"number";if(typeof t=="function"||t instanceof Function)return"function";if(typeof Array.isArray<"u"&&Array.isArray(t))return"array";if(t instanceof RegExp)return"regexp";if(t instanceof Date)return"date";var r=bi.call(t);return r==="[object RegExp]"?"regexp":r==="[object Date]"?"date":r==="[object Arguments]"?"arguments":r==="[object Error]"?"error":vi(t)?"buffer":r==="[object Set]"?"set":r==="[object WeakSet]"?"weakset":r==="[object Map]"?"map":r==="[object WeakMap]"?"weakmap":r==="[object Symbol]"?"symbol":r==="[object Int8Array]"?"int8array":r==="[object Uint8Array]"?"uint8array":r==="[object Uint8ClampedArray]"?"uint8clampedarray":r==="[object Int16Array]"?"int16array":r==="[object Uint16Array]"?"uint16array":r==="[object Int32Array]"?"int32array":r==="[object Uint32Array]"?"uint32array":r==="[object Float32Array]"?"float32array":r==="[object Float64Array]"?"float64array":"object"}});var Tr=k((hu,Ur)=>{"use strict";var $i=kr();Ur.exports=function(t){var r=$i(t);if(r!=="number"&&r!=="string")return!1;var n=+t;return n-n+1>=0&&t!==""}});var Pr=k((pu,Cr)=>{"use strict";var wi=Tr();Cr.exports=function(t,r){if(!r)return t;if(!t)return{};for(var n=String(r).split(/[[.\]]/).filter(Boolean),i=n[n.length-1],u={};r=n.shift();)if(t=t[r],!t)return{};return wi(i)?[t]:(u[i]=t,u)}});var Wr=k((gu,Er)=>{"use strict";var Oi=Object.hasOwnProperty,be=te(),xi=Ae(),V=Er.exports,Ni=Me(),Ir=Pr(),Yr=ut();V.extend=function(){var e=[].slice.call(arguments),t={};be.isOptions(e[e.length-1])&&(t=e.pop().hash,e.push(t));for(var r={},n=0;n{"use strict";var Si=te(),_r=Fr.exports,qi=qe();_r.toRegex=function(e,t,r){var n=Si.options({},t,r);return new RegExp(e,n.flags)};_r.test=function(e,t){if(typeof e!="string")return!1;if(qi(t)!=="regexp")throw new TypeError("expected a regular expression");return t.test(e)}});function $e(){return De>ke.length-16&&(Lr.default.randomFillSync(ke),De=0),ke.slice(De,De+=16)}var Lr,ke,De,ot=Z(()=>{Lr=_(oe("crypto")),ke=new Uint8Array(256),De=ke.length});var Br,zr=Z(()=>{Br=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i});function ji(e){return typeof e=="string"&&Br.test(e)}var ue,we=Z(()=>{zr();ue=ji});function me(e,t=0){return R[e[t+0]]+R[e[t+1]]+R[e[t+2]]+R[e[t+3]]+"-"+R[e[t+4]]+R[e[t+5]]+"-"+R[e[t+6]]+R[e[t+7]]+"-"+R[e[t+8]]+R[e[t+9]]+"-"+R[e[t+10]]+R[e[t+11]]+R[e[t+12]]+R[e[t+13]]+R[e[t+14]]+R[e[t+15]]}function Mi(e,t=0){let r=me(e,t);if(!ue(r))throw TypeError("Stringified UUID is invalid");return r}var R,Vr,Oe=Z(()=>{we();R=[];for(let e=0;e<256;++e)R.push((e+256).toString(16).slice(1));Vr=Mi});function Ai(e,t,r){let n=t&&r||0,i=t||new Array(16);e=e||{};let u=e.node||Rr,s=e.clockseq!==void 0?e.clockseq:ft;if(u==null||s==null){let v=e.random||(e.rng||$e)();u==null&&(u=Rr=[v[0]|1,v[1],v[2],v[3],v[4],v[5]]),s==null&&(s=ft=(v[6]<<8|v[7])&16383)}let a=e.msecs!==void 0?e.msecs:Date.now(),w=e.nsecs!==void 0?e.nsecs:lt+1,g=a-ct+(w-lt)/1e4;if(g<0&&e.clockseq===void 0&&(s=s+1&16383),(g<0||a>ct)&&e.nsecs===void 0&&(w=0),w>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");ct=a,lt=w,ft=s,a+=122192928e5;let l=((a&268435455)*1e4+w)%4294967296;i[n++]=l>>>24&255,i[n++]=l>>>16&255,i[n++]=l>>>8&255,i[n++]=l&255;let x=a/4294967296*1e4&268435455;i[n++]=x>>>8&255,i[n++]=x&255,i[n++]=x>>>24&15|16,i[n++]=x>>>16&255,i[n++]=s>>>8|128,i[n++]=s&255;for(let v=0;v<6;++v)i[n+v]=u[v];return t||me(i)}var Rr,ft,ct,lt,Gr,Jr=Z(()=>{ot();Oe();ct=0,lt=0;Gr=Ai});function Di(e){if(!ue(e))throw TypeError("Invalid UUID");let t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=t&255,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=t&255,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=t&255,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=t&255,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=t&255,r}var Ue,dt=Z(()=>{we();Ue=Di});function ki(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r{Oe();dt();Ui="6ba7b810-9dad-11d1-80b4-00c04fd430c8",Ti="6ba7b811-9dad-11d1-80b4-00c04fd430c8"});function Ci(e){return Array.isArray(e)?e=Buffer.from(e):typeof e=="string"&&(e=Buffer.from(e,"utf8")),Zr.default.createHash("md5").update(e).digest()}var Zr,Qr,Xr=Z(()=>{Zr=_(oe("crypto"));Qr=Ci});var Pi,Kr,en=Z(()=>{mt();Xr();Pi=xe("v3",48,Qr),Kr=Pi});var tn,ht,rn=Z(()=>{tn=_(oe("crypto")),ht={randomUUID:tn.default.randomUUID}});function Ii(e,t,r){if(ht.randomUUID&&!t&&!e)return ht.randomUUID();e=e||{};let n=e.random||(e.rng||$e)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let i=0;i<16;++i)t[r+i]=n[i];return t}return me(n)}var nn,un=Z(()=>{rn();ot();Oe();nn=Ii});function Yi(e){return Array.isArray(e)?e=Buffer.from(e):typeof e=="string"&&(e=Buffer.from(e,"utf8")),sn.default.createHash("sha1").update(e).digest()}var sn,an,on=Z(()=>{sn=_(oe("crypto"));an=Yi});var Ei,fn,cn=Z(()=>{mt();on();Ei=xe("v5",80,an),fn=Ei});var ln,dn=Z(()=>{ln="00000000-0000-0000-0000-000000000000"});function Wi(e){if(!ue(e))throw TypeError("Invalid UUID");return parseInt(e.slice(14,15),16)}var mn,hn=Z(()=>{we();mn=Wi});var pn={};pt(pn,{NIL:()=>ln,parse:()=>Ue,stringify:()=>Vr,v1:()=>Gr,v3:()=>Kr,v4:()=>nn,v5:()=>fn,validate:()=>ue,version:()=>mn});var gn=Z(()=>{Jr();en();un();cn();dn();hn();we();Oe();dt()});var vn=k((ns,yn)=>{var _i=(gn(),yt(pn)),Fi=yn.exports;Fi.uuid=function(){return _i.v4()}});var Vi={};pt(Vi,{default:()=>zi});var X=_(vt()),jt=_(bt()),Mt=_($t()),At=_(wt()),Dt=_(Ot()),kt=_(xt()),Ut=_(Nt()),Tt=_(St()),Ct=_(qt());X.default.extend(jt.default);X.default.extend(Mt.default);X.default.extend(At.default);X.default.extend(Dt.default);X.default.extend(kt.default);X.default.extend(Ut.default);X.default.extend(Tt.default);X.default.extend(Ct.default);function fe(e){return typeof e=="object"&&typeof e.hash=="object"}function Qe(e){return typeof e=="object"&&typeof e.options=="object"&&typeof e.app=="object"}function Xe(e,t,r){if(fe(e))return Xe({},t,e);if(fe(t))return Xe(e,r,t);let n=Qe(e)?e.context:{};r=r||{},fe(r)||(t=Object.assign({},t,r)),fe(r)&&r.hash.root===!0&&(t=Object.assign({},r.data.root,t));let i=Object.assign({},n,t,r.hash);return Qe(e)||(i=Object.assign({},e,i)),Qe(e)&&e.view&&e.view.data&&(i=Object.assign({},i,e.view.data)),i}function Ke(e,t,r){return fe(t)&&(r=t,t=null),fe(e)&&(r=e,t=null,e=null),{str:e,pattern:t,options:r}}function Pt(e,t,r){let n=Ke(e,t,r),i={lang:"en",date:new Date(n.str)},u=Xe(this,i,{});X.default.locale(u.lang||u.language)}var It=(e,t,r)=>{let n=Ke(e,t,r);if(n.str==null&&n.pattern==null)return X.default.locale("en"),(0,X.default)().format("MMMM DD, YYYY");Pt(n.str,n.pattern,n.options);let i=(0,X.default)(new Date(n.str));return typeof n.options=="string"?i=n.options.toLowerCase()==="utc"?i.utc():i.tz(n.options):i=i.tz(X.default.tz.guess()),n.pattern===""?i.toISOString():i.format(n.pattern)},Yt=(e,t,r)=>{let n=Ke(e,t);Pt(n.str,n.pattern);let i=X.default.duration(n.str,n.pattern);return r&&!fe(r)?i.format(r):i.humanize()};var bn=_(Kt()),$n=_(Ae()),wn=_(cr()),On=_(dr()),xn=_(yr()),Nn=_(Ar()),Sn=_(Wr()),qn=_(Hr()),jn=_(vn()),Hi={math:bn.default,array:$n.default,number:wn.default,url:On.default,string:xn.default,comparison:Nn.default,object:Sn.default,regex:qn.default,uuid:jn.default},Li=["sortBy"],Bi={date:It,duration:Yt},ne;function Mn(){if(ne)return ne;ne={};for(let e of Object.values(Hi))for(let[t,r]of Object.entries(e))ne[t]=(...n)=>r(...n,{});ne={...ne,...Bi};for(let e of Li)delete ne[e];return Object.freeze(ne),ne}var zi={...Mn(),stripProtocol:helpersStripProtocol};return yt(Vi);})(); /*! Bundled license information: is-buffer/index.js: diff --git a/packages/server/src/jsRunner/tests/jsRunner.spec.ts b/packages/server/src/jsRunner/tests/jsRunner.spec.ts index 9d2bd7104d..fcd58fd0f1 100644 --- a/packages/server/src/jsRunner/tests/jsRunner.spec.ts +++ b/packages/server/src/jsRunner/tests/jsRunner.spec.ts @@ -50,7 +50,7 @@ describe("jsRunner (using isolated-vm)", () => { describe("helpers", () => { runJsHelpersTests({ funcWrap: (func: any) => config.doInContext(config.getAppId(), func), - testsToSkip: ["random", "uuid"], + testsToSkip: ["random", "uuid", "lorem"], }) describe("uuid", () => { @@ -71,6 +71,14 @@ describe("jsRunner (using isolated-vm)", () => { expect(result).toBeLessThanOrEqual(max) }) }) + + describe("lorem", () => { + it("should be able to generate lorem", async () => { + const result = await processJS(`return helpers.lorem(10)`) + expect(result).toBeDefined() + expect(result).toBe("Lorem ipsu") + }) + }) }) // the test cases here were extracted from templates/real world examples of JS in Budibase diff --git a/yarn.lock b/yarn.lock index 081c321330..e2ad2636ac 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2076,10 +2076,10 @@ tar-fs "2.1.1" uuid "^8.3.2" -"@budibase/handlebars-helpers@^0.13.1": - version "0.13.1" - resolved "https://registry.yarnpkg.com/@budibase/handlebars-helpers/-/handlebars-helpers-0.13.1.tgz#d02e73c0df8305cd675e70dc37f8427eb0842080" - integrity sha512-v4RbXhr3igvK3i2pj5cNltu/4NMxdPIzcUt/o0RoInhesNH1VSLRdweSFr6/Y34fsCR5jHZ6vltdcz2RgrTKgw== +"@budibase/handlebars-helpers@^0.13.2": + version "0.13.2" + resolved "https://registry.yarnpkg.com/@budibase/handlebars-helpers/-/handlebars-helpers-0.13.2.tgz#73ab51c464e91fd955b429017648e0257060db77" + integrity sha512-/IGqyDcjN9AhKSagCsqQRavpraQRjGeSZeMb62yJiK0b/9r47BjzcOeuQbfRhwK1NlL2cSExNcrkWSxisbPvJQ== dependencies: get-object "^0.2.0" get-value "^3.0.1" @@ -2146,7 +2146,7 @@ "@budibase/string-templates@2.23.12": version "0.0.0" dependencies: - "@budibase/handlebars-helpers" "^0.13.1" + "@budibase/handlebars-helpers" "^0.13.2" dayjs "^1.10.8" handlebars "^4.7.8" lodash.clonedeep "^4.5.0" From c34e6c02e3990726b34e8266fd7a02f9a73f413d Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 5 Jul 2024 15:04:01 +0100 Subject: [PATCH 5/5] Removing pointless test case. --- packages/server/src/jsRunner/tests/jsRunner.spec.ts | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/packages/server/src/jsRunner/tests/jsRunner.spec.ts b/packages/server/src/jsRunner/tests/jsRunner.spec.ts index fcd58fd0f1..9d2bd7104d 100644 --- a/packages/server/src/jsRunner/tests/jsRunner.spec.ts +++ b/packages/server/src/jsRunner/tests/jsRunner.spec.ts @@ -50,7 +50,7 @@ describe("jsRunner (using isolated-vm)", () => { describe("helpers", () => { runJsHelpersTests({ funcWrap: (func: any) => config.doInContext(config.getAppId(), func), - testsToSkip: ["random", "uuid", "lorem"], + testsToSkip: ["random", "uuid"], }) describe("uuid", () => { @@ -71,14 +71,6 @@ describe("jsRunner (using isolated-vm)", () => { expect(result).toBeLessThanOrEqual(max) }) }) - - describe("lorem", () => { - it("should be able to generate lorem", async () => { - const result = await processJS(`return helpers.lorem(10)`) - expect(result).toBeDefined() - expect(result).toBe("Lorem ipsu") - }) - }) }) // the test cases here were extracted from templates/real world examples of JS in Budibase