diff --git a/CHANGELOG.md b/CHANGELOG.md index 788da115..390280c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ * Auto-link a plugin/theme license in details if it starts with `http` * Allow to fallback to `docs:` instead of `readme:` * Forward a `sid` to GPM when downloading a premium package + * Better support for array field key/value when either key or value is empty [#1972](https://github.com/getgrav/grav-plugin-admin/issues/1972) 1. [](#bugfix) * Fixed Safari issue with new ACL picker field [#1955](https://github.com/getgrav/grav-plugin-admin/issues/1955) * Stop propagation of ACL add button in ACL picker [flex-objects#83](https://github.com/trilbymedia/grav-plugin-flex-objects/issues/83) diff --git a/themes/grav/app/forms/fields/array.js b/themes/grav/app/forms/fields/array.js index d592f12b..913c8f6f 100644 --- a/themes/grav/app/forms/fields/array.js +++ b/themes/grav/app/forms/fields/array.js @@ -111,7 +111,13 @@ export default class ArrayField { let escaped_name = !template.isValueOnly() ? keyElement.val() : this.getIndexFor(element); escaped_name = escaped_name.toString().replace(/\[/g, '%5B').replace(/]/g, '%5D'); let name = `${template.getName()}[${escaped_name}]`; - valueElement.attr('name', !valueElement.val() ? template.getName() : name); + + if (!template.isValueOnly() && (!keyElement.val() && !valueElement.val())) { + valueElement.attr('name', ''); + } else { + // valueElement.attr('name', !valueElement.val() ? template.getName() : name); + valueElement.attr('name', name); + } this.refreshNames(template); } diff --git a/themes/grav/js/admin.min.js b/themes/grav/js/admin.min.js index f5056cd2..c0f4a74c 100644 --- a/themes/grav/js/admin.min.js +++ b/themes/grav/js/admin.min.js @@ -9,7 +9,7 @@ if(/\d/.test(n))return e.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)? }"string"==typeof t&&(t=[t]);var i=[];r(n.keywords),r(n.types),r(n.builtin),r(n.atoms),i.length&&(n.helperType=t[0],e.registerHelper("hintWords",t[0],i));for(var a=0;a!?|\/]/,j=l.isIdentifierChar||/[\w\$_\xa1-\uffff]/,P=l.isReservedIdentifier||!1;return{startState:function(e){return{tokenize:null,context:new t((e||0)-m,0,"top",null,!1),indented:0,startOfLine:!0,prevToken:null}},token:function(e,t){var o=t.context;if(e.sol()&&(null==o.align&&(o.align=!1),t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return f(e,t),null;p=h=null;var s=(t.tokenize||c)(e,t);if("comment"==s||"meta"==s)return s;if(null==o.align&&(o.align=!0),";"==p||":"==p||","==p&&e.match(/^\s*(?:\/\/.*)?$/,!1))for(;"statement"==t.context.type;)r(t);else if("{"==p)n(t,e.column(),"}");else if("["==p)n(t,e.column(),"]");else if("("==p)n(t,e.column(),")");else if("}"==p){for(;"statement"==o.type;)o=r(t);for("}"==o.type&&(o=r(t));"statement"==o.type;)o=r(t)}else p==o.type?r(t):E&&(("}"==o.type||"top"==o.type)&&";"!=p||"statement"==o.type&&"newstatement"==p)&&n(t,e.column(),"statement",e.current());if("variable"==s&&("def"==t.prevToken||l.typeFirstDefinitions&&i(e,t,e.start)&&a(t.context)&&e.match(/^\s*\(/,!1))&&(s="def"),C.token){var u=C.token(e,t,s);void 0!==u&&(s=u)}return"def"==s&&l.styleDefs===!1&&(s="variable"),t.startOfLine=!1,t.prevToken=h?"def":s||p,f(e,t),s},indent:function(t,n){if(t.tokenize!=c&&null!=t.tokenize||t.typeAtEndOfLine)return e.Pass;var r=t.context,i=n&&n.charAt(0),a=i==r.type;if("statement"==r.type&&"}"==i&&(r=r.prev),l.dontIndentStatements)for(;"statement"==r.type&&l.dontIndentStatements.test(r.info);)r=r.prev;if(C.indent){var o=C.indent(t,r,n,m);if("number"==typeof o)return o}var s=r.prev&&"switch"==r.prev.info;if(l.allmanIndentation&&/[{(]/.test(i)){for(;"top"!=r.type&&"}"!=r.type;)r=r.prev;return r.indented}return"statement"==r.type?r.indented+("{"==i?0:v):!r.align||g&&")"==r.type?")"!=r.type||a?r.indented+(a?0:m)+(a||!s||/^(?:case|default)\b/.test(n)?0:m):r.indented+v:r.column+(a?0:1)},electricInput:A?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:"//",fold:"brace"}});var x="auto if break case register continue return default do sizeof static else struct switch extern typedef union for goto while enum const volatile inline restrict asm fortran",C="alignas alignof and and_eq audit axiom bitand bitor catch class compl concept constexpr const_cast decltype delete dynamic_cast explicit export final friend import module mutable namespace new noexcept not not_eq operator or or_eq override private protected public reinterpret_cast requires static_assert static_cast template this thread_local throw try typeid typename using virtual xor xor_eq",S="bycopy byref in inout oneway out self super atomic nonatomic retain copy readwrite readonly strong weak assign typeof nullable nonnull null_resettable _cmd @interface @implementation @end @protocol @encode @property @synthesize @dynamic @class @public @package @private @protected @required @optional @try @catch @finally @import @selector @encode @defs @synchronized @autoreleasepool @compatibility_alias @available",E="FOUNDATION_EXPORT FOUNDATION_EXTERN NS_INLINE NS_FORMAT_FUNCTION NS_RETURNS_RETAINEDNS_ERROR_ENUM NS_RETURNS_NOT_RETAINED NS_RETURNS_INNER_POINTER NS_DESIGNATED_INITIALIZER NS_ENUM NS_OPTIONS NS_REQUIRES_NIL_TERMINATION NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_END NS_SWIFT_NAME NS_REFINED_FOR_SWIFT",A=o("int long char short double float unsigned signed void bool"),O=o("SEL instancetype id Class Protocol BOOL"),I="case do else for if switch while struct enum union",M="struct enum union";y(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:o(x),types:l,blockKeywords:o(I),defKeywords:o(M),typeFirstDefinitions:!0,atoms:o("NULL true false"),isReservedIdentifier:f,hooks:{"#":u,"*":d},modeProps:{fold:["brace","include"]}}),y(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:o(x+" "+C),types:l,blockKeywords:o(I+" class try catch"),defKeywords:o(M+" class namespace"),typeFirstDefinitions:!0,atoms:o("true false NULL nullptr"),dontIndentStatements:/^template$/,isIdentifierChar:/[\w\$_~\xa1-\uffff]/,isReservedIdentifier:f,hooks:{"#":u,"*":d,u:h,U:h,L:h,R:h,0:p,1:p,2:p,3:p,4:p,5:p,6:p,7:p,8:p,9:p,token:function(e,t,n){if("variable"==n&&"("==e.peek()&&(";"==t.prevToken||null==t.prevToken||"}"==t.prevToken)&&m(e.current()))return"def"}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),y("text/x-java",{name:"clike",keywords:o("abstract assert break case catch class const continue default do else enum extends final finally for goto if implements import instanceof interface native new package private protected public return static strictfp super switch synchronized this throw throws transient try volatile while @interface"),types:o("byte short int long float double boolean char void Boolean Byte Character Double Float Integer Long Number Object Short String StringBuffer StringBuilder Void"),blockKeywords:o("catch class do else finally for if switch try while"),defKeywords:o("class interface enum @interface"),typeFirstDefinitions:!0,atoms:o("true false null"),number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,hooks:{"@":function(e){return!e.match("interface",!1)&&(e.eatWhile(/[\w\$_]/),"meta")}},modeProps:{fold:["brace","import"]}}),y("text/x-csharp",{name:"clike",keywords:o("abstract as async await base break case catch checked class const continue default delegate do else enum event explicit extern finally fixed for foreach goto if implicit in interface internal is lock namespace new operator out override params private protected public readonly ref return sealed sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using virtual void volatile while add alias ascending descending dynamic from get global group into join let orderby partial remove select set value var yield"),types:o("Action Boolean Byte Char DateTime DateTimeOffset Decimal Double Func Guid Int16 Int32 Int64 Object SByte Single String Task TimeSpan UInt16 UInt32 UInt64 bool byte char decimal double short int long object sbyte float string ushort uint ulong"),blockKeywords:o("catch class do else finally for foreach if struct switch try while"),defKeywords:o("class interface namespace struct var"),typeFirstDefinitions:!0,atoms:o("true false null"),hooks:{"@":function(e,t){return e.eat('"')?(t.tokenize=v,v(e,t)):(e.eatWhile(/[\w\$_]/),"meta")}}}),y("text/x-scala",{name:"clike",keywords:o("abstract case catch class def do else extends final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try type val var while with yield _ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble"),types:o("AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq Int Integral Iterable Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),multiLineStrings:!0,blockKeywords:o("catch class enum do else finally for forSome if match switch try while"),defKeywords:o("class enum def object package trait type val var"),atoms:o("true false null"),indentStatements:!1,indentSwitch:!1,isOperatorChar:/[+\-*&%=<>!?|\/#:@]/,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,t){return!!e.match('""')&&(t.tokenize=_,t.tokenize(e,t))},"'":function(e){return e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},"=":function(e,n){var r=n.context;return!("}"!=r.type||!r.align||!e.eat(">"))&&(n.context=new t(r.indented,r.column,r.type,r.info,null,r.prev),"operator")},"/":function(e,t){return!!e.eat("*")&&(t.tokenize=b(1),t.tokenize(e,t))}},modeProps:{closeBrackets:{pairs:'()[]{}""',triples:'"'}}}),y("text/x-kotlin",{name:"clike",keywords:o("package as typealias class interface this super val operator var fun for is in This throw return annotation break continue object if else while do try when !in !is as? file import where by get set abstract enum open inner override private public internal protected catch finally out final vararg reified dynamic companion constructor init sealed field property receiver param sparam lateinit data inline noinline tailrec external annotation crossinline const operator infix suspend actual expect setparam"),types:o("Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void Annotation Any BooleanArray ByteArray Char CharArray DeprecationLevel DoubleArray Enum FloatArray Function Int IntArray Lazy LazyThreadSafetyMode LongArray Nothing ShortArray Unit"),intendSwitch:!1,indentStatements:!1,multiLineStrings:!0,number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+(\.\d+)?|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,blockKeywords:o("catch class do else finally for if where try while enum"),defKeywords:o("class val var object interface fun"),atoms:o("true false null this"),hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},"*":function(e,t){return"."==t.prevToken?"variable":"operator"},'"':function(e,t){return t.tokenize=w(e.match('""')),t.tokenize(e,t)},"/":function(e,t){return!!e.eat("*")&&(t.tokenize=b(1),t.tokenize(e,t))},indent:function(e,t,n,r){var i=n&&n.charAt(0);return"}"!=e.prevToken&&")"!=e.prevToken||""!=n?"operator"==e.prevToken&&"}"!=n&&"}"!=e.context.type||"variable"==e.prevToken&&"."==i||("}"==e.prevToken||")"==e.prevToken)&&"."==i?2*r+t.indented:t.align&&"}"==t.type?t.indented+(e.context.type==(n||"").charAt(0)?0:r):void 0:e.indented}},modeProps:{closeBrackets:{triples:'"'}}}),y(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:o("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),types:o("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),blockKeywords:o("for while do if else struct"),builtin:o("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),atoms:o("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),indentSwitch:!1,hooks:{"#":u},modeProps:{fold:["brace","include"]}}),y("text/x-nesc",{name:"clike",keywords:o(x+" as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),types:l,blockKeywords:o(I),atoms:o("null true false"),hooks:{"#":u},modeProps:{fold:["brace","include"]}}),y("text/x-objectivec",{name:"clike",keywords:o(x+" "+S),types:c,builtin:o(E),blockKeywords:o(I+" @synthesize @try @catch @finally @autoreleasepool @synchronized"),defKeywords:o(M+" @interface @implementation @protocol @class"),dontIndentStatements:/^@.*$/,typeFirstDefinitions:!0,atoms:o("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:f,hooks:{"#":u,"*":d},modeProps:{fold:["brace","include"]}}),y("text/x-objectivec++",{name:"clike",keywords:o(x+" "+S+" "+C),types:c,builtin:o(E),blockKeywords:o(I+" @synthesize @try @catch @finally @autoreleasepool @synchronized class try catch"),defKeywords:o(M+" @interface @implementation @protocol @class class namespace"),dontIndentStatements:/^@.*$|^template$/,typeFirstDefinitions:!0,atoms:o("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:f,hooks:{"#":u,"*":d,u:h,U:h,L:h,R:h,0:p,1:p,2:p,3:p,4:p,5:p,6:p,7:p,8:p,9:p,token:function(e,t,n){if("variable"==n&&"("==e.peek()&&(";"==t.prevToken||null==t.prevToken||"}"==t.prevToken)&&m(e.current()))return"def"}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),y("text/x-squirrel",{name:"clike",keywords:o("base break clone continue const default delete enum extends function in class foreach local resume return this throw typeof yield constructor instanceof static"),types:l,blockKeywords:o("case catch class else for foreach if switch try while"),defKeywords:o("function local class"),typeFirstDefinitions:!0,atoms:o("true false null"),hooks:{"#":u},modeProps:{fold:["brace","include"]}});var D=null;y("text/x-ceylon",{name:"clike",keywords:o("abstracts alias assembly assert assign break case catch class continue dynamic else exists extends finally for function given if import in interface is let module new nonempty object of out outer package return satisfies super switch then this throw try value void while"),types:function(e){var t=e.charAt(0);return t===t.toUpperCase()&&t!==t.toLowerCase()},blockKeywords:o("case catch class dynamic else finally for function if interface module new object switch try while"),defKeywords:o("class dynamic function interface module object package value"),builtin:o("abstract actual aliased annotation by default deprecated doc final formal late license native optional sealed see serializable shared suppressWarnings tagged throws variable"),isPunctuationChar:/[\[\]{}\(\),;\:\.`]/,isOperatorChar:/[+\-*&%=<>!?|^~:\/]/,numberStart:/[\d#$]/,number:/^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,multiLineStrings:!0,typeFirstDefinitions:!0,atoms:o("true false null larger smaller equal empty finished"),indentSwitch:!1,styleDefs:!1,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,t){return t.tokenize=k(e.match('""')?"triple":"single"),t.tokenize(e,t)},"`":function(e,t){return!(!D||!e.match("`"))&&(t.tokenize=D,D=null,t.tokenize(e,t))},"'":function(e){return e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},token:function(e,t,n){if(("variable"==n||"type"==n)&&"."==t.prevToken)return"variable-2"}},modeProps:{fold:["brace","import"],closeBrackets:{triples:'"'}}})})},function(e,t,n){!function(e){e(n(399),n(436))}(function(e){"use strict";e.defineMode("sass",function(t){function n(e){return new RegExp("^"+e.join("|"))}function r(e){return!e.peek()||e.match(/\s+$/,!1)}function i(e,t){var n=e.peek();return")"===n?(e.next(),t.tokenizer=u,"operator"):"("===n?(e.next(),e.eatSpace(),"operator"):"'"===n||'"'===n?(t.tokenizer=o(e.next()),"string"):(t.tokenizer=o(")",!1),"string")}function a(e,t){return function(n,r){return n.sol()&&n.indentation()<=e?(r.tokenizer=u,u(n,r)):(t&&n.skipTo("*/")?(n.next(),n.next(),r.tokenizer=u):n.skipToEnd(),"comment")}}function o(e,t){function n(i,a){var o=i.next(),l=i.peek(),c=i.string.charAt(i.pos-2),d="\\"!==o&&l===e||o===e&&"\\"!==c;return d?(o!==e&&t&&i.next(),r(i)&&(a.cursorHalf=0),a.tokenizer=u,"string"):"#"===o&&"{"===l?(a.tokenizer=s(n),i.next(),"operator"):"string"}return null==t&&(t=!0),n}function s(e){return function(t,n){return"}"===t.peek()?(t.next(),n.tokenizer=e,"operator"):u(t,n)}}function l(e){if(0==e.indentCount){e.indentCount++;var n=e.scopes[0].offset,r=n+t.indentUnit;e.scopes.unshift({offset:r})}}function c(e){1!=e.scopes.length&&e.scopes.shift()}function u(e,t){var n=e.peek();if(e.match("/*"))return t.tokenizer=a(e.indentation(),!0),t.tokenizer(e,t);if(e.match("//"))return t.tokenizer=a(e.indentation(),!1),t.tokenizer(e,t);if(e.match("#{"))return t.tokenizer=s(u),"operator";if('"'===n||"'"===n)return e.next(),t.tokenizer=o(n),"string";if(t.cursorHalf){if("#"===n&&(e.next(),e.match(/[0-9a-fA-F]{6}|[0-9a-fA-F]{3}/)))return r(e)&&(t.cursorHalf=0),"number";if(e.match(/^-?[0-9\.]+/))return r(e)&&(t.cursorHalf=0),"number";if(e.match(/^(px|em|in)\b/))return r(e)&&(t.cursorHalf=0),"unit";if(e.match(_))return r(e)&&(t.cursorHalf=0),"keyword";if(e.match(/^url/)&&"("===e.peek())return t.tokenizer=i,r(e)&&(t.cursorHalf=0),"atom";if("$"===n)return e.next(),e.eatWhile(/[\w-]/),r(e)&&(t.cursorHalf=0),"variable-2";if("!"===n)return e.next(),t.cursorHalf=0,e.match(/^[\w]+/)?"keyword":"operator";if(e.match(w))return r(e)&&(t.cursorHalf=0),"operator";if(e.eatWhile(/[\w-]/))return r(e)&&(t.cursorHalf=0),f=e.current().toLowerCase(),v.hasOwnProperty(f)?"atom":m.hasOwnProperty(f)?"keyword":h.hasOwnProperty(f)?(t.prevProp=e.current().toLowerCase(),"property"):"tag";if(r(e))return t.cursorHalf=0,null}else{if("-"===n&&e.match(/^-\w+-/))return"meta";if("."===n){if(e.next(),e.match(/^[\w-]+/))return l(t),"qualifier";if("#"===e.peek())return l(t),"tag"}if("#"===n){if(e.next(),e.match(/^[\w-]+/))return l(t),"builtin";if("#"===e.peek())return l(t),"tag"}if("$"===n)return e.next(),e.eatWhile(/[\w-]/),"variable-2";if(e.match(/^-?[0-9\.]+/))return"number";if(e.match(/^(px|em|in)\b/))return"unit";if(e.match(_))return"keyword";if(e.match(/^url/)&&"("===e.peek())return t.tokenizer=i,"atom";if("="===n&&e.match(/^=[\w-]+/))return l(t),"meta";if("+"===n&&e.match(/^\+[\w-]+/))return"variable-3";if("@"===n&&e.match(/@extend/)&&(e.match(/\s*[\w]/)||c(t)),e.match(/^@(else if|if|media|else|for|each|while|mixin|function)/))return l(t),"def";if("@"===n)return e.next(),e.eatWhile(/[\w-]/),"def";if(e.eatWhile(/[\w-]/)){if(e.match(/ *: *[\w-\+\$#!\("']/,!1)){f=e.current().toLowerCase();var d=t.prevProp+"-"+f;return h.hasOwnProperty(d)?"property":h.hasOwnProperty(f)?(t.prevProp=f,"property"):g.hasOwnProperty(f)?"property":"tag"}return e.match(/ *:/,!1)?(l(t),t.cursorHalf=1,t.prevProp=e.current().toLowerCase(),"property"):e.match(/ *,/,!1)?"tag":(l(t),"tag")}if(":"===n)return e.match(k)?"variable-3":(e.next(),t.cursorHalf=1,"operator")}return e.match(w)?"operator":(e.next(),null)}function d(e,n){e.sol()&&(n.indentCount=0);var r=n.tokenizer(e,n),i=e.current();if("@return"!==i&&"}"!==i||c(n),null!==r){for(var a=e.pos-i.length,o=a+t.indentUnit*n.indentCount,s=[],l=0;l","<","==",">=","<=","\\+","-","\\!=","/","\\*","%","and","or","not",";","\\{","\\}",":"],w=n(b),k=/^::?[a-zA-Z_][\w\-]*/;return{startState:function(){return{tokenizer:u,scopes:[{offset:0,type:"sass"}],indentCount:0,cursorHalf:0,definedVars:[],definedMixins:[]}},token:function(e,t){var n=d(e,t);return t.lastToken={style:n,content:e.current()},n},indent:function(e){return e.scopes[0].offset}}},"css"),e.defineMIME("text/x-sass","sass")})},function(e,t,n){!function(e){e(n(399),n(448))}(function(e){"use strict";e.defineMode("twig:inner",function(){function e(e,o){var s=e.peek();if(o.incomment)return e.skipTo("#}")?(e.eatWhile(/\#|}/),o.incomment=!1):e.skipToEnd(),"comment";if(o.intag){if(o.operator){if(o.operator=!1,e.match(i))return"atom";if(e.match(a))return"number"}if(o.sign){if(o.sign=!1,e.match(i))return"atom";if(e.match(a))return"number"}if(o.instring)return s==o.instring&&(o.instring=!1),e.next(),"string";if("'"==s||'"'==s)return o.instring=s,e.next(),"string";if(e.match(o.intag+"}")||e.eat("-")&&e.match(o.intag+"}"))return o.intag=!1,"tag";if(e.match(n))return o.operator=!0,"operator";if(e.match(r))o.sign=!0;else if(e.eat(" ")||e.sol()){if(e.match(t))return"keyword";if(e.match(i))return"atom";if(e.match(a))return"number";e.sol()&&e.next()}else e.next();return"variable"}if(e.eat("{")){if(e.eat("#"))return o.incomment=!0,e.skipTo("#}")?(e.eatWhile(/\#|}/),o.incomment=!1):e.skipToEnd(),"comment";if(s=e.eat(/\{|%/))return o.intag=s,"{"==s&&(o.intag="}"),e.eat("-"),"tag"}e.next()}var t=["and","as","autoescape","endautoescape","block","do","endblock","else","elseif","extends","for","endfor","embed","endembed","filter","endfilter","flush","from","if","endif","in","is","include","import","not","or","set","spaceless","endspaceless","with","endwith","trans","endtrans","blocktrans","endblocktrans","macro","endmacro","use","verbatim","endverbatim"],n=/^[+\-*&%=<>!?|~^]/,r=/^[:\[\(\{]/,i=["true","false","null","empty","defined","divisibleby","divisible by","even","odd","iterable","sameas","same as"],a=/^(\d[+\-\*\/])?\d+(\.\d+)?/;return t=new RegExp("(("+t.join(")|(")+"))\\b"),i=new RegExp("(("+i.join(")|(")+"))\\b"),{startState:function(){return{}},token:function(t,n){return e(t,n)}}}),e.defineMode("twig",function(t,n){var r=e.getMode(t,"twig:inner");return n&&n.base?e.multiplexingMode(e.getMode(t,n.base),{open:/\{[{#%]/,close:/[}#%]\}/,mode:r,parseDelimiters:!0}):r}),e.defineMIME("text/x-twig","twig")})},function(e,t,n){!function(e){e(n(399))}(function(e){"use strict";e.multiplexingMode=function(t){function n(e,t,n,r){if("string"==typeof t){var i=e.indexOf(t,n);return r&&i>-1?i+t.length:i}var a=t.exec(n?e.slice(n):e);return a?a.index+n+(r?a[0].length:0):-1}var r=Array.prototype.slice.call(arguments,1);return{startState:function(){return{outer:e.startState(t),innerActive:null,inner:null}},copyState:function(n){return{outer:e.copyState(t,n.outer),innerActive:n.innerActive,inner:n.innerActive&&e.copyState(n.innerActive.mode,n.inner)}},token:function(i,a){if(a.innerActive){var o=a.innerActive,s=i.string;if(!o.close&&i.sol())return a.innerActive=a.inner=null,this.token(i,a);var l=o.close?n(s,o.close,i.pos,o.parseDelimiters):-1;if(l==i.pos&&!o.parseDelimiters)return i.match(o.close),a.innerActive=a.inner=null,o.delimStyle&&o.delimStyle+" "+o.delimStyle+"-close";l>-1&&(i.string=s.slice(0,l));var c=o.mode.token(i,a.inner);return l>-1&&(i.string=s),l==i.pos&&o.parseDelimiters&&(a.innerActive=a.inner=null),o.innerStyle&&(c=c?c+" "+o.innerStyle:o.innerStyle),c}for(var u=1/0,s=i.string,d=0;dn.keyCol)return e.skipToEnd(),"string";if(n.literal&&(n.literal=!1),e.sol()){if(n.keyCol=0,n.pair=!1,n.pairStart=!1,e.match(/---/))return"def";if(e.match(/\.\.\./))return"def";if(e.match(/\s*-\s+/))return"meta"}if(e.match(/^(\{|\}|\[|\])/))return"{"==r?n.inlinePairs++:"}"==r?n.inlinePairs--:"["==r?n.inlineList++:n.inlineList--,"meta";if(n.inlineList>0&&!i&&","==r)return e.next(),"meta";if(n.inlinePairs>0&&!i&&","==r)return n.keyCol=0,n.pair=!1,n.pairStart=!1,e.next(),"meta";if(n.pairStart){if(e.match(/^\s*(\||\>)\s*/))return n.literal=!0,"meta";if(e.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i))return"variable-2";if(0==n.inlinePairs&&e.match(/^\s*-?[0-9\.\,]+\s?$/))return"number";if(n.inlinePairs>0&&e.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/))return"number";if(e.match(t))return"keyword"}return!n.pair&&e.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^,\[\]{}#&*!|>'"%@`])[^#]*?(?=\s*:($|\s))/)?(n.pair=!0,n.keyCol=e.indentation(),"atom"):n.pair&&e.match(/^:\s*/)?(n.pairStart=!0,"meta"):(n.pairStart=!1,n.escaped="\\"==r,e.next(),null)},startState:function(){return{pair:!1,pairStart:!1,keyCol:0,inlinePairs:0,inlineList:0,literal:!1,escaped:!1}},lineComment:"#",fold:"indent"}}),e.defineMIME("text/x-yaml","yaml"),e.defineMIME("text/yaml","yaml")})},function(e,t,n){!function(e){e(n(399))}(function(e){"use strict";function t(e,t){var r=t.line,i=0,a=0,o=n.exec(e.getLine(r)),s=o[1];do{i+=1;var l=r+i,c=e.getLine(l),u=n.exec(c);if(u){var d=u[1],f=parseInt(o[3],10)+i-a,p=parseInt(u[3],10),h=p;if(s!==d||isNaN(p)){if(s.length>d.length)return;if(s.lengthp&&(h=f+1),e.replaceRange(c.replace(n,d+h+u[4]+u[5]),{line:l,ch:0},{line:l,ch:c.length})}}while(u)}var n=/^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/,r=/^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/,i=/[*+-]\s/;e.commands.newlineAndIndentContinueMarkdownList=function(a){if(a.getOption("disableInput"))return e.Pass;for(var o=a.listSelections(),s=[],l=0;l\s*$/.test(h),y=!/>\s*$/.test(h);(g||y)&&a.replaceRange("",{line:c.line,ch:0},{line:c.line,ch:c.ch+1}),s[l]="\n"}else{var _=m[1],b=m[5],w=!(i.test(m[2])||m[2].indexOf(">")>=0),k=w?parseInt(m[3],10)+1+m[4]:m[2].replace("x"," ");s[l]="\n"+_+k+b,w&&t(a,c)}}a.replaceSelections(s)}})},function(e,t,n){!function(e){e(n(399))}(function(e){"use strict";function t(e){for(var t=0;t1,n.options.tooltips))}}r.onUpdateLinting&&r.onUpdateLinting(t,i,e)}function m(e){var t=e.state.lint;t&&(clearTimeout(t.timeout),t.timeout=setTimeout(function(){p(e)},t.options.delay||500))}function v(e,t,n){for(var r=n.target||n.srcElement,a=document.createDocumentFragment(),o=0;o=0&&b.splice(t,1)}function s(e){var t=document.createElement("style");return e.attrs.type="text/css",c(t,e.attrs),a(e,t),t}function l(e){var t=document.createElement("link");return e.attrs.type="text/css",e.attrs.rel="stylesheet",c(t,e.attrs),a(e,t),t}function c(e,t){Object.keys(t).forEach(function(n){e.setAttribute(n,t[n])})}function u(e,t){var n,r,i,a;if(t.transform&&e.css){if(a=t.transform(e.css),!a)return function(){};e.css=a}if(t.singleton){var c=_++;n=y||(y=s(t)),r=d.bind(null,n,c,!1),i=d.bind(null,n,c,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=l(t),r=p.bind(null,n,t),i=function(){o(n),n.href&&URL.revokeObjectURL(n.href)}):(n=s(t),r=f.bind(null,n),i=function(){o(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else i()}}function d(e,t,n,r){var i=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=k(t,i);else{var a=document.createTextNode(i),o=e.childNodes;o[t]&&e.removeChild(o[t]),o.length?e.insertBefore(a,o[t]):e.appendChild(a)}}function f(e,t){var n=t.css,r=t.media;if(r&&e.setAttribute("media",r),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}function p(e,t,n){var r=n.css,i=n.sourceMap,a=void 0===t.convertToAbsoluteUrls&&i;(t.convertToAbsoluteUrls||a)&&(r=w(r)),i&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */");var o=new Blob([r],{type:"text/css"}),s=e.href;e.href=URL.createObjectURL(o),s&&URL.revokeObjectURL(s)}var h={},m=function(e){var t;return function(){return"undefined"==typeof t&&(t=e.apply(this,arguments)),t}},v=m(function(){return window&&document&&document.all&&!window.atob}),g=function(e){var t={};return function(n){return"undefined"==typeof t[n]&&(t[n]=e.call(this,n)),t[n]}}(function(e){return document.querySelector(e)}),y=null,_=0,b=[],w=n(457);e.exports=function(e,t){t=t||{},t.attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||(t.singleton=v()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=i(e,t);return r(n,t),function(e){for(var a=[],o=0;o-1&&(o+=s)}var l={message:i.reason,severity:i.code&&i.code.startsWith("W")?"warning":"error",from:e.Pos(i.line-1,a),to:e.Pos(i.line-1,o)};n.push(l)}}}e.registerHelper("lint","javascript",t)})},function(e,t,n){!function(e){e(n(399))}(function(e){"use strict";e.registerHelper("lint","json",function(t){var n=[];if(!window.jsonlint)return window.console&&window.console.error("Error: window.jsonlint not defined, CodeMirror JSON linting cannot run."),n;var r=window.jsonlint.parser||window.jsonlint;r.parseError=function(t,r){var i=r.loc;n.push({from:e.Pos(i.first_line-1,i.first_column),to:e.Pos(i.last_line-1,i.last_column),message:t})};try{r.parse(t)}catch(e){}return n})})},function(e,t,n){!function(e){e(n(399))}(function(e){"use strict";e.registerHelper("lint","yaml",function(t){var n=[];if(!window.jsyaml)return window.console&&window.console.error("Error: window.jsyaml not defined, CodeMirror YAML linting cannot run."),n;try{jsyaml.loadAll(t)}catch(t){var r=t.mark,i=r?e.Pos(r.line,r.column):e.Pos(0,0),a=i;n.push({from:i,to:a,message:t.message})}return n})})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(1),a=r(i);(0,a.default)('[name="task"][value="saveas"], [name="task"][value="switchlanguage"]').on("mousedown touchstart",function(e){var t=["lang","redirect"],n=(0,a.default)(e.currentTarget),r=(0,a.default)("#"+n.attr("form"));if(r.length)return t.forEach(function(e){var t=n.attr(e);if(t){var i=r.find('[name="data['+e+']"]');i.length||(i=(0,a.default)(''),r.append(i)),i.val(t)}}),!0})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(464),a=r(i),o=n(470),s=r(o),l=n(471),c=r(l);t.default={Form:{Form:s.default,Instance:o.Instance},Fields:c.default,FormState:{FormState:a.default,Instance:i.Instance}}},function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.DOMBehaviors=t.Instance=void 0;var a=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{ignore:[],form_id:"blueprints"};i(this,e),this.options=t,this.refresh(),this.form&&this.fields.length&&(f=this.collect(),this.loadState=f,p.attach())}return a(e,[{key:"refresh",value:function(){return this.form=(0,s.default)("form#"+this.options.form_id).filter(":noparents(.remodal)"),this.fields=(0,s.default)("form#"+this.options.form_id+' *, [form="'+this.options.form_id+'"]').filter(":input:not(.no-form)").filter(":noparents(.remodal)"),this}},{key:"collect",value:function(){var e=this;if(this.form&&this.fields.length){var t={};return this.refresh().fields.each(function(n,r){r=(0,s.default)(r);var i=r.prop("name"),a=r.prop("type"),o=r.prop("tagName").toLowerCase(),l=void 0;if(!i.startsWith("toggleable_")&&"data[lang]"!==i&&"data[redirect]"!==i){switch(a){case"checkbox":l=r.is(":checked");break;case"radio":if(!r.is(":checked"))return;l=r.val();break;default:l=r.val()}"select"===o&&null===l&&(l=""),Array.isArray(l)&&(l=l.join("|")),i&&!~e.options.ignore.indexOf(i)&&(t[i]=l)}}),c.default.OrderedMap(t)}}},{key:"diff",value:function(){return(0,d.default)(f,this.collect())}},{key:"equals",value:function(){return this.form&&this.fields.length?c.default.is(f,this.collect()):null}}]),e}();t.default=h;var m=t.Instance=new h;t.DOMBehaviors=p}).call(t,function(){return this}())},function(e,t,n){!function(t,n){e.exports=n()}(this,function(){"use strict";function e(e,t){t&&(e.prototype=Object.create(t.prototype)),e.prototype.constructor=e}function t(e){return a(e)?e:I(e)}function n(e){return o(e)?e:M(e)}function r(e){return s(e)?e:D(e)}function i(e){return a(e)&&!l(e)?e:T(e)}function a(e){return!(!e||!e[cn])}function o(e){return!(!e||!e[un])}function s(e){return!(!e||!e[dn])}function l(e){return o(e)||s(e)}function c(e){return!(!e||!e[fn])}function u(e){return e.value=!1,e}function d(e){e&&(e.value=!0)}function f(){}function p(e,t){t=t||0;for(var n=Math.max(0,e.length-t),r=new Array(n),i=0;i>>0;if(""+n!==t||4294967295===n)return NaN;t=n}return t<0?h(e)+t:t}function v(){return!0}function g(e,t,n){return(0===e||void 0!==n&&e<=-n)&&(void 0===t||void 0!==n&&t>=n)}function y(e,t){return b(e,t,0)}function _(e,t){return b(e,t,t)}function b(e,t,n){return void 0===e?n:e<0?Math.max(0,t+e):void 0===t?e:Math.min(t,e)}function w(e){this.next=e}function k(e,t,n,r){var i=0===e?t:1===e?n:[t,n];return r?r.value=i:r={value:i,done:!1},r}function x(){return{value:void 0,done:!0}}function C(e){return!!A(e)}function S(e){return e&&"function"==typeof e.next}function E(e){var t=A(e);return t&&t.call(e)}function A(e){var t=e&&(xn&&e[xn]||e[Cn]);if("function"==typeof t)return t}function O(e){return e&&"number"==typeof e.length}function I(e){return null===e||void 0===e?q():a(e)?e.toSeq():U(e)}function M(e){return null===e||void 0===e?q().toKeyedSeq():a(e)?o(e)?e.toSeq():e.fromEntrySeq():R(e)}function D(e){return null===e||void 0===e?q():a(e)?o(e)?e.entrySeq():e.toIndexedSeq():F(e)}function T(e){return(null===e||void 0===e?q():a(e)?o(e)?e.entrySeq():e:F(e)).toSetSeq()}function j(e){this._array=e,this.size=e.length}function P(e){var t=Object.keys(e);this._object=e,this._keys=t,this.size=t.length}function L(e){this._iterable=e,this.size=e.length||e.size}function N(e){this._iterator=e,this._iteratorCache=[]}function z(e){return!(!e||!e[En])}function q(){return An||(An=new j([]))}function R(e){var t=Array.isArray(e)?new j(e).fromEntrySeq():S(e)?new N(e).fromEntrySeq():C(e)?new L(e).fromEntrySeq():"object"==typeof e?new P(e):void 0;if(!t)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+e);return t}function F(e){var t=B(e);if(!t)throw new TypeError("Expected Array or iterable object of values: "+e);return t}function U(e){var t=B(e)||"object"==typeof e&&new P(e);if(!t)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+e);return t}function B(e){return O(e)?new j(e):S(e)?new N(e):C(e)?new L(e):void 0}function V(e,t,n,r){var i=e._cache;if(i){for(var a=i.length-1,o=0;o<=a;o++){var s=i[n?a-o:o];if(t(s[1],r?s[0]:o,e)===!1)return o+1}return o}return e.__iterateUncached(t,n)}function $(e,t,n,r){var i=e._cache;if(i){var a=i.length-1,o=0;return new w(function(){var e=i[n?a-o:o];return o++>a?x():k(t,r?e[0]:o-1,e[1])})}return e.__iteratorUncached(t,n)}function W(e,t){return t?G(t,e,"",{"":e}):H(e)}function G(e,t,n,r){return Array.isArray(t)?e.call(r,n,D(t).map(function(n,r){return G(e,n,r,t)})):K(t)?e.call(r,n,M(t).map(function(n,r){return G(e,n,r,t)})):t}function H(e){return Array.isArray(e)?D(e).map(H).toList():K(e)?M(e).map(H).toMap():e}function K(e){return e&&(e.constructor===Object||void 0===e.constructor)}function Y(e,t){if(e===t||e!==e&&t!==t)return!0;if(!e||!t)return!1;if("function"==typeof e.valueOf&&"function"==typeof t.valueOf){if(e=e.valueOf(),t=t.valueOf(),e===t||e!==e&&t!==t)return!0;if(!e||!t)return!1}return!("function"!=typeof e.equals||"function"!=typeof t.equals||!e.equals(t))}function J(e,t){if(e===t)return!0;if(!a(t)||void 0!==e.size&&void 0!==t.size&&e.size!==t.size||void 0!==e.__hash&&void 0!==t.__hash&&e.__hash!==t.__hash||o(e)!==o(t)||s(e)!==s(t)||c(e)!==c(t))return!1;if(0===e.size&&0===t.size)return!0;var n=!l(e);if(c(e)){var r=e.entries();return t.every(function(e,t){var i=r.next().value;return i&&Y(i[1],e)&&(n||Y(i[0],t))})&&r.next().done}var i=!1;if(void 0===e.size)if(void 0===t.size)"function"==typeof e.cacheResult&&e.cacheResult();else{i=!0;var u=e;e=t,t=u}var d=!0,f=t.__iterate(function(t,r){if(n?!e.has(t):i?!Y(t,e.get(r,gn)):!Y(e.get(r,gn),t))return d=!1,!1});return d&&e.size===f}function X(e,t){if(!(this instanceof X))return new X(e,t);if(this._value=e,this.size=void 0===t?1/0:Math.max(0,t),0===this.size){if(On)return On;On=this}}function Q(e,t){if(!e)throw new Error(t)}function Z(e,t,n){if(!(this instanceof Z))return new Z(e,t,n);if(Q(0!==n,"Cannot step a Range by 0"),e=e||0,void 0===t&&(t=1/0),n=void 0===n?1:Math.abs(n),t>>1&1073741824|3221225471&e}function ae(e){if(e===!1||null===e||void 0===e)return 0;if("function"==typeof e.valueOf&&(e=e.valueOf(),e===!1||null===e||void 0===e))return 0;if(e===!0)return 1;var t=typeof e;if("number"===t){if(e!==e||e===1/0)return 0;var n=0|e;for(n!==e&&(n^=4294967295*e);e>4294967295;)e/=4294967295,n^=e;return ie(n)}if("string"===t)return e.length>zn?oe(e):se(e);if("function"==typeof e.hashCode)return e.hashCode();if("object"===t)return le(e);if("function"==typeof e.toString)return se(e.toString());throw new Error("Value type "+t+" cannot be hashed.")}function oe(e){var t=Fn[e];return void 0===t&&(t=se(e),Rn===qn&&(Rn=0,Fn={}),Rn++,Fn[e]=t),t}function se(e){for(var t=0,n=0;n0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}function ue(e){Q(e!==1/0,"Cannot perform this action with an infinite size.")}function de(e){return null===e||void 0===e?ke():fe(e)&&!c(e)?e:ke().withMutations(function(t){var r=n(e);ue(r.size),r.forEach(function(e,n){return t.set(n,e)})})}function fe(e){return!(!e||!e[Un])}function pe(e,t){this.ownerID=e,this.entries=t}function he(e,t,n){this.ownerID=e,this.bitmap=t,this.nodes=n}function me(e,t,n){this.ownerID=e,this.count=t,this.nodes=n}function ve(e,t,n){this.ownerID=e,this.keyHash=t,this.entries=n}function ge(e,t,n){this.ownerID=e,this.keyHash=t,this.entry=n}function ye(e,t,n){this._type=t,this._reverse=n,this._stack=e._root&&be(e._root)}function _e(e,t){return k(e,t[0],t[1])}function be(e,t){return{node:e,index:0,__prev:t}}function we(e,t,n,r){var i=Object.create(Bn);return i.size=e,i._root=t,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function ke(){return Vn||(Vn=we(0))}function xe(e,t,n){var r,i;if(e._root){var a=u(yn),o=u(_n);if(r=Ce(e._root,e.__ownerID,0,void 0,t,n,a,o),!o.value)return e;i=e.size+(a.value?n===gn?-1:1:0)}else{if(n===gn)return e;i=1,r=new pe(e.__ownerID,[[t,n]])}return e.__ownerID?(e.size=i,e._root=r,e.__hash=void 0,e.__altered=!0,e):r?we(i,r):ke()}function Ce(e,t,n,r,i,a,o,s){return e?e.update(t,n,r,i,a,o,s):a===gn?e:(d(s),d(o),new ge(t,r,[i,a]))}function Se(e){return e.constructor===ge||e.constructor===ve}function Ee(e,t,n,r,i){if(e.keyHash===r)return new ve(t,r,[e.entry,i]);var a,o=(0===n?e.keyHash:e.keyHash>>>n)&vn,s=(0===n?r:r>>>n)&vn,l=o===s?[Ee(e,t,n+hn,r,i)]:(a=new ge(t,r,i),o>>=1)o[s]=1&n?t[a++]:void 0;return o[r]=i,new me(e,a+1,o)}function Me(e,t,r){for(var i=[],o=0;o>1&1431655765,e=(858993459&e)+(e>>2&858993459),e=e+(e>>4)&252645135,e+=e>>8,e+=e>>16,127&e}function Ne(e,t,n,r){var i=r?e:p(e);return i[t]=n,i}function ze(e,t,n,r){var i=e.length+1;if(r&&t+1===i)return e[t]=n,e;for(var a=new Array(i),o=0,s=0;s0&&ia?0:a-n,c=o-n;return c>mn&&(c=mn),function(){if(i===c)return Jn;var e=t?--c:i++;return r&&r[e]}}function i(e,r,i){var s,l=e&&e.array,c=i>a?0:a-i>>r,u=(o-i>>r)+1;return u>mn&&(u=mn),function(){for(;;){if(s){var e=s();if(e!==Jn)return e;s=null}if(c===u)return Jn;var a=t?--u:c++;s=n(l&&l[a],r-hn,i+(a<=e.size||t<0)return e.withMutations(function(e){t<0?Ye(e,t).set(0,n):Ye(e,0,t+1).set(t,n)});t+=e._origin;var r=e._tail,i=e._root,a=u(_n);return t>=Xe(e._capacity)?r=Ge(r,e.__ownerID,0,t,n,a):i=Ge(i,e.__ownerID,e._level,t,n,a),a.value?e.__ownerID?(e._root=i,e._tail=r,e.__hash=void 0,e.__altered=!0,e):Ve(e._origin,e._capacity,e._level,i,r):e}function Ge(e,t,n,r,i,a){var o=r>>>n&vn,s=e&&o0){var c=e&&e.array[o],u=Ge(c,t,n-hn,r,i,a);return u===c?e:(l=He(e,t),l.array[o]=u,l)}return s&&e.array[o]===i?e:(d(a),l=He(e,t),void 0===i&&o===l.array.length-1?l.array.pop():l.array[o]=i,l)}function He(e,t){return t&&e&&t===e.ownerID?e:new Ue(e?e.array.slice():[],t)}function Ke(e,t){if(t>=Xe(e._capacity))return e._tail;if(t<1<0;)n=n.array[t>>>r&vn],r-=hn;return n}}function Ye(e,t,n){void 0!==t&&(t|=0),void 0!==n&&(n|=0);var r=e.__ownerID||new f,i=e._origin,a=e._capacity,o=i+t,s=void 0===n?a:n<0?a+n:i+n;if(o===i&&s===a)return e;if(o>=s)return e.clear();for(var l=e._level,c=e._root,u=0;o+u<0;)c=new Ue(c&&c.array.length?[void 0,c]:[],r),l+=hn,u+=1<=1<d?new Ue([],r):h;if(h&&p>d&&ohn;g-=hn){var y=d>>>g&vn;v=v.array[y]=He(v.array[y],r)}v.array[d>>>hn&vn]=h}if(s=p)o-=p,s-=p,l=hn,c=null,m=m&&m.removeBefore(r,0,o);else if(o>i||p>>l&vn;if(_!==p>>>l&vn)break;_&&(u+=(1<i&&(c=c.removeBefore(r,l,o-u)),c&&po&&(o=c.size),a(l)||(c=c.map(function(e){return W(e)})),i.push(c)}return o>e.size&&(e=e.setSize(o)),je(e,t,i)}function Xe(e){return e>>hn<=mn&&o.size>=2*a.size?(i=o.filter(function(e,t){return void 0!==e&&s!==t}),r=i.toKeyedSeq().map(function(e){return e[0]}).flip().toMap(),e.__ownerID&&(r.__ownerID=i.__ownerID=e.__ownerID)):(r=a.remove(t),i=s===o.size-1?o.pop():o.set(s,void 0))}else if(l){if(n===o.get(s)[1])return e;r=a,i=o.set(s,[t,n]); }else r=a.set(t,o.size),i=o.set(o.size,[t,n]);return e.__ownerID?(e.size=r.size,e._map=r,e._list=i,e.__hash=void 0,e):et(r,i)}function rt(e,t){this._iter=e,this._useKeys=t,this.size=e.size}function it(e){this._iter=e,this.size=e.size}function at(e){this._iter=e,this.size=e.size}function ot(e){this._iter=e,this.size=e.size}function st(e){var t=Ot(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var t=e.reverse.apply(this);return t.flip=function(){return e.reverse()},t},t.has=function(t){return e.includes(t)},t.includes=function(t){return e.has(t)},t.cacheResult=It,t.__iterateUncached=function(t,n){var r=this;return e.__iterate(function(e,n){return t(n,e,r)!==!1},n)},t.__iteratorUncached=function(t,n){if(t===kn){var r=e.__iterator(t,n);return new w(function(){var e=r.next();if(!e.done){var t=e.value[0];e.value[0]=e.value[1],e.value[1]=t}return e})}return e.__iterator(t===wn?bn:wn,n)},t}function lt(e,t,n){var r=Ot(e);return r.size=e.size,r.has=function(t){return e.has(t)},r.get=function(r,i){var a=e.get(r,gn);return a===gn?i:t.call(n,a,r,e)},r.__iterateUncached=function(r,i){var a=this;return e.__iterate(function(e,i,o){return r(t.call(n,e,i,o),i,a)!==!1},i)},r.__iteratorUncached=function(r,i){var a=e.__iterator(kn,i);return new w(function(){var i=a.next();if(i.done)return i;var o=i.value,s=o[0];return k(r,s,t.call(n,o[1],s,e),i)})},r}function ct(e,t){var n=Ot(e);return n._iter=e,n.size=e.size,n.reverse=function(){return e},e.flip&&(n.flip=function(){var t=st(e);return t.reverse=function(){return e.flip()},t}),n.get=function(n,r){return e.get(t?n:-1-n,r)},n.has=function(n){return e.has(t?n:-1-n)},n.includes=function(t){return e.includes(t)},n.cacheResult=It,n.__iterate=function(t,n){var r=this;return e.__iterate(function(e,n){return t(e,n,r)},!n)},n.__iterator=function(t,n){return e.__iterator(t,!n)},n}function ut(e,t,n,r){var i=Ot(e);return r&&(i.has=function(r){var i=e.get(r,gn);return i!==gn&&!!t.call(n,i,r,e)},i.get=function(r,i){var a=e.get(r,gn);return a!==gn&&t.call(n,a,r,e)?a:i}),i.__iterateUncached=function(i,a){var o=this,s=0;return e.__iterate(function(e,a,l){if(t.call(n,e,a,l))return s++,i(e,r?a:s-1,o)},a),s},i.__iteratorUncached=function(i,a){var o=e.__iterator(kn,a),s=0;return new w(function(){for(;;){var a=o.next();if(a.done)return a;var l=a.value,c=l[0],u=l[1];if(t.call(n,u,c,e))return k(i,r?c:s++,u,a)}})},i}function dt(e,t,n){var r=de().asMutable();return e.__iterate(function(i,a){r.update(t.call(n,i,a,e),0,function(e){return e+1})}),r.asImmutable()}function ft(e,t,n){var r=o(e),i=(c(e)?Qe():de()).asMutable();e.__iterate(function(a,o){i.update(t.call(n,a,o,e),function(e){return e=e||[],e.push(r?[o,a]:a),e})});var a=At(e);return i.map(function(t){return Ct(e,a(t))})}function pt(e,t,n,r){var i=e.size;if(void 0!==t&&(t|=0),void 0!==n&&(n===1/0?n=i:n|=0),g(t,n,i))return e;var a=y(t,i),o=_(n,i);if(a!==a||o!==o)return pt(e.toSeq().cacheResult(),t,n,r);var s,l=o-a;l===l&&(s=l<0?0:l);var c=Ot(e);return c.size=0===s?s:e.size&&s||void 0,!r&&z(e)&&s>=0&&(c.get=function(t,n){return t=m(this,t),t>=0&&ts)return x();var e=i.next();return r||t===wn?e:t===bn?k(t,l-1,void 0,e):k(t,l-1,e.value[1],e)})},c}function ht(e,t,n){var r=Ot(e);return r.__iterateUncached=function(r,i){var a=this;if(i)return this.cacheResult().__iterate(r,i);var o=0;return e.__iterate(function(e,i,s){return t.call(n,e,i,s)&&++o&&r(e,i,a)}),o},r.__iteratorUncached=function(r,i){var a=this;if(i)return this.cacheResult().__iterator(r,i);var o=e.__iterator(kn,i),s=!0;return new w(function(){if(!s)return x();var e=o.next();if(e.done)return e;var i=e.value,l=i[0],c=i[1];return t.call(n,c,l,a)?r===kn?e:k(r,l,c,e):(s=!1,x())})},r}function mt(e,t,n,r){var i=Ot(e);return i.__iterateUncached=function(i,a){var o=this;if(a)return this.cacheResult().__iterate(i,a);var s=!0,l=0;return e.__iterate(function(e,a,c){if(!s||!(s=t.call(n,e,a,c)))return l++,i(e,r?a:l-1,o)}),l},i.__iteratorUncached=function(i,a){var o=this;if(a)return this.cacheResult().__iterator(i,a);var s=e.__iterator(kn,a),l=!0,c=0;return new w(function(){var e,a,u;do{if(e=s.next(),e.done)return r||i===wn?e:i===bn?k(i,c++,void 0,e):k(i,c++,e.value[1],e);var d=e.value;a=d[0],u=d[1],l&&(l=t.call(n,u,a,o))}while(l);return i===kn?e:k(i,a,u,e)})},i}function vt(e,t){var r=o(e),i=[e].concat(t).map(function(e){return a(e)?r&&(e=n(e)):e=r?R(e):F(Array.isArray(e)?e:[e]),e}).filter(function(e){return 0!==e.size});if(0===i.length)return e;if(1===i.length){var l=i[0];if(l===e||r&&o(l)||s(e)&&s(l))return l}var c=new j(i);return r?c=c.toKeyedSeq():s(e)||(c=c.toSetSeq()),c=c.flatten(!0),c.size=i.reduce(function(e,t){if(void 0!==e){var n=t.size;if(void 0!==n)return e+n}},0),c}function gt(e,t,n){var r=Ot(e);return r.__iterateUncached=function(r,i){function o(e,c){var u=this;e.__iterate(function(e,i){return(!t||c0}function xt(e,n,r){var i=Ot(e);return i.size=new j(r).map(function(e){return e.size}).min(),i.__iterate=function(e,t){for(var n,r=this.__iterator(wn,t),i=0;!(n=r.next()).done&&e(n.value,i++,this)!==!1;);return i},i.__iteratorUncached=function(e,i){var a=r.map(function(e){return e=t(e),E(i?e.reverse():e)}),o=0,s=!1;return new w(function(){var t;return s||(t=a.map(function(e){return e.next()}),s=t.some(function(e){return e.done})),s?x():k(e,o++,n.apply(null,t.map(function(e){return e.value})))})},i}function Ct(e,t){return z(e)?t:e.constructor(t)}function St(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function Et(e){return ue(e.size),h(e)}function At(e){return o(e)?n:s(e)?r:i}function Ot(e){return Object.create((o(e)?M:s(e)?D:T).prototype)}function It(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):I.prototype.cacheResult.call(this)}function Mt(e,t){return e>t?1:et?-1:0}function an(e){if(e.size===1/0)return 0;var t=c(e),n=o(e),r=t?1:0,i=e.__iterate(n?t?function(e,t){r=31*r+sn(ae(e),ae(t))|0}:function(e,t){r=r+sn(ae(e),ae(t))|0}:t?function(e){r=31*r+ae(e)|0}:function(e){r=r+ae(e)|0});return on(i,r)}function on(e,t){return t=Dn(t,3432918353),t=Dn(t<<15|t>>>-15,461845907),t=Dn(t<<13|t>>>-13,5),t=(t+3864292196|0)^e,t=Dn(t^t>>>16,2246822507),t=Dn(t^t>>>13,3266489909),t=ie(t^t>>>16)}function sn(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}var ln=Array.prototype.slice;e(n,t),e(r,t),e(i,t),t.isIterable=a,t.isKeyed=o,t.isIndexed=s,t.isAssociative=l,t.isOrdered=c,t.Keyed=n,t.Indexed=r,t.Set=i;var cn="@@__IMMUTABLE_ITERABLE__@@",un="@@__IMMUTABLE_KEYED__@@",dn="@@__IMMUTABLE_INDEXED__@@",fn="@@__IMMUTABLE_ORDERED__@@",pn="delete",hn=5,mn=1<r?x():k(e,i,n[t?r-i++:i++])})},e(P,M),P.prototype.get=function(e,t){return void 0===t||this.has(e)?this._object[e]:t},P.prototype.has=function(e){return this._object.hasOwnProperty(e)},P.prototype.__iterate=function(e,t){for(var n=this._object,r=this._keys,i=r.length-1,a=0;a<=i;a++){var o=r[t?i-a:a];if(e(n[o],o,this)===!1)return a+1}return a},P.prototype.__iterator=function(e,t){var n=this._object,r=this._keys,i=r.length-1,a=0;return new w(function(){var o=r[t?i-a:a];return a++>i?x():k(e,o,n[o])})},P.prototype[fn]=!0,e(L,D),L.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);var n=this._iterable,r=E(n),i=0;if(S(r))for(var a;!(a=r.next()).done&&e(a.value,i++,this)!==!1;);return i},L.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=this._iterable,r=E(n);if(!S(r))return new w(x);var i=0;return new w(function(){var t=r.next();return t.done?t:k(e,i++,t.value)})},e(N,D),N.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);for(var n=this._iterator,r=this._iteratorCache,i=0;i=r.length){var t=n.next();if(t.done)return t;r[i]=t.value}return k(e,i,r[i++])})};var An;e(X,D),X.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},X.prototype.get=function(e,t){return this.has(e)?this._value:t},X.prototype.includes=function(e){return Y(this._value,e)},X.prototype.slice=function(e,t){var n=this.size;return g(e,t,n)?this:new X(this._value,_(t,n)-y(e,n))},X.prototype.reverse=function(){return this},X.prototype.indexOf=function(e){return Y(this._value,e)?0:-1},X.prototype.lastIndexOf=function(e){return Y(this._value,e)?this.size:-1},X.prototype.__iterate=function(e,t){for(var n=0;n=0&&t=0&&nn?x():k(e,a++,o)})},Z.prototype.equals=function(e){return e instanceof Z?this._start===e._start&&this._end===e._end&&this._step===e._step:J(this,e)};var In;e(ee,t),e(te,ee),e(ne,ee),e(re,ee),ee.Keyed=te,ee.Indexed=ne,ee.Set=re;var Mn,Dn="function"==typeof Math.imul&&Math.imul(4294967295,2)===-2?Math.imul:function(e,t){e|=0,t|=0;var n=65535&e,r=65535&t;return n*r+((e>>>16)*r+n*(t>>>16)<<16>>>0)|0},Tn=Object.isExtensible,jn=function(){try{return Object.defineProperty({},"@",{}),!0}catch(e){return!1}}(),Pn="function"==typeof WeakMap;Pn&&(Mn=new WeakMap);var Ln=0,Nn="__immutablehash__";"function"==typeof Symbol&&(Nn=Symbol(Nn));var zn=16,qn=255,Rn=0,Fn={};e(de,te),de.of=function(){var e=ln.call(arguments,0);return ke().withMutations(function(t){for(var n=0;n=e.length)throw new Error("Missing value for key: "+e[n]);t.set(e[n],e[n+1])}})},de.prototype.toString=function(){return this.__toString("Map {","}")},de.prototype.get=function(e,t){return this._root?this._root.get(0,void 0,e,t):t},de.prototype.set=function(e,t){return xe(this,e,t)},de.prototype.setIn=function(e,t){return this.updateIn(e,gn,function(){return t})},de.prototype.remove=function(e){return xe(this,e,gn)},de.prototype.deleteIn=function(e){return this.updateIn(e,function(){return gn})},de.prototype.update=function(e,t,n){return 1===arguments.length?e(this):this.updateIn([e],t,n)},de.prototype.updateIn=function(e,t,n){n||(n=t,t=void 0);var r=Pe(this,Dt(e),t,n);return r===gn?void 0:r},de.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):ke()},de.prototype.merge=function(){return Me(this,void 0,arguments)},de.prototype.mergeWith=function(e){var t=ln.call(arguments,1);return Me(this,e,t)},de.prototype.mergeIn=function(e){var t=ln.call(arguments,1);return this.updateIn(e,ke(),function(e){return"function"==typeof e.merge?e.merge.apply(e,t):t[t.length-1]})},de.prototype.mergeDeep=function(){return Me(this,De,arguments)},de.prototype.mergeDeepWith=function(e){var t=ln.call(arguments,1);return Me(this,Te(e),t)},de.prototype.mergeDeepIn=function(e){var t=ln.call(arguments,1);return this.updateIn(e,ke(),function(e){return"function"==typeof e.mergeDeep?e.mergeDeep.apply(e,t):t[t.length-1]})},de.prototype.sort=function(e){return Qe(bt(this,e))},de.prototype.sortBy=function(e,t){return Qe(bt(this,t,e))},de.prototype.withMutations=function(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this},de.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new f)},de.prototype.asImmutable=function(){return this.__ensureOwner()},de.prototype.wasAltered=function(){return this.__altered},de.prototype.__iterator=function(e,t){return new ye(this,e,t)},de.prototype.__iterate=function(e,t){var n=this,r=0;return this._root&&this._root.iterate(function(t){return r++,e(t[1],t[0],n)},t),r},de.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?we(this.size,this._root,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},de.isMap=fe;var Un="@@__IMMUTABLE_MAP__@@",Bn=de.prototype;Bn[Un]=!0,Bn[pn]=Bn.remove,Bn.removeIn=Bn.deleteIn,pe.prototype.get=function(e,t,n,r){for(var i=this.entries,a=0,o=i.length;a=$n)return Ae(e,l,r,i);var h=e&&e===this.ownerID,m=h?l:p(l);return f?s?c===u-1?m.pop():m[c]=m.pop():m[c]=[r,i]:m.push([r,i]),h?(this.entries=m,this):new pe(e,m)}},he.prototype.get=function(e,t,n,r){void 0===t&&(t=ae(n));var i=1<<((0===e?t:t>>>e)&vn),a=this.bitmap;return 0===(a&i)?r:this.nodes[Le(a&i-1)].get(e+hn,t,n,r)},he.prototype.update=function(e,t,n,r,i,a,o){void 0===n&&(n=ae(r));var s=(0===t?n:n>>>t)&vn,l=1<=Wn)return Ie(e,f,c,s,h);if(u&&!h&&2===f.length&&Se(f[1^d]))return f[1^d];if(u&&h&&1===f.length&&Se(h))return h;var m=e&&e===this.ownerID,v=u?h?c:c^l:c|l,g=u?h?Ne(f,d,h,m):qe(f,d,m):ze(f,d,h,m);return m?(this.bitmap=v,this.nodes=g,this):new he(e,v,g)},me.prototype.get=function(e,t,n,r){void 0===t&&(t=ae(n));var i=(0===e?t:t>>>e)&vn,a=this.nodes[i];return a?a.get(e+hn,t,n,r):r},me.prototype.update=function(e,t,n,r,i,a,o){void 0===n&&(n=ae(r));var s=(0===t?n:n>>>t)&vn,l=i===gn,c=this.nodes,u=c[s];if(l&&!u)return this;var d=Ce(u,e,t+hn,n,r,i,a,o);if(d===u)return this;var f=this.count;if(u){if(!d&&(f--,f=0&&e>>t&vn;if(r>=this.array.length)return new Ue([],e);var i,a=0===r;if(t>0){var o=this.array[r];if(i=o&&o.removeBefore(e,t-hn,n),i===o&&a)return this}if(a&&!i)return this;var s=He(this,e);if(!a)for(var l=0;l>>t&vn;if(r>=this.array.length)return this;var i;if(t>0){var a=this.array[r];if(i=a&&a.removeAfter(e,t-hn,n),i===a&&r===this.array.length-1)return this}var o=He(this,e);return o.array.splice(r+1),i&&(o.array[r]=i),o};var Yn,Jn={};e(Qe,de),Qe.of=function(){return this(arguments)},Qe.prototype.toString=function(){return this.__toString("OrderedMap {","}")},Qe.prototype.get=function(e,t){var n=this._map.get(e);return void 0!==n?this._list.get(n)[1]:t},Qe.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):tt()},Qe.prototype.set=function(e,t){return nt(this,e,t)},Qe.prototype.remove=function(e){return nt(this,e,gn)},Qe.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},Qe.prototype.__iterate=function(e,t){var n=this;return this._list.__iterate(function(t){return t&&e(t[1],t[0],n)},t)},Qe.prototype.__iterator=function(e,t){return this._list.fromEntrySeq().__iterator(e,t)},Qe.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e),n=this._list.__ensureOwner(e);return e?et(t,n,e,this.__hash):(this.__ownerID=e,this._map=t,this._list=n,this)},Qe.isOrderedMap=Ze,Qe.prototype[fn]=!0,Qe.prototype[pn]=Qe.prototype.remove;var Xn;e(rt,M),rt.prototype.get=function(e,t){return this._iter.get(e,t)},rt.prototype.has=function(e){return this._iter.has(e)},rt.prototype.valueSeq=function(){return this._iter.valueSeq()},rt.prototype.reverse=function(){var e=this,t=ct(this,!0);return this._useKeys||(t.valueSeq=function(){return e._iter.toSeq().reverse()}),t},rt.prototype.map=function(e,t){var n=this,r=lt(this,e,t);return this._useKeys||(r.valueSeq=function(){return n._iter.toSeq().map(e,t)}),r},rt.prototype.__iterate=function(e,t){var n,r=this;return this._iter.__iterate(this._useKeys?function(t,n){return e(t,n,r)}:(n=t?Et(this):0,function(i){return e(i,t?--n:n++,r)}),t)},rt.prototype.__iterator=function(e,t){if(this._useKeys)return this._iter.__iterator(e,t);var n=this._iter.__iterator(wn,t),r=t?Et(this):0;return new w(function(){var i=n.next();return i.done?i:k(e,t?--r:r++,i.value,i)})},rt.prototype[fn]=!0,e(it,D),it.prototype.includes=function(e){return this._iter.includes(e)},it.prototype.__iterate=function(e,t){var n=this,r=0;return this._iter.__iterate(function(t){return e(t,r++,n)},t)},it.prototype.__iterator=function(e,t){var n=this._iter.__iterator(wn,t),r=0;return new w(function(){var t=n.next();return t.done?t:k(e,r++,t.value,t)})},e(at,T),at.prototype.has=function(e){return this._iter.includes(e)},at.prototype.__iterate=function(e,t){var n=this;return this._iter.__iterate(function(t){return e(t,t,n)},t)},at.prototype.__iterator=function(e,t){var n=this._iter.__iterator(wn,t);return new w(function(){var t=n.next();return t.done?t:k(e,t.value,t.value,t)})},e(ot,M),ot.prototype.entrySeq=function(){return this._iter.toSeq()},ot.prototype.__iterate=function(e,t){var n=this;return this._iter.__iterate(function(t){if(t){St(t);var r=a(t);return e(r?t.get(1):t[1],r?t.get(0):t[0],n)}},t)},ot.prototype.__iterator=function(e,t){var n=this._iter.__iterator(wn,t);return new w(function(){for(;;){var t=n.next();if(t.done)return t;var r=t.value;if(r){St(r);var i=a(r);return k(e,i?r.get(0):r[0],i?r.get(1):r[1],t)}}})},it.prototype.cacheResult=rt.prototype.cacheResult=at.prototype.cacheResult=ot.prototype.cacheResult=It,e(Tt,te),Tt.prototype.toString=function(){return this.__toString(Pt(this)+" {","}")},Tt.prototype.has=function(e){return this._defaultValues.hasOwnProperty(e)},Tt.prototype.get=function(e,t){if(!this.has(e))return t;var n=this._defaultValues[e];return this._map?this._map.get(e,n):n},Tt.prototype.clear=function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var e=this.constructor;return e._empty||(e._empty=jt(this,ke()))},Tt.prototype.set=function(e,t){if(!this.has(e))throw new Error('Cannot set unknown key "'+e+'" on '+Pt(this));if(this._map&&!this._map.has(e)){var n=this._defaultValues[e];if(t===n)return this}var r=this._map&&this._map.set(e,t);return this.__ownerID||r===this._map?this:jt(this,r)},Tt.prototype.remove=function(e){if(!this.has(e))return this;var t=this._map&&this._map.remove(e);return this.__ownerID||t===this._map?this:jt(this,t)},Tt.prototype.wasAltered=function(){return this._map.wasAltered()},Tt.prototype.__iterator=function(e,t){var r=this;return n(this._defaultValues).map(function(e,t){return r.get(t)}).__iterator(e,t)},Tt.prototype.__iterate=function(e,t){var r=this;return n(this._defaultValues).map(function(e,t){return r.get(t)}).__iterate(e,t)},Tt.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map&&this._map.__ensureOwner(e);return e?jt(this,t,e):(this.__ownerID=e,this._map=t,this)};var Qn=Tt.prototype;Qn[pn]=Qn.remove,Qn.deleteIn=Qn.removeIn=Bn.removeIn,Qn.merge=Bn.merge,Qn.mergeWith=Bn.mergeWith,Qn.mergeIn=Bn.mergeIn,Qn.mergeDeep=Bn.mergeDeep,Qn.mergeDeepWith=Bn.mergeDeepWith,Qn.mergeDeepIn=Bn.mergeDeepIn,Qn.setIn=Bn.setIn,Qn.update=Bn.update,Qn.updateIn=Bn.updateIn,Qn.withMutations=Bn.withMutations,Qn.asMutable=Bn.asMutable,Qn.asImmutable=Bn.asImmutable,e(zt,re),zt.of=function(){return this(arguments)},zt.fromKeys=function(e){return this(n(e).keySeq())},zt.prototype.toString=function(){return this.__toString("Set {","}")},zt.prototype.has=function(e){return this._map.has(e)},zt.prototype.add=function(e){return Rt(this,this._map.set(e,!0))},zt.prototype.remove=function(e){return Rt(this,this._map.remove(e))},zt.prototype.clear=function(){return Rt(this,this._map.clear())},zt.prototype.union=function(){var e=ln.call(arguments,0);return e=e.filter(function(e){return 0!==e.size}),0===e.length?this:0!==this.size||this.__ownerID||1!==e.length?this.withMutations(function(t){for(var n=0;n=0;n--)t={value:arguments[n],next:t};return this.__ownerID?(this.size=e,this._head=t,this.__hash=void 0,this.__altered=!0,this):Kt(e,t)},Gt.prototype.pushAll=function(e){if(e=r(e),0===e.size)return this;ue(e.size);var t=this.size,n=this._head;return e.reverse().forEach(function(e){t++,n={value:e,next:n}}),this.__ownerID?(this.size=t,this._head=n,this.__hash=void 0,this.__altered=!0,this):Kt(t,n)},Gt.prototype.pop=function(){return this.slice(1)},Gt.prototype.unshift=function(){return this.push.apply(this,arguments)},Gt.prototype.unshiftAll=function(e){return this.pushAll(e)},Gt.prototype.shift=function(){return this.pop.apply(this,arguments)},Gt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Yt()},Gt.prototype.slice=function(e,t){if(g(e,t,this.size))return this;var n=y(e,this.size),r=_(t,this.size);if(r!==this.size)return ne.prototype.slice.call(this,e,t);for(var i=this.size-n,a=this._head;n--;)a=a.next;return this.__ownerID?(this.size=i,this._head=a,this.__hash=void 0,this.__altered=!0,this):Kt(i,a)},Gt.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Kt(this.size,this._head,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},Gt.prototype.__iterate=function(e,t){if(t)return this.reverse().__iterate(e);for(var n=0,r=this._head;r&&e(r.value,n++,this)!==!1;)r=r.next;return n},Gt.prototype.__iterator=function(e,t){if(t)return this.reverse().__iterator(e);var n=0,r=this._head;return new w(function(){if(r){var t=r.value;return r=r.next,k(e,n++,t)}return x()})},Gt.isStack=Ht;var ir="@@__IMMUTABLE_STACK__@@",ar=Gt.prototype;ar[ir]=!0,ar.withMutations=Bn.withMutations,ar.asMutable=Bn.asMutable,ar.asImmutable=Bn.asImmutable,ar.wasAltered=Bn.wasAltered;var or;t.Iterator=w,Jt(t,{toArray:function(){ue(this.size);var e=new Array(this.size||0);return this.valueSeq().__iterate(function(t,n){e[n]=t}),e},toIndexedSeq:function(){return new it(this)},toJS:function(){return this.toSeq().map(function(e){return e&&"function"==typeof e.toJS?e.toJS():e}).__toJS()},toJSON:function(){return this.toSeq().map(function(e){return e&&"function"==typeof e.toJSON?e.toJSON():e}).__toJS()},toKeyedSeq:function(){return new rt(this,!0)},toMap:function(){return de(this.toKeyedSeq())},toObject:function(){ue(this.size);var e={};return this.__iterate(function(t,n){e[n]=t}),e},toOrderedMap:function(){return Qe(this.toKeyedSeq())},toOrderedSet:function(){return Bt(o(this)?this.valueSeq():this)},toSet:function(){return zt(o(this)?this.valueSeq():this)},toSetSeq:function(){return new at(this)},toSeq:function(){return s(this)?this.toIndexedSeq():o(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Gt(o(this)?this.valueSeq():this)},toList:function(){return Re(o(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(e,t){return 0===this.size?e+t:e+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+t},concat:function(){var e=ln.call(arguments,0);return Ct(this,vt(this,e))},includes:function(e){return this.some(function(t){return Y(t,e)})},entries:function(){return this.__iterator(kn)},every:function(e,t){ue(this.size);var n=!0;return this.__iterate(function(r,i,a){if(!e.call(t,r,i,a))return n=!1,!1}),n},filter:function(e,t){return Ct(this,ut(this,e,t,!0))},find:function(e,t,n){var r=this.findEntry(e,t);return r?r[1]:n},forEach:function(e,t){return ue(this.size),this.__iterate(t?e.bind(t):e)},join:function(e){ue(this.size),e=void 0!==e?""+e:",";var t="",n=!0;return this.__iterate(function(r){n?n=!1:t+=e,t+=null!==r&&void 0!==r?r.toString():""}),t},keys:function(){return this.__iterator(bn)},map:function(e,t){return Ct(this,lt(this,e,t))},reduce:function(e,t,n){ue(this.size);var r,i;return arguments.length<2?i=!0:r=t,this.__iterate(function(t,a,o){i?(i=!1,r=t):r=e.call(n,r,t,a,o)}),r},reduceRight:function(e,t,n){var r=this.toKeyedSeq().reverse();return r.reduce.apply(r,arguments)},reverse:function(){return Ct(this,ct(this,!0))},slice:function(e,t){return Ct(this,pt(this,e,t,!0))},some:function(e,t){return!this.every(Zt(e),t)},sort:function(e){return Ct(this,bt(this,e))},values:function(){return this.__iterator(wn)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some(function(){return!0})},count:function(e,t){return h(e?this.toSeq().filter(e,t):this)},countBy:function(e,t){return dt(this,e,t)},equals:function(e){return J(this,e)},entrySeq:function(){var e=this;if(e._cache)return new j(e._cache);var t=e.toSeq().map(Qt).toIndexedSeq();return t.fromEntrySeq=function(){return e.toSeq()},t},filterNot:function(e,t){return this.filter(Zt(e),t)},findEntry:function(e,t,n){var r=n;return this.__iterate(function(n,i,a){if(e.call(t,n,i,a))return r=[i,n],!1}),r},findKey:function(e,t){var n=this.findEntry(e,t);return n&&n[0]},findLast:function(e,t,n){return this.toKeyedSeq().reverse().find(e,t,n)},findLastEntry:function(e,t,n){return this.toKeyedSeq().reverse().findEntry(e,t,n)},findLastKey:function(e,t){return this.toKeyedSeq().reverse().findKey(e,t)},first:function(){return this.find(v)},flatMap:function(e,t){return Ct(this,yt(this,e,t))},flatten:function(e){return Ct(this,gt(this,e,!0))},fromEntrySeq:function(){return new ot(this)},get:function(e,t){return this.find(function(t,n){return Y(n,e)},void 0,t)},getIn:function(e,t){for(var n,r=this,i=Dt(e);!(n=i.next()).done;){var a=n.value;if(r=r&&r.get?r.get(a,gn):gn,r===gn)return t}return r},groupBy:function(e,t){return ft(this,e,t)},has:function(e){return this.get(e,gn)!==gn},hasIn:function(e){return this.getIn(e,gn)!==gn},isSubset:function(e){return e="function"==typeof e.includes?e:t(e),this.every(function(t){return e.includes(t)})},isSuperset:function(e){return e="function"==typeof e.isSubset?e:t(e),e.isSubset(this)},keyOf:function(e){return this.findKey(function(t){return Y(t,e)})},keySeq:function(){return this.toSeq().map(Xt).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},lastKeyOf:function(e){return this.toKeyedSeq().reverse().keyOf(e)},max:function(e){return wt(this,e)},maxBy:function(e,t){return wt(this,t,e)},min:function(e){return wt(this,e?en(e):rn)},minBy:function(e,t){return wt(this,t?en(t):rn,e)},rest:function(){return this.slice(1)},skip:function(e){return this.slice(Math.max(0,e))},skipLast:function(e){return Ct(this,this.toSeq().reverse().skip(e).reverse())},skipWhile:function(e,t){return Ct(this,mt(this,e,t,!0))},skipUntil:function(e,t){return this.skipWhile(Zt(e),t)},sortBy:function(e,t){return Ct(this,bt(this,t,e))},take:function(e){return this.slice(0,Math.max(0,e))},takeLast:function(e){return Ct(this,this.toSeq().reverse().take(e).reverse())},takeWhile:function(e,t){return Ct(this,ht(this,e,t))},takeUntil:function(e,t){return this.takeWhile(Zt(e),t)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=an(this))}});var sr=t.prototype;sr[cn]=!0,sr[Sn]=sr.values,sr.__toJS=sr.toArray,sr.__toStringMapper=tn,sr.inspect=sr.toSource=function(){return this.toString()},sr.chain=sr.flatMap,sr.contains=sr.includes,Jt(n,{flip:function(){return Ct(this,st(this))},mapEntries:function(e,t){var n=this,r=0;return Ct(this,this.toSeq().map(function(i,a){return e.call(t,[a,i],r++,n)}).fromEntrySeq())},mapKeys:function(e,t){var n=this;return Ct(this,this.toSeq().flip().map(function(r,i){return e.call(t,r,i,n)}).flip())}});var lr=n.prototype;lr[un]=!0,lr[Sn]=sr.entries,lr.__toJS=sr.toObject,lr.__toStringMapper=function(e,t){return JSON.stringify(t)+": "+tn(e)},Jt(r,{toKeyedSeq:function(){return new rt(this,!1)},filter:function(e,t){return Ct(this,ut(this,e,t,!1))},findIndex:function(e,t){var n=this.findEntry(e,t);return n?n[0]:-1},indexOf:function(e){var t=this.keyOf(e);return void 0===t?-1:t},lastIndexOf:function(e){var t=this.lastKeyOf(e);return void 0===t?-1:t},reverse:function(){return Ct(this,ct(this,!1))},slice:function(e,t){return Ct(this,pt(this,e,t,!1))},splice:function(e,t){var n=arguments.length;if(t=Math.max(0|t,0),0===n||2===n&&!t)return this;e=y(e,e<0?this.count():this.size);var r=this.slice(0,e);return Ct(this,1===n?r:r.concat(p(arguments,2),this.slice(e+t)))},findLastIndex:function(e,t){var n=this.findLastEntry(e,t);return n?n[0]:-1},first:function(){return this.get(0)},flatten:function(e){return Ct(this,gt(this,e,!1))},get:function(e,t){return e=m(this,e),e<0||this.size===1/0||void 0!==this.size&&e>this.size?t:this.find(function(t,n){return n===e},void 0,t)},has:function(e){return e=m(this,e),e>=0&&(void 0!==this.size?this.size===1/0||e=1e4)return f(e,t,n);var l=a.diff(e,t),d=0;return l.forEach(function(e){if("="===e.op)d++;else if("!="===e.op){if(u(e.val)&&u(e.newVal)){var t=f(e.val,e.newVal,s(o,d));i=i.concat(t)}else i.push(c("replace",s(o,d),e.newVal));d++}else"+"===e.op?(i.push(c("add",s(o,d),e.val)),d++):"-"===e.op&&i.push(c("remove",s(o,d)))}),i},h=function(e,t,n){var r=n||"";return e===t?[]:[c("replace",s(r,""),t)]},m=function(e,t,n){return r.is(e,t)?r.List():e==t||null!=e&&null!=t?d(e)&&d(t)?r.fromJS(p(e,t)):u(e)&&u(t)?r.fromJS(f(e,t)):r.fromJS(h(e,t,n)):r.fromJS([c("replace","/",t)])};e.exports=m},function(e,t,n){"use strict";var r=n(465),i=function(e){return r.Iterable.isKeyed(e)},a=function(e){return r.Iterable.isIndexed(e)},o=function(e,t,n){return"remove"===e?{op:e,path:t}:{op:e,path:t,value:n}};e.exports={isMap:i,isIndexed:a,op:o}},function(e,t,n){"use strict";function r(e,t){for(var n=e.size||0,r=t.size||0,o=a(n+1,r+1,0),s=0;s=0||u>=0;)c>=0&&u>=0&&i.is(t.get(c),n.get(u))?(o.push(new s({op:"=",val:t.get(c)})),c-=1,u-=1):c>=0&&u>=0&&c===u&&!i.is(t.get(c),n.get(u))?(o.push(new l({val:t.get(c),newVal:n.get(c)})),c-=1,u-=1):u>=0&&(c===-1||e[c+1][u]>=e[c][u+1])?(o.push(new s({op:"+",val:n.get(u)})),u-=1):c>=0&&(u===-1||e[c+1][u]');n.append(i)}),e=!0,!0)})})}},{key:"addedNodes",value:function(e){var t=this;e.forEach(function(e){"childList"===e.type&&(e.addedNodes&&(0,s.default)("body").trigger("mutation._grav",e.target,e,t),e.removedNodes&&(0,s.default)("body").trigger("mutation_removed._grav",{target:e.target,mutation:e},t))})}}]),t}();t.default=l;t.Instance=new l("form#blueprints")}).call(t,function(){return this}())},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(472),a=r(i),o=n(473),s=r(o),l=n(475),c=r(l),u=n(476),d=r(u),f=n(477),p=r(f),h=n(397),m=r(h),v=n(613),g=r(v),y=n(394),_=r(y),b=n(618),w=r(b),k=n(619),x=r(k),C=n(620),S=r(C),E=n(621),A=r(E),O=n(622),I=r(O),M=n(624),D=r(M),T=n(625),j=r(T);n(628),n(629),n(630),t.default={FilepickerField:{FilepickerField:a.default,Instance:i.Instance},SelectizeField:{SelectizeField:s.default,Instance:o.Instance},ArrayField:{ArrayField:c.default,Instance:l.Instance},CollectionsField:{CollectionsField:d.default,Instance:u.Instance},DateTimeField:{DateTimeField:p.default,Instance:f.Instance},EditorField:{EditorField:m.default,Instance:h.Instance},ColorpickerField:{ColorpickerField:g.default,Instance:v.Instance},FilesField:{FilesField:_.default,Instance:y.Instance},SelectUniqueField:{SelectUniqueField:S.default,Instance:C.Instance},MediapickerField:{MediapickerField:w.default,Instance:b.Instance},MultilevelField:{MultilevelField:x.default,Instance:k.Instance},IconpickerField:{IconpickerField:A.default,Instance:E.Instance},CronField:{CronField:I.default,Instance:O.Instance},TextField:{TextField:D.default,Instance:M.Instance},ParentsField:{ParentsField:j.default,Instance:T.Instance}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.Instance=void 0;var a=function(){function e(e,t){for(var n=0;n0;if(r.length&&!r.get(0).selectize){var c=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"all",r=l.config.current_url+(".json/task"+l.config.param_sep+"getFilesInFolder"),o=e.closest("[data-grav-filepicker]"),s=o.data("name"),c=o.data("value"),d=JSON.stringify(l.uri_params||"{}");(0,u.default)(r,{method:"post",body:{name:s,params:d}},function(e){if("undefined"!=typeof e.files){var r=[];a=e.thumbs||{};for(var o=0;o0,f=!1,p=function(e,t){var n="";if(d&&i&&(!e.status||"available"===e.status)&&e.name.match(/\.(jpg|jpeg|png|gif)$/i)){var r=a[e.name]||l.config.base_url_relative+"/../"+i+"/"+e.name;n=''}return'
\n \n '+n+' '+t(e.name)+"\n \n
"};r.selectize({plugins:["required-fix"],valueField:"name",labelField:"name",searchField:"name",optgroups:[{$order:1,value:"pending",label:"Pending"},{$order:2,value:"available",label:"Available"}],optgroupField:"status",create:!1,preload:!1,render:{option:function(e,t){return p(e,t)},item:function(e,t){return p(e,t)}},onInitialize:function(){o||this.load(function(e){return c(r,function(t){return e(t)},"selected")})},onLoad:function(){if(!f){var e=this.getValue();this.updateOption(e,{name:e}),f=!0}},onFocus:function(){this.load(function(e){return c(r,function(t){return e(t)})})}})}}}]),e}();t.default=d;t.Instance=new d},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.Instance=void 0;var a=function(){function e(e,t){for(var n=0;n\n '+r+'\n \n '+i.replace("(","/").replace(")","")+"\n "+n.join(" ")+"\n \n "}},c=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,e),this.options=Object.assign({},n),this.elements=[],(0,s.default)("[data-grav-selectize]").each(function(e,n){return t.add(n)}),(0,s.default)("body").on("mutation._grav",this._onAddedNodes.bind(this))}return a(e,[{key:"add",value:function(e){if(e=(0,s.default)(e),e.closest("template").length)return!1;var t=e.prop("tagName").toLowerCase(),n="input"===t||"select"===t,r=(n?e.closest("[data-grav-selectize]"):e).data("grav-selectize")||{},i=n?e:e.find("input, select");if("data[route]"===i.attr("name")&&(r=s.default.extend({},r,{render:l})),i.length&&!i.get(0).selectize){var a=s.default.merge(r.plugins?r.plugins:[],["required-fix"]);i.selectize(s.default.extend({},r,{plugins:a})),this.elements.push(i.data("selectize"))}}},{key:"_onAddedNodes",value:function(e,t){var n=this,r=(0,s.default)(t).find("select.fancy, input.fancy, [data-grav-selectize]").filter(function(e,t){return!(0,s.default)(t).closest("template").length});r.length&&r.each(function(e,t){return n.add(t)})}}]),e}();t.default=c;t.Instance=new c},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(1),a=r(i),o=n(381),s=r(o);s.default.define("option_click",function(e){var t=this,n=t.setup;this.setup=function(){n.apply(t,arguments);var e=!1;t.$dropdown_content.on("mousedown click",function(n){var r=(0,a.default)(n.target);r.hasClass("clickable")||r.closest(".clickable").length?"mousedown"===n.type?(e=!0,t.isFocused=!1):(t.isFocused=!0,setTimeout(function(){e=!1})):(e=!1,t.isFocused=!0)}),t.$dropdown.off("mousedown click","[data-selectable]").on("mousedown click","[data-selectable]",function(){if(!e)return t.onOptionSelect.apply(t,arguments)}),t.$control_input.off("blur").on("blur",function(){if(!e)return t.onBlur.apply(t,arguments)})}})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.Instance=void 0;var a=function(){function e(e,t){for(var n=0;n':"';return e+=this.isValueOnly()?'\n
\n \n '+t+"\n ":'\n
\n \n \n '+t+"\n ",e+='\n \n \n
'}}]),e}(),f=function(){function e(){var t=this;i(this,e),u.on("input",'[data-grav-array-type="key"], [data-grav-array-type="value"]',function(e){return t.actionInput(e)}),u.on("click touch",'[data-grav-array-action]:not([data-grav-array-action="sort"])',function(e){return t.actionEvent(e)}),this.arrays=(0,s.default)(),(0,s.default)('[data-grav-field="array"]').each(function(e,n){return t.addArray(n)}),(0,s.default)("body").on("mutation._grav",this._onAddedNodes.bind(this))}return a(e,[{key:"addArray",value:function(e){var t=this;e=(0,s.default)(e),e.find('[data-grav-array-type="container"]').each(function(e,n){n=(0,s.default)(n),n.data("array-sort")||n[0].hasAttribute("data-array-nosort")||n.data("array-sort",new c.default(n.get(0),{handle:".fa-bars",animation:150,onUpdate:function(){var e=n.find('[data-grav-array-type="row"]:first');t._setTemplate(e);var r=e.data("array-template");t.refreshNames(r)}}))})}},{key:"actionInput",value:function(e){var t=(0,s.default)(e.target),n=t.data("grav-array-type");this._setTemplate(t);var r=t.data("array-template"),i="key"===n?t:t.siblings('[data-grav-array-type="key"]:first'),a="value"===n?t:t.siblings('[data-grav-array-type="value"]:first'),o=r.isValueOnly()?this.getIndexFor(t):i.val();o=o.toString().replace(/\[/g,"%5B").replace(/]/g,"%5D");var l=r.getName()+"["+o+"]";a.attr("name",a.val()?l:r.getName()),this.refreshNames(r)}},{key:"actionEvent",value:function(e){e&&e.preventDefault();var t=(0,s.default)(e.target),n=t.data("grav-array-action"),r=t.parents('[data-grav-array-type="container"]');this._setTemplate(t),this[n+"Action"](t);var i=r.find("> div");r[i.length>1?"removeClass":"addClass"]("one-child")}},{key:"addAction",value:function(e){var t=e.data("array-template"),n=e.closest('[data-grav-array-type="row"]');n.after(t.getNewRow())}},{key:"remAction",value:function(e){var t=e.data("array-template"),n=e.closest('[data-grav-array-type="row"]'),r=!n.siblings().length;if(r){var i=(0,s.default)(t.getNewRow());n.after(i),i.find('[data-grav-array-type="value"]:last').attr("name",t.getName())}n.remove(),this.refreshNames(t)}},{key:"refreshNames",value:function(e){if(e.isValueOnly()){var t=e.container.find('> div > [data-grav-array-type="row"]'),n=t.find('[name]:not([name=""])');n.each(function(e,t){t=(0,s.default)(t);var n=t.closest("[data-grav-array-name]"),r=n.attr("data-grav-array-name")+"["+e+"]";t.attr("name",r)}),n.length||t.find('[data-grav-array-type="value"]').attr("name",e.getName())}}},{key:"getIndexFor",value:function(e){var t=e.data("array-template"),n=e.closest('[data-grav-array-type="row"]');return t.container.find((t.isValueOnly()?"> div ":"")+' > [data-grav-array-type="row"]').index(n)}},{key:"_setTemplate",value:function(e){e.data("array-template")||e.data("array-template",new d(e.closest("[data-grav-array-name]")))}},{key:"_onAddedNodes",value:function(e,t){var n=this,r=(0,s.default)(t).find('[data-grav-field="array"]');r.length&&r.each(function(e,t){t=(0,s.default)(t),~n.arrays.index(t)||n.addArray(t)})}}]),e}();t.default=f;t.Instance=new f},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.Instance=void 0;var a=function(){function e(e,t){for(var n=0;n .collection-actions [data-action="add"]',function(e){return t.addItem(e)}),e.on("click",'> ul > li > .item-actions [data-action="delete"]',function(e){return t.removeItem(e)}),e.on("click",'> ul > li > .item-actions [data-action="collapse"]',function(e){return t.collapseItem(e)}),e.on("click",'> ul > li > .item-actions [data-action="expand"]',function(e){return t.expandItem(e)}),e.on("click",'> .collection-actions [data-action-sort="date"]',function(e){return t.sortItems(e)}),e.on("click",'> .collection-actions [data-action="collapse_all"]',function(e){return t.collapseItems(e)}),e.on("click",'> .collection-actions [data-action="expand_all"]',function(e){return t.expandItems(e)}),e.on("input change","[data-key-observe]",function(e){return t.observeKey(e)}),e.find("[data-collection-holder]").each(function(e,n){n=(0,s.default)(n),n.data("collection-sort")||n[0].hasAttribute("data-collection-nosort")||n.data("collection-sort",new c.default(n.get(0),{forceFallback:!1,handle:".collection-sort",animation:150,onUpdate:function(){return t.reindex(n)}}))}),this._updateActionsStateBasedOnMinMax(e)}},{key:"addItem",value:function(e){var t=(0,s.default)(e.currentTarget),n=t.data("action-add")||"bottom",r=(0,s.default)(t.closest('[data-type="collection"]')),i=(0,s.default)(r.find('> [data-collection-template="new"]').data("collection-template-html")); +return e?this.__make(t,e):(this.__ownerID=e,this._map=t,this)},zt.isSet=qt;var Zn="@@__IMMUTABLE_SET__@@",er=zt.prototype;er[Zn]=!0,er[pn]=er.remove,er.mergeDeep=er.merge,er.mergeDeepWith=er.mergeWith,er.withMutations=Bn.withMutations,er.asMutable=Bn.asMutable,er.asImmutable=Bn.asImmutable,er.__empty=Ut,er.__make=Ft;var tr;e(Bt,zt),Bt.of=function(){return this(arguments)},Bt.fromKeys=function(e){return this(n(e).keySeq())},Bt.prototype.toString=function(){return this.__toString("OrderedSet {","}")},Bt.isOrderedSet=Vt;var nr=Bt.prototype;nr[fn]=!0,nr.__empty=Wt,nr.__make=$t;var rr;e(Gt,ne),Gt.of=function(){return this(arguments)},Gt.prototype.toString=function(){return this.__toString("Stack [","]")},Gt.prototype.get=function(e,t){var n=this._head;for(e=m(this,e);n&&e--;)n=n.next;return n?n.value:t},Gt.prototype.peek=function(){return this._head&&this._head.value},Gt.prototype.push=function(){if(0===arguments.length)return this;for(var e=this.size+arguments.length,t=this._head,n=arguments.length-1;n>=0;n--)t={value:arguments[n],next:t};return this.__ownerID?(this.size=e,this._head=t,this.__hash=void 0,this.__altered=!0,this):Kt(e,t)},Gt.prototype.pushAll=function(e){if(e=r(e),0===e.size)return this;ue(e.size);var t=this.size,n=this._head;return e.reverse().forEach(function(e){t++,n={value:e,next:n}}),this.__ownerID?(this.size=t,this._head=n,this.__hash=void 0,this.__altered=!0,this):Kt(t,n)},Gt.prototype.pop=function(){return this.slice(1)},Gt.prototype.unshift=function(){return this.push.apply(this,arguments)},Gt.prototype.unshiftAll=function(e){return this.pushAll(e)},Gt.prototype.shift=function(){return this.pop.apply(this,arguments)},Gt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Yt()},Gt.prototype.slice=function(e,t){if(g(e,t,this.size))return this;var n=y(e,this.size),r=_(t,this.size);if(r!==this.size)return ne.prototype.slice.call(this,e,t);for(var i=this.size-n,a=this._head;n--;)a=a.next;return this.__ownerID?(this.size=i,this._head=a,this.__hash=void 0,this.__altered=!0,this):Kt(i,a)},Gt.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Kt(this.size,this._head,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},Gt.prototype.__iterate=function(e,t){if(t)return this.reverse().__iterate(e);for(var n=0,r=this._head;r&&e(r.value,n++,this)!==!1;)r=r.next;return n},Gt.prototype.__iterator=function(e,t){if(t)return this.reverse().__iterator(e);var n=0,r=this._head;return new w(function(){if(r){var t=r.value;return r=r.next,k(e,n++,t)}return x()})},Gt.isStack=Ht;var ir="@@__IMMUTABLE_STACK__@@",ar=Gt.prototype;ar[ir]=!0,ar.withMutations=Bn.withMutations,ar.asMutable=Bn.asMutable,ar.asImmutable=Bn.asImmutable,ar.wasAltered=Bn.wasAltered;var or;t.Iterator=w,Jt(t,{toArray:function(){ue(this.size);var e=new Array(this.size||0);return this.valueSeq().__iterate(function(t,n){e[n]=t}),e},toIndexedSeq:function(){return new it(this)},toJS:function(){return this.toSeq().map(function(e){return e&&"function"==typeof e.toJS?e.toJS():e}).__toJS()},toJSON:function(){return this.toSeq().map(function(e){return e&&"function"==typeof e.toJSON?e.toJSON():e}).__toJS()},toKeyedSeq:function(){return new rt(this,!0)},toMap:function(){return de(this.toKeyedSeq())},toObject:function(){ue(this.size);var e={};return this.__iterate(function(t,n){e[n]=t}),e},toOrderedMap:function(){return Qe(this.toKeyedSeq())},toOrderedSet:function(){return Bt(o(this)?this.valueSeq():this)},toSet:function(){return zt(o(this)?this.valueSeq():this)},toSetSeq:function(){return new at(this)},toSeq:function(){return s(this)?this.toIndexedSeq():o(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Gt(o(this)?this.valueSeq():this)},toList:function(){return Re(o(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(e,t){return 0===this.size?e+t:e+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+t},concat:function(){var e=ln.call(arguments,0);return Ct(this,vt(this,e))},includes:function(e){return this.some(function(t){return Y(t,e)})},entries:function(){return this.__iterator(kn)},every:function(e,t){ue(this.size);var n=!0;return this.__iterate(function(r,i,a){if(!e.call(t,r,i,a))return n=!1,!1}),n},filter:function(e,t){return Ct(this,ut(this,e,t,!0))},find:function(e,t,n){var r=this.findEntry(e,t);return r?r[1]:n},forEach:function(e,t){return ue(this.size),this.__iterate(t?e.bind(t):e)},join:function(e){ue(this.size),e=void 0!==e?""+e:",";var t="",n=!0;return this.__iterate(function(r){n?n=!1:t+=e,t+=null!==r&&void 0!==r?r.toString():""}),t},keys:function(){return this.__iterator(bn)},map:function(e,t){return Ct(this,lt(this,e,t))},reduce:function(e,t,n){ue(this.size);var r,i;return arguments.length<2?i=!0:r=t,this.__iterate(function(t,a,o){i?(i=!1,r=t):r=e.call(n,r,t,a,o)}),r},reduceRight:function(e,t,n){var r=this.toKeyedSeq().reverse();return r.reduce.apply(r,arguments)},reverse:function(){return Ct(this,ct(this,!0))},slice:function(e,t){return Ct(this,pt(this,e,t,!0))},some:function(e,t){return!this.every(Zt(e),t)},sort:function(e){return Ct(this,bt(this,e))},values:function(){return this.__iterator(wn)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some(function(){return!0})},count:function(e,t){return h(e?this.toSeq().filter(e,t):this)},countBy:function(e,t){return dt(this,e,t)},equals:function(e){return J(this,e)},entrySeq:function(){var e=this;if(e._cache)return new j(e._cache);var t=e.toSeq().map(Qt).toIndexedSeq();return t.fromEntrySeq=function(){return e.toSeq()},t},filterNot:function(e,t){return this.filter(Zt(e),t)},findEntry:function(e,t,n){var r=n;return this.__iterate(function(n,i,a){if(e.call(t,n,i,a))return r=[i,n],!1}),r},findKey:function(e,t){var n=this.findEntry(e,t);return n&&n[0]},findLast:function(e,t,n){return this.toKeyedSeq().reverse().find(e,t,n)},findLastEntry:function(e,t,n){return this.toKeyedSeq().reverse().findEntry(e,t,n)},findLastKey:function(e,t){return this.toKeyedSeq().reverse().findKey(e,t)},first:function(){return this.find(v)},flatMap:function(e,t){return Ct(this,yt(this,e,t))},flatten:function(e){return Ct(this,gt(this,e,!0))},fromEntrySeq:function(){return new ot(this)},get:function(e,t){return this.find(function(t,n){return Y(n,e)},void 0,t)},getIn:function(e,t){for(var n,r=this,i=Dt(e);!(n=i.next()).done;){var a=n.value;if(r=r&&r.get?r.get(a,gn):gn,r===gn)return t}return r},groupBy:function(e,t){return ft(this,e,t)},has:function(e){return this.get(e,gn)!==gn},hasIn:function(e){return this.getIn(e,gn)!==gn},isSubset:function(e){return e="function"==typeof e.includes?e:t(e),this.every(function(t){return e.includes(t)})},isSuperset:function(e){return e="function"==typeof e.isSubset?e:t(e),e.isSubset(this)},keyOf:function(e){return this.findKey(function(t){return Y(t,e)})},keySeq:function(){return this.toSeq().map(Xt).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},lastKeyOf:function(e){return this.toKeyedSeq().reverse().keyOf(e)},max:function(e){return wt(this,e)},maxBy:function(e,t){return wt(this,t,e)},min:function(e){return wt(this,e?en(e):rn)},minBy:function(e,t){return wt(this,t?en(t):rn,e)},rest:function(){return this.slice(1)},skip:function(e){return this.slice(Math.max(0,e))},skipLast:function(e){return Ct(this,this.toSeq().reverse().skip(e).reverse())},skipWhile:function(e,t){return Ct(this,mt(this,e,t,!0))},skipUntil:function(e,t){return this.skipWhile(Zt(e),t)},sortBy:function(e,t){return Ct(this,bt(this,t,e))},take:function(e){return this.slice(0,Math.max(0,e))},takeLast:function(e){return Ct(this,this.toSeq().reverse().take(e).reverse())},takeWhile:function(e,t){return Ct(this,ht(this,e,t))},takeUntil:function(e,t){return this.takeWhile(Zt(e),t)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=an(this))}});var sr=t.prototype;sr[cn]=!0,sr[Sn]=sr.values,sr.__toJS=sr.toArray,sr.__toStringMapper=tn,sr.inspect=sr.toSource=function(){return this.toString()},sr.chain=sr.flatMap,sr.contains=sr.includes,Jt(n,{flip:function(){return Ct(this,st(this))},mapEntries:function(e,t){var n=this,r=0;return Ct(this,this.toSeq().map(function(i,a){return e.call(t,[a,i],r++,n)}).fromEntrySeq())},mapKeys:function(e,t){var n=this;return Ct(this,this.toSeq().flip().map(function(r,i){return e.call(t,r,i,n)}).flip())}});var lr=n.prototype;lr[un]=!0,lr[Sn]=sr.entries,lr.__toJS=sr.toObject,lr.__toStringMapper=function(e,t){return JSON.stringify(t)+": "+tn(e)},Jt(r,{toKeyedSeq:function(){return new rt(this,!1)},filter:function(e,t){return Ct(this,ut(this,e,t,!1))},findIndex:function(e,t){var n=this.findEntry(e,t);return n?n[0]:-1},indexOf:function(e){var t=this.keyOf(e);return void 0===t?-1:t},lastIndexOf:function(e){var t=this.lastKeyOf(e);return void 0===t?-1:t},reverse:function(){return Ct(this,ct(this,!1))},slice:function(e,t){return Ct(this,pt(this,e,t,!1))},splice:function(e,t){var n=arguments.length;if(t=Math.max(0|t,0),0===n||2===n&&!t)return this;e=y(e,e<0?this.count():this.size);var r=this.slice(0,e);return Ct(this,1===n?r:r.concat(p(arguments,2),this.slice(e+t)))},findLastIndex:function(e,t){var n=this.findLastEntry(e,t);return n?n[0]:-1},first:function(){return this.get(0)},flatten:function(e){return Ct(this,gt(this,e,!1))},get:function(e,t){return e=m(this,e),e<0||this.size===1/0||void 0!==this.size&&e>this.size?t:this.find(function(t,n){return n===e},void 0,t)},has:function(e){return e=m(this,e),e>=0&&(void 0!==this.size?this.size===1/0||e=1e4)return f(e,t,n);var l=a.diff(e,t),d=0;return l.forEach(function(e){if("="===e.op)d++;else if("!="===e.op){if(u(e.val)&&u(e.newVal)){var t=f(e.val,e.newVal,s(o,d));i=i.concat(t)}else i.push(c("replace",s(o,d),e.newVal));d++}else"+"===e.op?(i.push(c("add",s(o,d),e.val)),d++):"-"===e.op&&i.push(c("remove",s(o,d)))}),i},h=function(e,t,n){var r=n||"";return e===t?[]:[c("replace",s(r,""),t)]},m=function(e,t,n){return r.is(e,t)?r.List():e==t||null!=e&&null!=t?d(e)&&d(t)?r.fromJS(p(e,t)):u(e)&&u(t)?r.fromJS(f(e,t)):r.fromJS(h(e,t,n)):r.fromJS([c("replace","/",t)])};e.exports=m},function(e,t,n){"use strict";var r=n(465),i=function(e){return r.Iterable.isKeyed(e)},a=function(e){return r.Iterable.isIndexed(e)},o=function(e,t,n){return"remove"===e?{op:e,path:t}:{op:e,path:t,value:n}};e.exports={isMap:i,isIndexed:a,op:o}},function(e,t,n){"use strict";function r(e,t){for(var n=e.size||0,r=t.size||0,o=a(n+1,r+1,0),s=0;s=0||u>=0;)c>=0&&u>=0&&i.is(t.get(c),n.get(u))?(o.push(new s({op:"=",val:t.get(c)})),c-=1,u-=1):c>=0&&u>=0&&c===u&&!i.is(t.get(c),n.get(u))?(o.push(new l({val:t.get(c),newVal:n.get(c)})),c-=1,u-=1):u>=0&&(c===-1||e[c+1][u]>=e[c][u+1])?(o.push(new s({op:"+",val:n.get(u)})),u-=1):c>=0&&(u===-1||e[c+1][u]');n.append(i)}),e=!0,!0)})})}},{key:"addedNodes",value:function(e){var t=this;e.forEach(function(e){"childList"===e.type&&(e.addedNodes&&(0,s.default)("body").trigger("mutation._grav",e.target,e,t),e.removedNodes&&(0,s.default)("body").trigger("mutation_removed._grav",{target:e.target,mutation:e},t))})}}]),t}();t.default=l;t.Instance=new l("form#blueprints")}).call(t,function(){return this}())},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(472),a=r(i),o=n(473),s=r(o),l=n(475),c=r(l),u=n(476),d=r(u),f=n(477),p=r(f),h=n(397),m=r(h),v=n(613),g=r(v),y=n(394),_=r(y),b=n(618),w=r(b),k=n(619),x=r(k),C=n(620),S=r(C),E=n(621),A=r(E),O=n(622),I=r(O),M=n(624),D=r(M),T=n(625),j=r(T);n(628),n(629),n(630),t.default={FilepickerField:{FilepickerField:a.default,Instance:i.Instance},SelectizeField:{SelectizeField:s.default,Instance:o.Instance},ArrayField:{ArrayField:c.default,Instance:l.Instance},CollectionsField:{CollectionsField:d.default,Instance:u.Instance},DateTimeField:{DateTimeField:p.default,Instance:f.Instance},EditorField:{EditorField:m.default,Instance:h.Instance},ColorpickerField:{ColorpickerField:g.default,Instance:v.Instance},FilesField:{FilesField:_.default,Instance:y.Instance},SelectUniqueField:{SelectUniqueField:S.default,Instance:C.Instance},MediapickerField:{MediapickerField:w.default,Instance:b.Instance},MultilevelField:{MultilevelField:x.default,Instance:k.Instance},IconpickerField:{IconpickerField:A.default,Instance:E.Instance},CronField:{CronField:I.default,Instance:O.Instance},TextField:{TextField:D.default,Instance:M.Instance},ParentsField:{ParentsField:j.default,Instance:T.Instance}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.Instance=void 0;var a=function(){function e(e,t){for(var n=0;n0;if(r.length&&!r.get(0).selectize){var c=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"all",r=l.config.current_url+(".json/task"+l.config.param_sep+"getFilesInFolder"),o=e.closest("[data-grav-filepicker]"),s=o.data("name"),c=o.data("value"),d=JSON.stringify(l.uri_params||"{}");(0,u.default)(r,{method:"post",body:{name:s,params:d}},function(e){if("undefined"!=typeof e.files){var r=[];a=e.thumbs||{};for(var o=0;o0,f=!1,p=function(e,t){var n="";if(d&&i&&(!e.status||"available"===e.status)&&e.name.match(/\.(jpg|jpeg|png|gif)$/i)){var r=a[e.name]||l.config.base_url_relative+"/../"+i+"/"+e.name;n=''}return'
\n \n '+n+' '+t(e.name)+"\n \n
"};r.selectize({plugins:["required-fix"],valueField:"name",labelField:"name",searchField:"name",optgroups:[{$order:1,value:"pending",label:"Pending"},{$order:2,value:"available",label:"Available"}],optgroupField:"status",create:!1,preload:!1,render:{option:function(e,t){return p(e,t)},item:function(e,t){return p(e,t)}},onInitialize:function(){o||this.load(function(e){return c(r,function(t){return e(t)},"selected")})},onLoad:function(){if(!f){var e=this.getValue();this.updateOption(e,{name:e}),f=!0}},onFocus:function(){this.load(function(e){return c(r,function(t){return e(t)})})}})}}}]),e}();t.default=d;t.Instance=new d},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.Instance=void 0;var a=function(){function e(e,t){for(var n=0;n\n '+r+'\n \n '+i.replace("(","/").replace(")","")+"\n "+n.join(" ")+"\n \n
"}},c=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,e),this.options=Object.assign({},n),this.elements=[],(0,s.default)("[data-grav-selectize]").each(function(e,n){return t.add(n)}),(0,s.default)("body").on("mutation._grav",this._onAddedNodes.bind(this))}return a(e,[{key:"add",value:function(e){if(e=(0,s.default)(e),e.closest("template").length)return!1;var t=e.prop("tagName").toLowerCase(),n="input"===t||"select"===t,r=(n?e.closest("[data-grav-selectize]"):e).data("grav-selectize")||{},i=n?e:e.find("input, select");if("data[route]"===i.attr("name")&&(r=s.default.extend({},r,{render:l})),i.length&&!i.get(0).selectize){var a=s.default.merge(r.plugins?r.plugins:[],["required-fix"]);i.selectize(s.default.extend({},r,{plugins:a})),this.elements.push(i.data("selectize"))}}},{key:"_onAddedNodes",value:function(e,t){var n=this,r=(0,s.default)(t).find("select.fancy, input.fancy, [data-grav-selectize]").filter(function(e,t){return!(0,s.default)(t).closest("template").length});r.length&&r.each(function(e,t){return n.add(t)})}}]),e}();t.default=c;t.Instance=new c},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(1),a=r(i),o=n(381),s=r(o);s.default.define("option_click",function(e){var t=this,n=t.setup;this.setup=function(){n.apply(t,arguments);var e=!1;t.$dropdown_content.on("mousedown click",function(n){var r=(0,a.default)(n.target);r.hasClass("clickable")||r.closest(".clickable").length?"mousedown"===n.type?(e=!0,t.isFocused=!1):(t.isFocused=!0,setTimeout(function(){e=!1})):(e=!1,t.isFocused=!0)}),t.$dropdown.off("mousedown click","[data-selectable]").on("mousedown click","[data-selectable]",function(){if(!e)return t.onOptionSelect.apply(t,arguments)}),t.$control_input.off("blur").on("blur",function(){if(!e)return t.onBlur.apply(t,arguments)})}})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.Instance=void 0;var a=function(){function e(e,t){for(var n=0;n':"';return e+=this.isValueOnly()?'\n
\n \n '+t+"\n ":'\n
\n \n \n '+t+"\n ",e+='\n \n \n
'}}]),e}(),f=function(){function e(){var t=this;i(this,e),u.on("input",'[data-grav-array-type="key"], [data-grav-array-type="value"]',function(e){return t.actionInput(e)}),u.on("click touch",'[data-grav-array-action]:not([data-grav-array-action="sort"])',function(e){return t.actionEvent(e)}),this.arrays=(0,s.default)(),(0,s.default)('[data-grav-field="array"]').each(function(e,n){return t.addArray(n)}),(0,s.default)("body").on("mutation._grav",this._onAddedNodes.bind(this))}return a(e,[{key:"addArray",value:function(e){var t=this;e=(0,s.default)(e),e.find('[data-grav-array-type="container"]').each(function(e,n){n=(0,s.default)(n),n.data("array-sort")||n[0].hasAttribute("data-array-nosort")||n.data("array-sort",new c.default(n.get(0),{handle:".fa-bars",animation:150,onUpdate:function(){var e=n.find('[data-grav-array-type="row"]:first');t._setTemplate(e);var r=e.data("array-template");t.refreshNames(r)}}))})}},{key:"actionInput",value:function(e){var t=(0,s.default)(e.target),n=t.data("grav-array-type");this._setTemplate(t);var r=t.data("array-template"),i="key"===n?t:t.siblings('[data-grav-array-type="key"]:first'),a="value"===n?t:t.siblings('[data-grav-array-type="value"]:first'),o=r.isValueOnly()?this.getIndexFor(t):i.val();o=o.toString().replace(/\[/g,"%5B").replace(/]/g,"%5D");var l=r.getName()+"["+o+"]";r.isValueOnly()||i.val()||a.val()?a.attr("name",l):a.attr("name",""),this.refreshNames(r)}},{key:"actionEvent",value:function(e){e&&e.preventDefault();var t=(0,s.default)(e.target),n=t.data("grav-array-action"),r=t.parents('[data-grav-array-type="container"]');this._setTemplate(t),this[n+"Action"](t);var i=r.find("> div");r[i.length>1?"removeClass":"addClass"]("one-child")}},{key:"addAction",value:function(e){var t=e.data("array-template"),n=e.closest('[data-grav-array-type="row"]');n.after(t.getNewRow())}},{key:"remAction",value:function(e){var t=e.data("array-template"),n=e.closest('[data-grav-array-type="row"]'),r=!n.siblings().length;if(r){var i=(0,s.default)(t.getNewRow());n.after(i),i.find('[data-grav-array-type="value"]:last').attr("name",t.getName())}n.remove(),this.refreshNames(t)}},{key:"refreshNames",value:function(e){if(e.isValueOnly()){var t=e.container.find('> div > [data-grav-array-type="row"]'),n=t.find('[name]:not([name=""])');n.each(function(e,t){t=(0,s.default)(t);var n=t.closest("[data-grav-array-name]"),r=n.attr("data-grav-array-name")+"["+e+"]";t.attr("name",r)}),n.length||t.find('[data-grav-array-type="value"]').attr("name",e.getName())}}},{key:"getIndexFor",value:function(e){var t=e.data("array-template"),n=e.closest('[data-grav-array-type="row"]');return t.container.find((t.isValueOnly()?"> div ":"")+' > [data-grav-array-type="row"]').index(n)}},{key:"_setTemplate",value:function(e){e.data("array-template")||e.data("array-template",new d(e.closest("[data-grav-array-name]")))}},{key:"_onAddedNodes",value:function(e,t){var n=this,r=(0,s.default)(t).find('[data-grav-field="array"]');r.length&&r.each(function(e,t){t=(0,s.default)(t),~n.arrays.index(t)||n.addArray(t)})}}]),e}();t.default=f;t.Instance=new f},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.Instance=void 0;var a=function(){function e(e,t){for(var n=0;n .collection-actions [data-action="add"]',function(e){return t.addItem(e)}),e.on("click",'> ul > li > .item-actions [data-action="delete"]',function(e){return t.removeItem(e)}),e.on("click",'> ul > li > .item-actions [data-action="collapse"]',function(e){return t.collapseItem(e)}),e.on("click",'> ul > li > .item-actions [data-action="expand"]',function(e){return t.expandItem(e)}),e.on("click",'> .collection-actions [data-action-sort="date"]',function(e){return t.sortItems(e)}),e.on("click",'> .collection-actions [data-action="collapse_all"]',function(e){return t.collapseItems(e)}),e.on("click",'> .collection-actions [data-action="expand_all"]',function(e){return t.expandItems(e)}),e.on("input change","[data-key-observe]",function(e){return t.observeKey(e)}),e.find("[data-collection-holder]").each(function(e,n){n=(0,s.default)(n),n.data("collection-sort")||n[0].hasAttribute("data-collection-nosort")||n.data("collection-sort",new c.default(n.get(0),{forceFallback:!1,handle:".collection-sort",animation:150,onUpdate:function(){return t.reindex(n)}}))}),this._updateActionsStateBasedOnMinMax(e)}},{key:"addItem",value:function(e){var t=(0,s.default)(e.currentTarget),n=t.data("action-add")||"bottom",r=(0,s.default)(t.closest('[data-type="collection"]')),i=(0,s.default)(r.find('> [data-collection-template="new"]').data("collection-template-html")); this._updateActionsStateBasedOnMinMax(r);var a=r.closest('[data-type="collection"]').find("> ul > [data-collection-item]"),o=r.data("max");if(!("undefined"!=typeof o&&a.length>=o)){r.find("> [data-collection-holder]")["top"===n?"prepend":"append"](i),this.reindex(r),a=r.closest('[data-type="collection"]').find("> ul > [data-collection-item]");var l=r.closest('[data-type="collection"]').find('[data-action-add="top"]'),c=r.closest('[data-type="collection"]').find('[data-action="sort"]');a.length&&(l.length&&l.parent().removeClass("hidden"),c.length&&a.length>1&&c.removeClass("hidden")),(0,s.default)('[data-grav-field="toggleable"] input[type="checkbox"]').trigger("change")}}},{key:"removeItem",value:function(e){var t=(0,s.default)(e.currentTarget),n=t.closest("[data-collection-item]"),r=(0,s.default)(t.closest('[data-type="collection"]')),i=r.closest('[data-type="collection"]').find("> ul > [data-collection-item]"),a=r.data("min");if(!("undefined"!=typeof a&&i.length<=a)){n.remove(),this.reindex(r),i=r.closest('[data-type="collection"]').find("> ul > [data-collection-item]");var o=r.closest('[data-type="collection"]').find('[data-action-add="top"]'),l=r.closest('[data-type="collection"]').find('[data-action="sort"]');i.length||o.length&&o.parent().addClass("hidden"),l.length&&i.length<=1&&l.addClass("hidden"),this._updateActionsStateBasedOnMinMax(r)}}},{key:"collapseItems",value:function(e){var t=(0,s.default)(e.currentTarget),n=(0,s.default)(t.closest('[data-type="collection"]')).find('> ul > [data-collection-item] > .item-actions [data-action="collapse"]');n.click()}},{key:"collapseItem",value:function(e){var t=(0,s.default)(e.currentTarget),n=t.closest("[data-collection-item]");t.attr("data-action","expand").removeClass("fa-chevron-circle-down").addClass("fa-chevron-circle-right"),n.addClass("collection-collapsed")}},{key:"expandItems",value:function(e){var t=(0,s.default)(e.currentTarget),n=(0,s.default)(t.closest('[data-type="collection"]')).find('> ul > [data-collection-item] > .item-actions [data-action="expand"]');n.click()}},{key:"expandItem",value:function(e){var t=(0,s.default)(e.currentTarget),n=t.closest("[data-collection-item]");t.attr("data-action","collapse").removeClass("fa-chevron-circle-right").addClass("fa-chevron-circle-down"),n.removeClass("collection-collapsed")}},{key:"sortItems",value:function(e){var t=(0,s.default)(e.currentTarget),n=t.data("action-sort"),r=t.data("action-sort-dir")||"asc",i=(0,s.default)(t.closest('[data-type="collection"]')),a=i.closest('[data-type="collection"]').find("> ul > [data-collection-item]");a.sort(function(e,t){var i=(0,s.default)(e).find('[name$="['+n+']"]'),a=(0,s.default)(t).find('[name$="['+n+']"]'),o=void 0;return o="asc"===r?i.val()a.val()?1:0:i.val()>a.val()?-1:i.val() ul > [data-collection-item]"),t.each(function(e,t){t=(0,s.default)(t);var n=t.find("[data-key-observe]"),r=n.val(),i=n.length,a=t.data("collection-key-backup");t.attr("data-collection-key",i?r:e),["name","data-grav-field-name","for","id","data-grav-file-settings","data-grav-array-name"].forEach(function(e){t.find("["+e+"], [_"+e+"]").each(function(){var t=(0,s.default)(this),n=[],o=null,l=[new RegExp("\\[(\\d+|\\*|"+a+")\\]","g"),new RegExp("\\.(\\d+|\\*|"+a+")\\.","g")];if("name"===e&&t.data("gravArrayType")){var c=t.attr(e).match(/\[[0-9]{1,}\]$/),u=t[0].closest("[data-grav-array-name]").dataset.gravArrayName;if(c&&u)return o=c[0],void t.attr(e,""+u+c[0])}if(i&&!r)return t.attr("_"+e,t.attr(e)),void t.attr(e,null);t.attr("_"+e)&&(t.attr(e,t.attr("_"+e)),t.attr("_"+e,null)),t.parents("[data-collection-key]").map(function(e,t){return n.push((0,s.default)(t).attr("data-collection-key"))}),n.reverse();var d=a,f=t.attr(e).replace(l[0],function(){var e="";return o&&(e=o,console.log(n,e)),d=n.shift()||d,"["+d+"]"+e});f=f.replace(l[1],function(){return d=n.shift()||d,"."+d+"."}),t.attr(e,f)})})})}},{key:"_onAddedNodes",value:function(e,t){var n=this,r=(0,s.default)(t).find('[data-type="collection"]');r.length&&r.each(function(e,t){t=(0,s.default)(t),~n.lists.index(t)||n.addList(t)})}},{key:"_updateActionsStateBasedOnMinMax",value:function(e){var t=e.closest('[data-type="collection"]').find("> ul > [data-collection-item]"),n=e.data("min"),r=e.data("max");e.find('> .collection-actions [data-action="add"]').attr("disabled",!1),e.find('> ul > li > .item-actions [data-action="delete"]').attr("disabled",!1),"undefined"!=typeof n&&t.length<=n&&e.find('> ul > li > .item-actions [data-action="delete"]').attr("disabled",!0),"undefined"!=typeof r&&t.length>=r&&e.find('> .collection-actions [data-action="add"]').attr("disabled",!0)}}]),e}();t.default=u;t.Instance=new u},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.Instance=void 0;var a=function(){function e(e,t){for(var n=0;n