@themarioga/grid-editor 6.0.0-beta.5 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/AUTO_SAVE.md +2 -2
  2. package/BUILDING.md +45 -29
  3. package/CHANGELOG.md +54 -0
  4. package/README.md +140 -89
  5. package/UPGRADING.md +146 -2
  6. package/dist/grideditor.bundle.min.js +14 -0
  7. package/dist/grideditor.d.ts +335 -0
  8. package/dist/grideditor.esm.js +3977 -0
  9. package/dist/grideditor.jquery.js +253 -0
  10. package/dist/grideditor.jquery.min.js +1 -0
  11. package/dist/grideditor.jquery.min.js.map +7 -0
  12. package/dist/grideditor.js +3983 -0
  13. package/dist/grideditor.min.js +6 -0
  14. package/dist/grideditor.min.js.map +7 -0
  15. package/dist/locales/grideditor.es.esm.js +158 -0
  16. package/dist/locales/grideditor.es.js +164 -170
  17. package/dist/locales/grideditor.es.min.js +6 -2
  18. package/dist/locales/grideditor.es.min.js.map +7 -1
  19. package/dist/plugins/grideditor.accordion.esm.js +294 -0
  20. package/dist/plugins/grideditor.accordion.js +286 -180
  21. package/dist/plugins/grideditor.accordion.min.js +1 -2
  22. package/dist/plugins/grideditor.accordion.min.js.map +7 -1
  23. package/dist/plugins/grideditor.alignment.esm.js +55 -0
  24. package/dist/plugins/grideditor.alignment.js +58 -77
  25. package/dist/plugins/grideditor.alignment.min.js +1 -2
  26. package/dist/plugins/grideditor.alignment.min.js.map +7 -1
  27. package/dist/plugins/grideditor.card.esm.js +73 -0
  28. package/dist/plugins/grideditor.card.js +74 -64
  29. package/dist/plugins/grideditor.card.min.js +1 -2
  30. package/dist/plugins/grideditor.card.min.js.map +7 -1
  31. package/dist/plugins/grideditor.ckeditor.esm.js +500 -0
  32. package/dist/plugins/grideditor.ckeditor.js +482 -493
  33. package/dist/plugins/grideditor.ckeditor.min.js +1 -2
  34. package/dist/plugins/grideditor.ckeditor.min.js.map +7 -1
  35. package/dist/plugins/grideditor.clipboard.esm.js +326 -0
  36. package/dist/plugins/grideditor.clipboard.js +298 -235
  37. package/dist/plugins/grideditor.clipboard.min.js +1 -2
  38. package/dist/plugins/grideditor.clipboard.min.js.map +7 -1
  39. package/dist/plugins/grideditor.codemirror-inline.esm.js +205 -0
  40. package/dist/plugins/grideditor.codemirror-inline.js +188 -168
  41. package/dist/plugins/grideditor.codemirror-inline.min.js +1 -2
  42. package/dist/plugins/grideditor.codemirror-inline.min.js.map +7 -1
  43. package/dist/plugins/grideditor.codemirror.esm.js +63 -0
  44. package/dist/plugins/grideditor.codemirror.js +60 -71
  45. package/dist/plugins/grideditor.codemirror.min.js +1 -2
  46. package/dist/plugins/grideditor.codemirror.min.js.map +7 -1
  47. package/dist/plugins/grideditor.elements.esm.js +271 -0
  48. package/dist/plugins/grideditor.elements.js +256 -149
  49. package/dist/plugins/grideditor.elements.min.js +1 -2
  50. package/dist/plugins/grideditor.elements.min.js.map +7 -1
  51. package/dist/plugins/grideditor.float.esm.js +34 -0
  52. package/dist/plugins/grideditor.float.js +37 -52
  53. package/dist/plugins/grideditor.float.min.js +1 -2
  54. package/dist/plugins/grideditor.float.min.js.map +7 -1
  55. package/dist/plugins/grideditor.gutters.esm.js +143 -0
  56. package/dist/plugins/grideditor.gutters.js +134 -131
  57. package/dist/plugins/grideditor.gutters.min.js +1 -2
  58. package/dist/plugins/grideditor.gutters.min.js.map +7 -1
  59. package/dist/plugins/grideditor.order.esm.js +189 -0
  60. package/dist/plugins/grideditor.order.js +170 -182
  61. package/dist/plugins/grideditor.order.min.js +1 -2
  62. package/dist/plugins/grideditor.order.min.js.map +7 -1
  63. package/dist/plugins/grideditor.popup.esm.js +187 -0
  64. package/dist/plugins/grideditor.popup.js +183 -134
  65. package/dist/plugins/grideditor.popup.min.js +1 -2
  66. package/dist/plugins/grideditor.popup.min.js.map +7 -1
  67. package/dist/plugins/grideditor.sections.esm.js +271 -0
  68. package/dist/plugins/grideditor.sections.js +250 -173
  69. package/dist/plugins/grideditor.sections.min.js +1 -2
  70. package/dist/plugins/grideditor.sections.min.js.map +7 -1
  71. package/dist/plugins/grideditor.spacing.esm.js +318 -0
  72. package/dist/plugins/grideditor.spacing.js +296 -272
  73. package/dist/plugins/grideditor.spacing.min.js +1 -2
  74. package/dist/plugins/grideditor.spacing.min.js.map +7 -1
  75. package/dist/plugins/grideditor.summernote.esm.js +509 -0
  76. package/dist/plugins/grideditor.summernote.js +491 -471
  77. package/dist/plugins/grideditor.summernote.min.js +1 -2
  78. package/dist/plugins/grideditor.summernote.min.js.map +7 -1
  79. package/dist/plugins/grideditor.tabs.esm.js +237 -0
  80. package/dist/plugins/grideditor.tabs.js +233 -139
  81. package/dist/plugins/grideditor.tabs.min.js +1 -2
  82. package/dist/plugins/grideditor.tabs.min.js.map +7 -1
  83. package/dist/plugins/grideditor.textalign.esm.js +40 -0
  84. package/dist/plugins/grideditor.textalign.js +43 -56
  85. package/dist/plugins/grideditor.textalign.min.js +1 -2
  86. package/dist/plugins/grideditor.textalign.min.js.map +7 -1
  87. package/dist/plugins/grideditor.tinymce.esm.js +519 -0
  88. package/dist/plugins/grideditor.tinymce.js +500 -534
  89. package/dist/plugins/grideditor.tinymce.min.js +1 -2
  90. package/dist/plugins/grideditor.tinymce.min.js.map +7 -1
  91. package/dist/plugins/grideditor.visibility.esm.js +158 -0
  92. package/dist/plugins/grideditor.visibility.js +140 -149
  93. package/dist/plugins/grideditor.visibility.min.js +1 -2
  94. package/dist/plugins/grideditor.visibility.min.js.map +7 -1
  95. package/docs/events.md +47 -21
  96. package/docs/locale-keys.md +7 -4
  97. package/docs/plugins.md +49 -27
  98. package/example/adapter.html +112 -0
  99. package/example/attributes.html +85 -61
  100. package/example/autocols.html +9 -9
  101. package/example/autosave.html +13 -14
  102. package/example/basic.html +4 -5
  103. package/example/breakpoints.html +5 -6
  104. package/example/ckeditor.html +4 -5
  105. package/example/clipboard.html +11 -10
  106. package/example/codemirror.html +9 -7
  107. package/example/containers.html +7 -8
  108. package/example/custom_editor.html +53 -34
  109. package/example/elements.html +10 -11
  110. package/example/index.html +16 -2
  111. package/example/locale.html +6 -7
  112. package/example/plugins.html +44 -29
  113. package/example/summernote.html +6 -5
  114. package/example/utilities.html +17 -13
  115. package/example/wrap_content.html +9 -9
  116. package/package.json +43 -12
  117. package/src/js/dom.js +401 -0
  118. package/src/js/grideditor.classic.js +16 -0
  119. package/src/js/grideditor.jquery.js +325 -0
  120. package/src/js/{jquery.grideditor.js → grideditor.js} +1284 -1124
  121. package/src/js/locales/grideditor.es.js +163 -158
  122. package/src/js/plugins/grideditor.accordion.js +97 -77
  123. package/src/js/plugins/grideditor.alignment.js +5 -7
  124. package/src/js/plugins/grideditor.card.js +23 -23
  125. package/src/js/plugins/grideditor.ckeditor.js +107 -106
  126. package/src/js/plugins/grideditor.clipboard.js +49 -37
  127. package/src/js/plugins/grideditor.codemirror-inline.js +50 -37
  128. package/src/js/plugins/grideditor.codemirror.js +9 -10
  129. package/src/js/plugins/grideditor.elements.js +57 -33
  130. package/src/js/plugins/grideditor.float.js +4 -6
  131. package/src/js/plugins/grideditor.gutters.js +20 -15
  132. package/src/js/plugins/grideditor.order.js +28 -25
  133. package/src/js/plugins/grideditor.popup.js +63 -51
  134. package/src/js/plugins/grideditor.sections.js +39 -32
  135. package/src/js/plugins/grideditor.spacing.js +42 -45
  136. package/src/js/plugins/grideditor.summernote.js +112 -76
  137. package/src/js/plugins/grideditor.tabs.js +65 -57
  138. package/src/js/plugins/grideditor.textalign.js +4 -6
  139. package/src/js/plugins/grideditor.tinymce.js +147 -139
  140. package/src/js/plugins/grideditor.visibility.js +24 -25
  141. package/src/js/register.js +18 -0
  142. package/src/js/text/grideditor.text.js +81 -106
  143. package/types/grideditor.d.ts +335 -0
  144. package/dist/jquery.grideditor.bundle.min.js +0 -10
  145. package/dist/jquery.grideditor.js +0 -4927
  146. package/dist/jquery.grideditor.min.js +0 -2
  147. package/dist/jquery.grideditor.min.js.map +0 -1
package/UPGRADING.md CHANGED
@@ -1,3 +1,122 @@
1
+ Upgrading from grid-editor `6.*` to `7.*`
2
+ =========================================
3
+
4
+ One change makes it a major: **grid-editor is plain DOM**. It does not need
5
+ jQuery, its API is a `GridEditor` class, its events are DOM events, and what
6
+ it hands out - to a page and to a plugin - are elements. Markup 6.x saved
7
+ loads as it is, and `getHtml` and `getPlainHtml` give what 6.x gave for it.
8
+
9
+ * __A page written for 6.x can keep its code.__ Load jQuery 4 and the adapter
10
+ after the editor, and the 7.x plugins after that:
11
+
12
+ ```html
13
+ <script src="jquery.min.js"></script>
14
+ <script src="grid-editor/dist/grideditor.min.js"></script>
15
+ <script src="grid-editor/dist/grideditor.jquery.min.js"></script>
16
+ <script src="grid-editor/dist/plugins/grideditor.tabs.min.js"></script>
17
+ ```
18
+
19
+ `$(el).gridEditor(...)`, `$(el).gridEditor('method', ...)`, jQuery listeners
20
+ on `grideditor:*` with `(event, payload)`, `$(el).data('grideditor')`, and
21
+ the callbacks, `custom_filter` and the host tools' handlers all work as they
22
+ did, with jQuery objects where 6.x had them. The adapter supports jQuery 4.
23
+
24
+ * __Or move to the native API__, and drop jQuery:
25
+
26
+ | 6.x | 7.0 |
27
+ | --- | --- |
28
+ | `$('#g').gridEditor(options)` | `var ge = new GridEditor('#g', options)`, or `GridEditor.create('#g', options)` |
29
+ | `$('#g').gridEditor('getHtml')` | `ge.getHtml()`, and so for every method |
30
+ | `$('#g').data('grideditor')` | `GridEditor.get('#g')` |
31
+ | `$('#g').on('grideditor:after-move', function(e, payload) { … })` | `ge.canvas.addEventListener('grideditor:after-move', function(e) { var payload = e.detail; … })` |
32
+ | `payload.node.hasClass('locked')` | `payload.node.classList.contains('locked')`: the payload's nodes are elements |
33
+ | `createRow(...)` returns a jQuery object | returns the element, or `null` |
34
+ | `{ appendTo: $('#col') }` | `{ appendTo: document.querySelector('#col') }`, or `{ appendTo: '#col' }` |
35
+ | `custom_filter` gets `$(canvas)` | gets the canvas element |
36
+ | a host tool's handler gets a jQuery event | gets the DOM event, with `this` the tool |
37
+ | `$.fn.gridEditor.locales`, `$.fn.gridEditor.t` | `GridEditor.locales`, `GridEditor.t` |
38
+
39
+ The methods that do something - `init`, `reset`, `changeView`, `destroy`
40
+ and the rest - return the editor, to chain. A method called after
41
+ `destroy()` does nothing and warns once; `getHtml` still reads the element.
42
+
43
+ * __The files are named for the editor, not for jQuery.__
44
+
45
+ | 6.x | 7.0 |
46
+ | --- | --- |
47
+ | `dist/jquery.grideditor.js`, `.min.js` | `dist/grideditor.js`, `.min.js` |
48
+ | `dist/jquery.grideditor.bundle.min.js` | `dist/grideditor.bundle.min.js` |
49
+ | — | `dist/grideditor.esm.js`, and `dist/plugins/*.esm.js`, `dist/locales/*.esm.js` |
50
+ | — | `dist/grideditor.jquery.js`, the adapter |
51
+ | — | `dist/grideditor.d.ts`, the public API's types |
52
+
53
+ The plugins and the locales keep their names. `package.json`'s `main` is
54
+ `dist/grideditor.js`, and `module`, `exports` and `types` point at the rest.
55
+
56
+ * __In an app built with a bundler__, import it:
57
+
58
+ ```javascript
59
+ import GridEditor from '@themarioga/grid-editor';
60
+ import '@themarioga/grid-editor/plugins/tabs'; // registers as it is imported
61
+ import Sortable from 'sortablejs';
62
+ import * as bootstrap from 'bootstrap';
63
+
64
+ GridEditor.Sortable = Sortable; // there is no window.Sortable in a module app
65
+ GridEditor.bootstrap = bootstrap; // nor a window.bootstrap; only its Modal is used
66
+ ```
67
+
68
+ A page loads the classic script or the module build, never both: each is an
69
+ editor of its own, with its own plugins. Loaded twice, the classic script
70
+ keeps the first `GridEditor` and says so.
71
+
72
+ * __Port a plugin written for 6.x.__ The adapter does not keep 6.x plugins
73
+ working: one registered on `$.fn.gridEditor.containers`, `.features`,
74
+ `.utilities` or `.texts` is named in a warning and left out. What changes:
75
+
76
+ - It registers on `GridEditor.containers`, `.features`, `.utilities` or
77
+ `.texts`, and adds its strings with `Object.assign(GridEditor.locales.en, …)`.
78
+ A classic script stops being `(function($) { … })(jQuery)`; loaded before
79
+ the editor, the shipped ones throw an error saying so.
80
+ - The handle gives and takes elements. `ge.canvas` is the canvas element;
81
+ `ge.createTool` returns the tool; `ge.detailsOf`, `ge.drawerOf` and
82
+ `ge.utilityField` return an element or `null` where 6.x gave an empty set;
83
+ `ge.toolbarItems` returns an array; `ge.labelIn` returns the label.
84
+ - Every hook is handed elements: `mark(container)`, `drawerTools(drawer,
85
+ node, kind)`, `accepts(region, node)`, `onContentReady(area)` and the rest.
86
+ What a hook makes - `create()`, `addPane()`, a toolbar item's `create()`,
87
+ a utility's `panel()` - it returns as an element, or `null`.
88
+ - A text editor's `start(contentAreas)` and `stop(contentAreas)` get an
89
+ array of content areas.
90
+ - The `sortable(lists, options)` a plugin's `onSortable` gets takes an
91
+ element or an array of them, and `options.accepts` is asked with elements.
92
+ - An event it listens for is a DOM event, the payload in `detail`.
93
+
94
+ The shipped plugins in `src/js/plugins/` are ported the same way, and
95
+ `grideditor.card.js` is still the shortest one to read.
96
+
97
+ * __What is gone.__ The `remove()` method, 6.x's deprecated alias of
98
+ `destroy()`; 5.x's `$.fn.gridEditor.RTEs`; and tinyMCE's `oninit` option,
99
+ which is ignored with a warning - use `init_instance_callback`.
100
+
101
+ * __What behaves differently.__
102
+ - A `<script>` in html the editor writes - the source view,
103
+ `source_textarea`, `createElement`, `createColumn`'s content, a paste - is
104
+ kept in the markup and does not run in the editor. 6.x wrote through
105
+ jQuery, which ran it.
106
+ - A listener that throws no longer stops the operation: the browser reports
107
+ the error, and the other listeners, the callbacks and the operation go on.
108
+ - An element that has an editor gets it back when a second one is asked
109
+ for, with its first options, and a warning. 6.x built a second editor
110
+ over the first.
111
+ - A jQuery listener on a page without the adapter gets the DOM event alone,
112
+ with the payload in `event.originalEvent.detail`.
113
+ - `custom_filter` given as a function, or as an array, runs: 6.x only ran a
114
+ function it could find by name.
115
+
116
+ * __Summernote still needs jQuery__, for summernote itself: its page loads
117
+ jQuery and summernote as before, and does not need the adapter.
118
+
119
+
1
120
  Upgrading from grid-editor `5.*` to `6.*`
2
121
  =========================================
3
122
 
@@ -76,8 +195,8 @@ same from it.
76
195
 
77
196
  * __New columns are empty.__ A column the add column tool, a row button,
78
197
  `createRow` or `createColumn` makes - and a new container's or pane's
79
- region - has no content area in it. Add a text with the column's *Add text*
80
- tool, the toolbar's *Text* button or `createText`. `createColumn(size, {
198
+ region - has no content area in it. Add a text with the toolbar's *Text*
199
+ button, clicked or dragged into the column, or `createText`. `createColumn(size, {
81
200
  content })` still holds its content: as a text of the first editor
82
201
  offered, or as plain content with none.
83
202
 
@@ -96,6 +215,31 @@ same from it.
96
215
  `textTypes`; [docs/plugins.md](docs/plugins.md#text) has the contract, and
97
216
  [example/custom_editor.html](example/custom_editor.html) is one in full.
98
217
 
218
+ * __No *Add text* tool in the columns' drawers.__ 5.3 put one there; a text
219
+ is added with the toolbar's *Text* button, dragged into the column, or
220
+ `createText`. The `tool.add_text` and `tool.add_text_type` locale keys are
221
+ gone with it.
222
+
223
+ * __The source button can be left out__ with `edit_source: false`. A page
224
+ that hid `.gm-edit-mode` with css of its own can drop that css.
225
+
226
+ * __A code editor of your own over the source textarea__ - CodeMirror, Ace,
227
+ started on `.ge-html-output` when the source button is clicked - can be the
228
+ codemirror plugin instead, which edits the source view in CodeMirror 5, or a
229
+ feature plugin with `onSourceOpen(textarea)` and `onSourceClose(textarea)`:
230
+ the editor goes over the textarea on open, and puts its value back in it on
231
+ close, which is what the canvas is made of. See
232
+ [docs/plugins.md](docs/plugins.md). The codemirror-inline plugin edits one
233
+ block's html at a time, in place, from a </> tool in its drawer.
234
+
235
+ * __`destroy` with the source view open__ leaves the canvas with the html
236
+ being written in it. It left the canvas hidden, holding the html it had
237
+ before the source opened.
238
+
239
+ * __A page that names its plugins__ in the `plugins` setting names
240
+ `codemirror` and `codemirror-inline` there too, as any feature plugin, to use
241
+ them.
242
+
99
243
 
100
244
  Upgrading from grid-editor `4.*` to `5.*`
101
245
  =========================================
@@ -0,0 +1,14 @@
1
+ /*!
2
+ * grid-editor 7.0.0 bundled with SortableJS.
3
+ *
4
+ * grid-editor: MIT, https://github.com/themarioga/grid-editor
5
+ * SortableJS: MIT, https://github.com/SortableJS/Sortable
6
+ */
7
+ /*! Sortable 1.15.6 - MIT | git://github.com/SortableJS/Sortable.git */
8
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).Sortable=e()}(this,function(){"use strict";function e(e,t){var n,o=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),o.push.apply(o,n)),o}function I(o){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?e(Object(i),!0).forEach(function(t){var e,n;e=o,t=i[n=t],n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach(function(t){Object.defineProperty(o,t,Object.getOwnPropertyDescriptor(i,t))})}return o}function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function a(){return(a=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n,o=arguments[e];for(n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t}).apply(this,arguments)}function i(t,e){if(null==t)return{};var n,o=function(t,e){if(null==t)return{};for(var n,o={},i=Object.keys(t),r=0;r<i.length;r++)n=i[r],0<=e.indexOf(n)||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols)for(var i=Object.getOwnPropertySymbols(t),r=0;r<i.length;r++)n=i[r],0<=e.indexOf(n)||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n]);return o}function r(t){return function(t){if(Array.isArray(t))return l(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return l(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(n="Object"===n&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}function t(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var y=t(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),w=t(/Edge/i),s=t(/firefox/i),u=t(/safari/i)&&!t(/chrome/i)&&!t(/android/i),c=t(/iP(ad|od|hone)/i),n=t(/chrome/i)&&t(/android/i),d={capture:!1,passive:!1};function h(t,e,n){t.addEventListener(e,n,!y&&d)}function p(t,e,n){t.removeEventListener(e,n,!y&&d)}function f(t,e){if(e&&(">"===e[0]&&(e=e.substring(1)),t))try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){return}}function g(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function P(t,e,n,o){if(t){n=n||document;do{if(null!=e&&(">"!==e[0]||t.parentNode===n)&&f(t,e)||o&&t===n)return t}while(t!==n&&(t=g(t)))}return null}var m,v=/\s+/g;function k(t,e,n){var o;t&&e&&(t.classList?t.classList[n?"add":"remove"](e):(o=(" "+t.className+" ").replace(v," ").replace(" "+e+" "," "),t.className=(o+(n?" "+e:"")).replace(v," ")))}function R(t,e,n){var o=t&&t.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];o[e=!(e in o||-1!==e.indexOf("webkit"))?"-webkit-"+e:e]=n+("string"==typeof n?"":"px")}}function b(t,e){var n="";if("string"==typeof t)n=t;else do{var o=R(t,"transform")}while(o&&"none"!==o&&(n=o+" "+n),!e&&(t=t.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function D(t,e,n){if(t){var o=t.getElementsByTagName(e),i=0,r=o.length;if(n)for(;i<r;i++)n(o[i],i);return o}return[]}function O(){var t=document.scrollingElement;return t||document.documentElement}function X(t,e,n,o,i){if(t.getBoundingClientRect||t===window){var r,a,l,s,c,u,d=t!==window&&t.parentNode&&t!==O()?(a=(r=t.getBoundingClientRect()).top,l=r.left,s=r.bottom,c=r.right,u=r.height,r.width):(l=a=0,s=window.innerHeight,c=window.innerWidth,u=window.innerHeight,window.innerWidth);if((e||n)&&t!==window&&(i=i||t.parentNode,!y))do{if(i&&i.getBoundingClientRect&&("none"!==R(i,"transform")||n&&"static"!==R(i,"position"))){var h=i.getBoundingClientRect();a-=h.top+parseInt(R(i,"border-top-width")),l-=h.left+parseInt(R(i,"border-left-width")),s=a+r.height,c=l+r.width;break}}while(i=i.parentNode);return o&&t!==window&&(o=(e=b(i||t))&&e.a,t=e&&e.d,e&&(s=(a/=t)+(u/=t),c=(l/=o)+(d/=o))),{top:a,left:l,bottom:s,right:c,width:d,height:u}}}function Y(t,e,n){for(var o=M(t,!0),i=X(t)[e];o;){var r=X(o)[n];if(!("top"===n||"left"===n?r<=i:i<=r))return o;if(o===O())break;o=M(o,!1)}return!1}function B(t,e,n,o){for(var i=0,r=0,a=t.children;r<a.length;){if("none"!==a[r].style.display&&a[r]!==jt.ghost&&(o||a[r]!==jt.dragged)&&P(a[r],n.draggable,t,!1)){if(i===e)return a[r];i++}r++}return null}function F(t,e){for(var n=t.lastElementChild;n&&(n===jt.ghost||"none"===R(n,"display")||e&&!f(n,e));)n=n.previousElementSibling;return n||null}function j(t,e){var n=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)"TEMPLATE"===t.nodeName.toUpperCase()||t===jt.clone||e&&!f(t,e)||n++;return n}function E(t){var e=0,n=0,o=O();if(t)do{var i=b(t),r=i.a,i=i.d}while(e+=t.scrollLeft*r,n+=t.scrollTop*i,t!==o&&(t=t.parentNode));return[e,n]}function M(t,e){if(!t||!t.getBoundingClientRect)return O();var n=t,o=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=R(n);if(n.clientWidth<n.scrollWidth&&("auto"==i.overflowX||"scroll"==i.overflowX)||n.clientHeight<n.scrollHeight&&("auto"==i.overflowY||"scroll"==i.overflowY)){if(!n.getBoundingClientRect||n===document.body)return O();if(o||e)return n;o=!0}}}while(n=n.parentNode);return O()}function S(t,e){return Math.round(t.top)===Math.round(e.top)&&Math.round(t.left)===Math.round(e.left)&&Math.round(t.height)===Math.round(e.height)&&Math.round(t.width)===Math.round(e.width)}function _(e,n){return function(){var t;m||(1===(t=arguments).length?e.call(this,t[0]):e.apply(this,t),m=setTimeout(function(){m=void 0},n))}}function H(t,e,n){t.scrollLeft+=e,t.scrollTop+=n}function C(t){var e=window.Polymer,n=window.jQuery||window.Zepto;return e&&e.dom?e.dom(t).cloneNode(!0):n?n(t).clone(!0)[0]:t.cloneNode(!0)}function T(t,e){R(t,"position","absolute"),R(t,"top",e.top),R(t,"left",e.left),R(t,"width",e.width),R(t,"height",e.height)}function x(t){R(t,"position",""),R(t,"top",""),R(t,"left",""),R(t,"width",""),R(t,"height","")}function L(n,o,i){var r={};return Array.from(n.children).forEach(function(t){var e;P(t,o.draggable,n,!1)&&!t.animated&&t!==i&&(e=X(t),r.left=Math.min(null!==(t=r.left)&&void 0!==t?t:1/0,e.left),r.top=Math.min(null!==(t=r.top)&&void 0!==t?t:1/0,e.top),r.right=Math.max(null!==(t=r.right)&&void 0!==t?t:-1/0,e.right),r.bottom=Math.max(null!==(t=r.bottom)&&void 0!==t?t:-1/0,e.bottom))}),r.width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}var K="Sortable"+(new Date).getTime();function A(){var e,o=[];return{captureAnimationState:function(){o=[],this.options.animation&&[].slice.call(this.el.children).forEach(function(t){var e,n;"none"!==R(t,"display")&&t!==jt.ghost&&(o.push({target:t,rect:X(t)}),e=I({},o[o.length-1].rect),!t.thisAnimationDuration||(n=b(t,!0))&&(e.top-=n.f,e.left-=n.e),t.fromRect=e)})},addAnimationState:function(t){o.push(t)},removeAnimationState:function(t){o.splice(function(t,e){for(var n in t)if(t.hasOwnProperty(n))for(var o in e)if(e.hasOwnProperty(o)&&e[o]===t[n][o])return Number(n);return-1}(o,{target:t}),1)},animateAll:function(t){var c=this;if(!this.options.animation)return clearTimeout(e),void("function"==typeof t&&t());var u=!1,d=0;o.forEach(function(t){var e=0,n=t.target,o=n.fromRect,i=X(n),r=n.prevFromRect,a=n.prevToRect,l=t.rect,s=b(n,!0);s&&(i.top-=s.f,i.left-=s.e),n.toRect=i,n.thisAnimationDuration&&S(r,i)&&!S(o,i)&&(l.top-i.top)/(l.left-i.left)==(o.top-i.top)/(o.left-i.left)&&(t=l,s=r,r=a,a=c.options,e=Math.sqrt(Math.pow(s.top-t.top,2)+Math.pow(s.left-t.left,2))/Math.sqrt(Math.pow(s.top-r.top,2)+Math.pow(s.left-r.left,2))*a.animation),S(i,o)||(n.prevFromRect=o,n.prevToRect=i,e=e||c.options.animation,c.animate(n,l,i,e)),e&&(u=!0,d=Math.max(d,e),clearTimeout(n.animationResetTimer),n.animationResetTimer=setTimeout(function(){n.animationTime=0,n.prevFromRect=null,n.fromRect=null,n.prevToRect=null,n.thisAnimationDuration=null},e),n.thisAnimationDuration=e)}),clearTimeout(e),u?e=setTimeout(function(){"function"==typeof t&&t()},d):"function"==typeof t&&t(),o=[]},animate:function(t,e,n,o){var i,r;o&&(R(t,"transition",""),R(t,"transform",""),i=(r=b(this.el))&&r.a,r=r&&r.d,i=(e.left-n.left)/(i||1),r=(e.top-n.top)/(r||1),t.animatingX=!!i,t.animatingY=!!r,R(t,"transform","translate3d("+i+"px,"+r+"px,0)"),this.forRepaintDummy=t.offsetWidth,R(t,"transition","transform "+o+"ms"+(this.options.easing?" "+this.options.easing:"")),R(t,"transform","translate3d(0,0,0)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout(function(){R(t,"transition",""),R(t,"transform",""),t.animated=!1,t.animatingX=!1,t.animatingY=!1},o))}}}var N=[],W={initializeByDefault:!0},z={mount:function(e){for(var t in W)!W.hasOwnProperty(t)||t in e||(e[t]=W[t]);N.forEach(function(t){if(t.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),N.push(e)},pluginEvent:function(e,n,o){var t=this;this.eventCanceled=!1,o.cancel=function(){t.eventCanceled=!0};var i=e+"Global";N.forEach(function(t){n[t.pluginName]&&(n[t.pluginName][i]&&n[t.pluginName][i](I({sortable:n},o)),n.options[t.pluginName]&&n[t.pluginName][e]&&n[t.pluginName][e](I({sortable:n},o)))})},initializePlugins:function(n,o,i,t){for(var e in N.forEach(function(t){var e=t.pluginName;(n.options[e]||t.initializeByDefault)&&((t=new t(n,o,n.options)).sortable=n,t.options=n.options,n[e]=t,a(i,t.defaults))}),n.options){var r;n.options.hasOwnProperty(e)&&(void 0!==(r=this.modifyOption(n,e,n.options[e]))&&(n.options[e]=r))}},getEventProperties:function(e,n){var o={};return N.forEach(function(t){"function"==typeof t.eventProperties&&a(o,t.eventProperties.call(n[t.pluginName],e))}),o},modifyOption:function(e,n,o){var i;return N.forEach(function(t){e[t.pluginName]&&t.optionListeners&&"function"==typeof t.optionListeners[n]&&(i=t.optionListeners[n].call(e[t.pluginName],o))}),i}};function G(t){var e=t.sortable,n=t.rootEl,o=t.name,i=t.targetEl,r=t.cloneEl,a=t.toEl,l=t.fromEl,s=t.oldIndex,c=t.newIndex,u=t.oldDraggableIndex,d=t.newDraggableIndex,h=t.originalEvent,p=t.putSortable,f=t.extraEventProperties;if(e=e||n&&n[K]){var g,m=e.options,t="on"+o.charAt(0).toUpperCase()+o.substr(1);!window.CustomEvent||y||w?(g=document.createEvent("Event")).initEvent(o,!0,!0):g=new CustomEvent(o,{bubbles:!0,cancelable:!0}),g.to=a||n,g.from=l||n,g.item=i||n,g.clone=r,g.oldIndex=s,g.newIndex=c,g.oldDraggableIndex=u,g.newDraggableIndex=d,g.originalEvent=h,g.pullMode=p?p.lastPutMode:void 0;var v,b=I(I({},f),z.getEventProperties(o,e));for(v in b)g[v]=b[v];n&&n.dispatchEvent(g),m[t]&&m[t].call(e,g)}}function U(t,e){var n=(o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{}).evt,o=i(o,q);z.pluginEvent.bind(jt)(t,e,I({dragEl:Z,parentEl:$,ghostEl:Q,rootEl:J,nextEl:tt,lastDownEl:et,cloneEl:nt,cloneHidden:ot,dragStarted:mt,putSortable:ct,activeSortable:jt.active,originalEvent:n,oldIndex:it,oldDraggableIndex:at,newIndex:rt,newDraggableIndex:lt,hideGhostForTarget:Xt,unhideGhostForTarget:Yt,cloneNowHidden:function(){ot=!0},cloneNowShown:function(){ot=!1},dispatchSortableEvent:function(t){V({sortable:e,name:t,originalEvent:n})}},o))}var q=["evt"];function V(t){G(I({putSortable:ct,cloneEl:nt,targetEl:Z,rootEl:J,oldIndex:it,oldDraggableIndex:at,newIndex:rt,newDraggableIndex:lt},t))}var Z,$,Q,J,tt,et,nt,ot,it,rt,at,lt,st,ct,ut,dt,ht,pt,ft,gt,mt,vt,bt,yt,wt,Dt=!1,Et=!1,St=[],_t=!1,Ct=!1,Tt=[],xt=!1,Ot=[],Mt="undefined"!=typeof document,At=c,Nt=w||y?"cssFloat":"float",It=Mt&&!n&&!c&&"draggable"in document.createElement("div"),Pt=function(){if(Mt){if(y)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),kt=function(t,e){var n=R(t),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=B(t,0,e),r=B(t,1,e),a=i&&R(i),l=r&&R(r),s=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+X(i).width,t=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+X(r).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&a.float&&"none"!==a.float){e="left"===a.float?"left":"right";return!r||"both"!==l.clear&&l.clear!==e?"horizontal":"vertical"}return i&&("block"===a.display||"flex"===a.display||"table"===a.display||"grid"===a.display||o<=s&&"none"===n[Nt]||r&&"none"===n[Nt]&&o<s+t)?"vertical":"horizontal"},Rt=function(t){function l(r,a){return function(t,e,n,o){var i=t.options.group.name&&e.options.group.name&&t.options.group.name===e.options.group.name;if(null==r&&(a||i))return!0;if(null==r||!1===r)return!1;if(a&&"clone"===r)return r;if("function"==typeof r)return l(r(t,e,n,o),a)(t,e,n,o);e=(a?t:e).options.group.name;return!0===r||"string"==typeof r&&r===e||r.join&&-1<r.indexOf(e)}}var e={},n=t.group;n&&"object"==o(n)||(n={name:n}),e.name=n.name,e.checkPull=l(n.pull,!0),e.checkPut=l(n.put),e.revertClone=n.revertClone,t.group=e},Xt=function(){!Pt&&Q&&R(Q,"display","none")},Yt=function(){!Pt&&Q&&R(Q,"display","")};Mt&&!n&&document.addEventListener("click",function(t){if(Et)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),Et=!1},!0);function Bt(t){if(Z){t=t.touches?t.touches[0]:t;var e=(i=t.clientX,r=t.clientY,St.some(function(t){var e=t[K].options.emptyInsertThreshold;if(e&&!F(t)){var n=X(t),o=i>=n.left-e&&i<=n.right+e,e=r>=n.top-e&&r<=n.bottom+e;return o&&e?a=t:void 0}}),a);if(e){var n,o={};for(n in t)t.hasOwnProperty(n)&&(o[n]=t[n]);o.target=o.rootEl=e,o.preventDefault=void 0,o.stopPropagation=void 0,e[K]._onDragOver(o)}}var i,r,a}function Ft(t){Z&&Z.parentNode[K]._isOutsideThisEl(t.target)}function jt(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=a({},e),t[K]=this;var n,o,i={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return kt(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==jt.supportPointer&&"PointerEvent"in window&&(!u||c),emptyInsertThreshold:5};for(n in z.initializePlugins(this,t,i),i)n in e||(e[n]=i[n]);for(o in Rt(e),this)"_"===o.charAt(0)&&"function"==typeof this[o]&&(this[o]=this[o].bind(this));this.nativeDraggable=!e.forceFallback&&It,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?h(t,"pointerdown",this._onTapStart):(h(t,"mousedown",this._onTapStart),h(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(h(t,"dragover",this),h(t,"dragenter",this)),St.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),a(this,A())}function Ht(t,e,n,o,i,r,a,l){var s,c,u=t[K],d=u.options.onMove;return!window.CustomEvent||y||w?(s=document.createEvent("Event")).initEvent("move",!0,!0):s=new CustomEvent("move",{bubbles:!0,cancelable:!0}),s.to=e,s.from=t,s.dragged=n,s.draggedRect=o,s.related=i||e,s.relatedRect=r||X(e),s.willInsertAfter=l,s.originalEvent=a,t.dispatchEvent(s),c=d?d.call(u,s,a):c}function Lt(t){t.draggable=!1}function Kt(){xt=!1}function Wt(t){return setTimeout(t,0)}function zt(t){return clearTimeout(t)}jt.prototype={constructor:jt,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(vt=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,Z):this.options.direction},_onTapStart:function(e){if(e.cancelable){var n=this,o=this.el,t=this.options,i=t.preventOnFilter,r=e.type,a=e.touches&&e.touches[0]||e.pointerType&&"touch"===e.pointerType&&e,l=(a||e).target,s=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||l,c=t.filter;if(!function(t){Ot.length=0;var e=t.getElementsByTagName("input"),n=e.length;for(;n--;){var o=e[n];o.checked&&Ot.push(o)}}(o),!Z&&!(/mousedown|pointerdown/.test(r)&&0!==e.button||t.disabled)&&!s.isContentEditable&&(this.nativeDraggable||!u||!l||"SELECT"!==l.tagName.toUpperCase())&&!((l=P(l,t.draggable,o,!1))&&l.animated||et===l)){if(it=j(l),at=j(l,t.draggable),"function"==typeof c){if(c.call(this,e,l,this))return V({sortable:n,rootEl:s,name:"filter",targetEl:l,toEl:o,fromEl:o}),U("filter",n,{evt:e}),void(i&&e.preventDefault())}else if(c=c&&c.split(",").some(function(t){if(t=P(s,t.trim(),o,!1))return V({sortable:n,rootEl:t,name:"filter",targetEl:l,fromEl:o,toEl:o}),U("filter",n,{evt:e}),!0}))return void(i&&e.preventDefault());t.handle&&!P(s,t.handle,o,!1)||this._prepareDragStart(e,a,l)}}},_prepareDragStart:function(t,e,n){var o,i=this,r=i.el,a=i.options,l=r.ownerDocument;n&&!Z&&n.parentNode===r&&(o=X(n),J=r,$=(Z=n).parentNode,tt=Z.nextSibling,et=n,st=a.group,ut={target:jt.dragged=Z,clientX:(e||t).clientX,clientY:(e||t).clientY},ft=ut.clientX-o.left,gt=ut.clientY-o.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,Z.style["will-change"]="all",o=function(){U("delayEnded",i,{evt:t}),jt.eventCanceled?i._onDrop():(i._disableDelayedDragEvents(),!s&&i.nativeDraggable&&(Z.draggable=!0),i._triggerDragStart(t,e),V({sortable:i,name:"choose",originalEvent:t}),k(Z,a.chosenClass,!0))},a.ignore.split(",").forEach(function(t){D(Z,t.trim(),Lt)}),h(l,"dragover",Bt),h(l,"mousemove",Bt),h(l,"touchmove",Bt),a.supportPointer?(h(l,"pointerup",i._onDrop),this.nativeDraggable||h(l,"pointercancel",i._onDrop)):(h(l,"mouseup",i._onDrop),h(l,"touchend",i._onDrop),h(l,"touchcancel",i._onDrop)),s&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Z.draggable=!0),U("delayStart",this,{evt:t}),!a.delay||a.delayOnTouchOnly&&!e||this.nativeDraggable&&(w||y)?o():jt.eventCanceled?this._onDrop():(a.supportPointer?(h(l,"pointerup",i._disableDelayedDrag),h(l,"pointercancel",i._disableDelayedDrag)):(h(l,"mouseup",i._disableDelayedDrag),h(l,"touchend",i._disableDelayedDrag),h(l,"touchcancel",i._disableDelayedDrag)),h(l,"mousemove",i._delayedDragTouchMoveHandler),h(l,"touchmove",i._delayedDragTouchMoveHandler),a.supportPointer&&h(l,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(o,a.delay)))},_delayedDragTouchMoveHandler:function(t){t=t.touches?t.touches[0]:t;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){Z&&Lt(Z),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;p(t,"mouseup",this._disableDelayedDrag),p(t,"touchend",this._disableDelayedDrag),p(t,"touchcancel",this._disableDelayedDrag),p(t,"pointerup",this._disableDelayedDrag),p(t,"pointercancel",this._disableDelayedDrag),p(t,"mousemove",this._delayedDragTouchMoveHandler),p(t,"touchmove",this._delayedDragTouchMoveHandler),p(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?h(document,"pointermove",this._onTouchMove):h(document,e?"touchmove":"mousemove",this._onTouchMove):(h(Z,"dragend",this),h(J,"dragstart",this._onDragStart));try{document.selection?Wt(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(t,e){var n;Dt=!1,J&&Z?(U("dragStarted",this,{evt:e}),this.nativeDraggable&&h(document,"dragover",Ft),n=this.options,t||k(Z,n.dragClass,!1),k(Z,n.ghostClass,!0),jt.active=this,t&&this._appendGhost(),V({sortable:this,name:"start",originalEvent:e})):this._nulling()},_emulateDragOver:function(){if(dt){this._lastX=dt.clientX,this._lastY=dt.clientY,Xt();for(var t=document.elementFromPoint(dt.clientX,dt.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(dt.clientX,dt.clientY))!==e;)e=t;if(Z.parentNode[K]._isOutsideThisEl(t),e)do{if(e[K])if(e[K]._onDragOver({clientX:dt.clientX,clientY:dt.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}while(e=g(t=e));Yt()}},_onTouchMove:function(t){if(ut){var e=this.options,n=e.fallbackTolerance,o=e.fallbackOffset,i=t.touches?t.touches[0]:t,r=Q&&b(Q,!0),a=Q&&r&&r.a,l=Q&&r&&r.d,e=At&&wt&&E(wt),a=(i.clientX-ut.clientX+o.x)/(a||1)+(e?e[0]-Tt[0]:0)/(a||1),l=(i.clientY-ut.clientY+o.y)/(l||1)+(e?e[1]-Tt[1]:0)/(l||1);if(!jt.active&&!Dt){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<n)return;this._onDragStart(t,!0)}Q&&(r?(r.e+=a-(ht||0),r.f+=l-(pt||0)):r={a:1,b:0,c:0,d:1,e:a,f:l},r="matrix(".concat(r.a,",").concat(r.b,",").concat(r.c,",").concat(r.d,",").concat(r.e,",").concat(r.f,")"),R(Q,"webkitTransform",r),R(Q,"mozTransform",r),R(Q,"msTransform",r),R(Q,"transform",r),ht=a,pt=l,dt=i),t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!Q){var t=this.options.fallbackOnBody?document.body:J,e=X(Z,!0,At,!0,t),n=this.options;if(At){for(wt=t;"static"===R(wt,"position")&&"none"===R(wt,"transform")&&wt!==document;)wt=wt.parentNode;wt!==document.body&&wt!==document.documentElement?(wt===document&&(wt=O()),e.top+=wt.scrollTop,e.left+=wt.scrollLeft):wt=O(),Tt=E(wt)}k(Q=Z.cloneNode(!0),n.ghostClass,!1),k(Q,n.fallbackClass,!0),k(Q,n.dragClass,!0),R(Q,"transition",""),R(Q,"transform",""),R(Q,"box-sizing","border-box"),R(Q,"margin",0),R(Q,"top",e.top),R(Q,"left",e.left),R(Q,"width",e.width),R(Q,"height",e.height),R(Q,"opacity","0.8"),R(Q,"position",At?"absolute":"fixed"),R(Q,"zIndex","100000"),R(Q,"pointerEvents","none"),jt.ghost=Q,t.appendChild(Q),R(Q,"transform-origin",ft/parseInt(Q.style.width)*100+"% "+gt/parseInt(Q.style.height)*100+"%")}},_onDragStart:function(t,e){var n=this,o=t.dataTransfer,i=n.options;U("dragStart",this,{evt:t}),jt.eventCanceled?this._onDrop():(U("setupClone",this),jt.eventCanceled||((nt=C(Z)).removeAttribute("id"),nt.draggable=!1,nt.style["will-change"]="",this._hideClone(),k(nt,this.options.chosenClass,!1),jt.clone=nt),n.cloneId=Wt(function(){U("clone",n),jt.eventCanceled||(n.options.removeCloneOnHide||J.insertBefore(nt,Z),n._hideClone(),V({sortable:n,name:"clone"}))}),e||k(Z,i.dragClass,!0),e?(Et=!0,n._loopId=setInterval(n._emulateDragOver,50)):(p(document,"mouseup",n._onDrop),p(document,"touchend",n._onDrop),p(document,"touchcancel",n._onDrop),o&&(o.effectAllowed="move",i.setData&&i.setData.call(n,o,Z)),h(document,"drop",n),R(Z,"transform","translateZ(0)")),Dt=!0,n._dragStartId=Wt(n._dragStarted.bind(n,e,t)),h(document,"selectstart",n),mt=!0,window.getSelection().removeAllRanges(),u&&R(document.body,"user-select","none"))},_onDragOver:function(n){var o,i,r,t,e,a=this.el,l=n.target,s=this.options,c=s.group,u=jt.active,d=st===c,h=s.sort,p=ct||u,f=this,g=!1;if(!xt){if(void 0!==n.preventDefault&&n.cancelable&&n.preventDefault(),l=P(l,s.draggable,a,!0),O("dragOver"),jt.eventCanceled)return g;if(Z.contains(n.target)||l.animated&&l.animatingX&&l.animatingY||f._ignoreWhileAnimating===l)return A(!1);if(Et=!1,u&&!s.disabled&&(d?h||(i=$!==J):ct===this||(this.lastPutMode=st.checkPull(this,u,Z,n))&&c.checkPut(this,u,Z,n))){if(r="vertical"===this._getDirection(n,l),o=X(Z),O("dragOverValid"),jt.eventCanceled)return g;if(i)return $=J,M(),this._hideClone(),O("revert"),jt.eventCanceled||(tt?J.insertBefore(Z,tt):J.appendChild(Z)),A(!0);var m=F(a,s.draggable);if(m&&(S=n,c=r,x=X(F((E=this).el,E.options.draggable)),E=L(E.el,E.options,Q),!(c?S.clientX>E.right+10||S.clientY>x.bottom&&S.clientX>x.left:S.clientY>E.bottom+10||S.clientX>x.right&&S.clientY>x.top)||m.animated)){if(m&&(t=n,e=r,C=X(B((_=this).el,0,_.options,!0)),_=L(_.el,_.options,Q),e?t.clientX<_.left-10||t.clientY<C.top&&t.clientX<C.right:t.clientY<_.top-10||t.clientY<C.bottom&&t.clientX<C.left)){var v=B(a,0,s,!0);if(v===Z)return A(!1);if(D=X(l=v),!1!==Ht(J,a,Z,o,l,D,n,!1))return M(),a.insertBefore(Z,v),$=a,N(),A(!0)}else if(l.parentNode===a){var b,y,w,D=X(l),E=Z.parentNode!==a,S=(S=Z.animated&&Z.toRect||o,x=l.animated&&l.toRect||D,_=(e=r)?S.left:S.top,t=e?S.right:S.bottom,C=e?S.width:S.height,v=e?x.left:x.top,S=e?x.right:x.bottom,x=e?x.width:x.height,!(_===v||t===S||_+C/2===v+x/2)),_=r?"top":"left",C=Y(l,"top","top")||Y(Z,"top","top"),v=C?C.scrollTop:void 0;if(vt!==l&&(y=D[_],_t=!1,Ct=!S&&s.invertSwap||E),0!==(b=function(t,e,n,o,i,r,a,l){var s=o?t.clientY:t.clientX,c=o?n.height:n.width,t=o?n.top:n.left,o=o?n.bottom:n.right,n=!1;if(!a)if(l&&yt<c*i){if(_t=!_t&&(1===bt?t+c*r/2<s:s<o-c*r/2)?!0:_t)n=!0;else if(1===bt?s<t+yt:o-yt<s)return-bt}else if(t+c*(1-i)/2<s&&s<o-c*(1-i)/2)return function(t){return j(Z)<j(t)?1:-1}(e);if((n=n||a)&&(s<t+c*r/2||o-c*r/2<s))return t+c/2<s?1:-1;return 0}(n,l,D,r,S?1:s.swapThreshold,null==s.invertedSwapThreshold?s.swapThreshold:s.invertedSwapThreshold,Ct,vt===l)))for(var T=j(Z);(w=$.children[T-=b])&&("none"===R(w,"display")||w===Q););if(0===b||w===l)return A(!1);bt=b;var x=(vt=l).nextElementSibling,E=!1,S=Ht(J,a,Z,o,l,D,n,E=1===b);if(!1!==S)return 1!==S&&-1!==S||(E=1===S),xt=!0,setTimeout(Kt,30),M(),E&&!x?a.appendChild(Z):l.parentNode.insertBefore(Z,E?x:l),C&&H(C,0,v-C.scrollTop),$=Z.parentNode,void 0===y||Ct||(yt=Math.abs(y-X(l)[_])),N(),A(!0)}}else{if(m===Z)return A(!1);if((l=m&&a===n.target?m:l)&&(D=X(l)),!1!==Ht(J,a,Z,o,l,D,n,!!l))return M(),m&&m.nextSibling?a.insertBefore(Z,m.nextSibling):a.appendChild(Z),$=a,N(),A(!0)}if(a.contains(Z))return A(!1)}return!1}function O(t,e){U(t,f,I({evt:n,isOwner:d,axis:r?"vertical":"horizontal",revert:i,dragRect:o,targetRect:D,canSort:h,fromSortable:p,target:l,completed:A,onMove:function(t,e){return Ht(J,a,Z,o,t,X(t),n,e)},changed:N},e))}function M(){O("dragOverAnimationCapture"),f.captureAnimationState(),f!==p&&p.captureAnimationState()}function A(t){return O("dragOverCompleted",{insertion:t}),t&&(d?u._hideClone():u._showClone(f),f!==p&&(k(Z,(ct||u).options.ghostClass,!1),k(Z,s.ghostClass,!0)),ct!==f&&f!==jt.active?ct=f:f===jt.active&&ct&&(ct=null),p===f&&(f._ignoreWhileAnimating=l),f.animateAll(function(){O("dragOverAnimationComplete"),f._ignoreWhileAnimating=null}),f!==p&&(p.animateAll(),p._ignoreWhileAnimating=null)),(l===Z&&!Z.animated||l===a&&!l.animated)&&(vt=null),s.dragoverBubble||n.rootEl||l===document||(Z.parentNode[K]._isOutsideThisEl(n.target),t||Bt(n)),!s.dragoverBubble&&n.stopPropagation&&n.stopPropagation(),g=!0}function N(){rt=j(Z),lt=j(Z,s.draggable),V({sortable:f,name:"change",toEl:a,newIndex:rt,newDraggableIndex:lt,originalEvent:n})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){p(document,"mousemove",this._onTouchMove),p(document,"touchmove",this._onTouchMove),p(document,"pointermove",this._onTouchMove),p(document,"dragover",Bt),p(document,"mousemove",Bt),p(document,"touchmove",Bt)},_offUpEvents:function(){var t=this.el.ownerDocument;p(t,"mouseup",this._onDrop),p(t,"touchend",this._onDrop),p(t,"pointerup",this._onDrop),p(t,"pointercancel",this._onDrop),p(t,"touchcancel",this._onDrop),p(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;rt=j(Z),lt=j(Z,n.draggable),U("drop",this,{evt:t}),$=Z&&Z.parentNode,rt=j(Z),lt=j(Z,n.draggable),jt.eventCanceled||(_t=Ct=Dt=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),zt(this.cloneId),zt(this._dragStartId),this.nativeDraggable&&(p(document,"drop",this),p(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),u&&R(document.body,"user-select",""),R(Z,"transform",""),t&&(mt&&(t.cancelable&&t.preventDefault(),n.dropBubble||t.stopPropagation()),Q&&Q.parentNode&&Q.parentNode.removeChild(Q),(J===$||ct&&"clone"!==ct.lastPutMode)&&nt&&nt.parentNode&&nt.parentNode.removeChild(nt),Z&&(this.nativeDraggable&&p(Z,"dragend",this),Lt(Z),Z.style["will-change"]="",mt&&!Dt&&k(Z,(ct||this).options.ghostClass,!1),k(Z,this.options.chosenClass,!1),V({sortable:this,name:"unchoose",toEl:$,newIndex:null,newDraggableIndex:null,originalEvent:t}),J!==$?(0<=rt&&(V({rootEl:$,name:"add",toEl:$,fromEl:J,originalEvent:t}),V({sortable:this,name:"remove",toEl:$,originalEvent:t}),V({rootEl:$,name:"sort",toEl:$,fromEl:J,originalEvent:t}),V({sortable:this,name:"sort",toEl:$,originalEvent:t})),ct&&ct.save()):rt!==it&&0<=rt&&(V({sortable:this,name:"update",toEl:$,originalEvent:t}),V({sortable:this,name:"sort",toEl:$,originalEvent:t})),jt.active&&(null!=rt&&-1!==rt||(rt=it,lt=at),V({sortable:this,name:"end",toEl:$,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){U("nulling",this),J=Z=$=Q=tt=nt=et=ot=ut=dt=mt=rt=lt=it=at=vt=bt=ct=st=jt.dragged=jt.ghost=jt.clone=jt.active=null,Ot.forEach(function(t){t.checked=!0}),Ot.length=ht=pt=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":Z&&(this._onDragOver(t),function(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move");t.cancelable&&t.preventDefault()}(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,e=[],n=this.el.children,o=0,i=n.length,r=this.options;o<i;o++)P(t=n[o],r.draggable,this.el,!1)&&e.push(t.getAttribute(r.dataIdAttr)||function(t){var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,o=0;for(;n--;)o+=e.charCodeAt(n);return o.toString(36)}(t));return e},sort:function(t,e){var n={},o=this.el;this.toArray().forEach(function(t,e){e=o.children[e];P(e,this.options.draggable,o,!1)&&(n[t]=e)},this),e&&this.captureAnimationState(),t.forEach(function(t){n[t]&&(o.removeChild(n[t]),o.appendChild(n[t]))}),e&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,e){return P(t,e||this.options.draggable,this.el,!1)},option:function(t,e){var n=this.options;if(void 0===e)return n[t];var o=z.modifyOption(this,t,e);n[t]=void 0!==o?o:e,"group"===t&&Rt(n)},destroy:function(){U("destroy",this);var t=this.el;t[K]=null,p(t,"mousedown",this._onTapStart),p(t,"touchstart",this._onTapStart),p(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(p(t,"dragover",this),p(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(t){t.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),St.splice(St.indexOf(this.el),1),this.el=t=null},_hideClone:function(){ot||(U("hideClone",this),jt.eventCanceled||(R(nt,"display","none"),this.options.removeCloneOnHide&&nt.parentNode&&nt.parentNode.removeChild(nt),ot=!0))},_showClone:function(t){"clone"===t.lastPutMode?ot&&(U("showClone",this),jt.eventCanceled||(Z.parentNode!=J||this.options.group.revertClone?tt?J.insertBefore(nt,tt):J.appendChild(nt):J.insertBefore(nt,Z),this.options.group.revertClone&&this.animate(Z,nt),R(nt,"display",""),ot=!1)):this._hideClone()}},Mt&&h(document,"touchmove",function(t){(jt.active||Dt)&&t.cancelable&&t.preventDefault()}),jt.utils={on:h,off:p,css:R,find:D,is:function(t,e){return!!P(t,e,t,!1)},extend:function(t,e){if(t&&e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t},throttle:_,closest:P,toggleClass:k,clone:C,index:j,nextTick:Wt,cancelNextTick:zt,detectDirection:kt,getChild:B,expando:K},jt.get=function(t){return t[K]},jt.mount=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];(e=e[0].constructor===Array?e[0]:e).forEach(function(t){if(!t.prototype||!t.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(t));t.utils&&(jt.utils=I(I({},jt.utils),t.utils)),z.mount(t)})},jt.create=function(t,e){return new jt(t,e)};var Gt,Ut,qt,Vt,Zt,$t,Qt=[],Jt=!(jt.version="1.15.6");function te(){Qt.forEach(function(t){clearInterval(t.pid)}),Qt=[]}function ee(){clearInterval($t)}var ne,oe=_(function(n,t,e,o){if(t.scroll){var i,r=(n.touches?n.touches[0]:n).clientX,a=(n.touches?n.touches[0]:n).clientY,l=t.scrollSensitivity,s=t.scrollSpeed,c=O(),u=!1;Ut!==e&&(Ut=e,te(),Gt=t.scroll,i=t.scrollFn,!0===Gt&&(Gt=M(e,!0)));var d=0,h=Gt;do{var p=h,f=X(p),g=f.top,m=f.bottom,v=f.left,b=f.right,y=f.width,w=f.height,D=void 0,E=void 0,S=p.scrollWidth,_=p.scrollHeight,C=R(p),T=p.scrollLeft,f=p.scrollTop,E=p===c?(D=y<S&&("auto"===C.overflowX||"scroll"===C.overflowX||"visible"===C.overflowX),w<_&&("auto"===C.overflowY||"scroll"===C.overflowY||"visible"===C.overflowY)):(D=y<S&&("auto"===C.overflowX||"scroll"===C.overflowX),w<_&&("auto"===C.overflowY||"scroll"===C.overflowY)),T=D&&(Math.abs(b-r)<=l&&T+y<S)-(Math.abs(v-r)<=l&&!!T),f=E&&(Math.abs(m-a)<=l&&f+w<_)-(Math.abs(g-a)<=l&&!!f);if(!Qt[d])for(var x=0;x<=d;x++)Qt[x]||(Qt[x]={});Qt[d].vx==T&&Qt[d].vy==f&&Qt[d].el===p||(Qt[d].el=p,Qt[d].vx=T,Qt[d].vy=f,clearInterval(Qt[d].pid),0==T&&0==f||(u=!0,Qt[d].pid=setInterval(function(){o&&0===this.layer&&jt.active._onTouchMove(Zt);var t=Qt[this.layer].vy?Qt[this.layer].vy*s:0,e=Qt[this.layer].vx?Qt[this.layer].vx*s:0;"function"==typeof i&&"continue"!==i.call(jt.dragged.parentNode[K],e,t,n,Zt,Qt[this.layer].el)||H(Qt[this.layer].el,e,t)}.bind({layer:d}),24))),d++}while(t.bubbleScroll&&h!==c&&(h=M(h,!1)));Jt=u}},30),n=function(t){var e=t.originalEvent,n=t.putSortable,o=t.dragEl,i=t.activeSortable,r=t.dispatchSortableEvent,a=t.hideGhostForTarget,t=t.unhideGhostForTarget;e&&(i=n||i,a(),e=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e,e=document.elementFromPoint(e.clientX,e.clientY),t(),i&&!i.el.contains(e)&&(r("spill"),this.onSpill({dragEl:o,putSortable:n})))};function ie(){}function re(){}ie.prototype={startIndex:null,dragStart:function(t){t=t.oldDraggableIndex;this.startIndex=t},onSpill:function(t){var e=t.dragEl,n=t.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();t=B(this.sortable.el,this.startIndex,this.options);t?this.sortable.el.insertBefore(e,t):this.sortable.el.appendChild(e),this.sortable.animateAll(),n&&n.animateAll()},drop:n},a(ie,{pluginName:"revertOnSpill"}),re.prototype={onSpill:function(t){var e=t.dragEl,t=t.putSortable||this.sortable;t.captureAnimationState(),e.parentNode&&e.parentNode.removeChild(e),t.animateAll()},drop:n},a(re,{pluginName:"removeOnSpill"});var ae,le,se,ce,ue,de=[],he=[],pe=!1,fe=!1,ge=!1;function me(n,o){he.forEach(function(t,e){e=o.children[t.sortableIndex+(n?Number(e):0)];e?o.insertBefore(t,e):o.appendChild(t)})}function ve(){de.forEach(function(t){t!==se&&t.parentNode&&t.parentNode.removeChild(t)})}return jt.mount(new function(){function t(){for(var t in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===t.charAt(0)&&"function"==typeof this[t]&&(this[t]=this[t].bind(this))}return t.prototype={dragStarted:function(t){t=t.originalEvent;this.sortable.nativeDraggable?h(document,"dragover",this._handleAutoScroll):this.options.supportPointer?h(document,"pointermove",this._handleFallbackAutoScroll):t.touches?h(document,"touchmove",this._handleFallbackAutoScroll):h(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){t=t.originalEvent;this.options.dragOverBubble||t.rootEl||this._handleAutoScroll(t)},drop:function(){this.sortable.nativeDraggable?p(document,"dragover",this._handleAutoScroll):(p(document,"pointermove",this._handleFallbackAutoScroll),p(document,"touchmove",this._handleFallbackAutoScroll),p(document,"mousemove",this._handleFallbackAutoScroll)),ee(),te(),clearTimeout(m),m=void 0},nulling:function(){Zt=Ut=Gt=Jt=$t=qt=Vt=null,Qt.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(e,n){var o,i=this,r=(e.touches?e.touches[0]:e).clientX,a=(e.touches?e.touches[0]:e).clientY,t=document.elementFromPoint(r,a);Zt=e,n||this.options.forceAutoScrollFallback||w||y||u?(oe(e,this.options,t,n),o=M(t,!0),!Jt||$t&&r===qt&&a===Vt||($t&&ee(),$t=setInterval(function(){var t=M(document.elementFromPoint(r,a),!0);t!==o&&(o=t,te()),oe(e,i.options,t,n)},10),qt=r,Vt=a)):this.options.bubbleScroll&&M(t,!0)!==O()?oe(e,this.options,M(t,!1),!1):te()}},a(t,{pluginName:"scroll",initializeByDefault:!0})}),jt.mount(re,ie),jt.mount(new function(){function t(){this.defaults={swapClass:"sortable-swap-highlight"}}return t.prototype={dragStart:function(t){t=t.dragEl;ne=t},dragOverValid:function(t){var e=t.completed,n=t.target,o=t.onMove,i=t.activeSortable,r=t.changed,a=t.cancel;i.options.swap&&(t=this.sortable.el,i=this.options,n&&n!==t&&(t=ne,ne=!1!==o(n)?(k(n,i.swapClass,!0),n):null,t&&t!==ne&&k(t,i.swapClass,!1)),r(),e(!0),a())},drop:function(t){var e,n,o=t.activeSortable,i=t.putSortable,r=t.dragEl,a=i||this.sortable,l=this.options;ne&&k(ne,l.swapClass,!1),ne&&(l.swap||i&&i.options.swap)&&r!==ne&&(a.captureAnimationState(),a!==o&&o.captureAnimationState(),n=ne,t=(e=r).parentNode,l=n.parentNode,t&&l&&!t.isEqualNode(n)&&!l.isEqualNode(e)&&(i=j(e),r=j(n),t.isEqualNode(l)&&i<r&&r++,t.insertBefore(n,t.children[i]),l.insertBefore(e,l.children[r])),a.animateAll(),a!==o&&o.animateAll())},nulling:function(){ne=null}},a(t,{pluginName:"swap",eventProperties:function(){return{swapItem:ne}}})}),jt.mount(new function(){function t(o){for(var t in this)"_"===t.charAt(0)&&"function"==typeof this[t]&&(this[t]=this[t].bind(this));o.options.avoidImplicitDeselect||(o.options.supportPointer?h(document,"pointerup",this._deselectMultiDrag):(h(document,"mouseup",this._deselectMultiDrag),h(document,"touchend",this._deselectMultiDrag))),h(document,"keydown",this._checkKeyDown),h(document,"keyup",this._checkKeyUp),this.defaults={selectedClass:"sortable-selected",multiDragKey:null,avoidImplicitDeselect:!1,setData:function(t,e){var n="";de.length&&le===o?de.forEach(function(t,e){n+=(e?", ":"")+t.textContent}):n=e.textContent,t.setData("Text",n)}}}return t.prototype={multiDragKeyDown:!1,isMultiDrag:!1,delayStartGlobal:function(t){t=t.dragEl;se=t},delayEnded:function(){this.isMultiDrag=~de.indexOf(se)},setupClone:function(t){var e=t.sortable,t=t.cancel;if(this.isMultiDrag){for(var n=0;n<de.length;n++)he.push(C(de[n])),he[n].sortableIndex=de[n].sortableIndex,he[n].draggable=!1,he[n].style["will-change"]="",k(he[n],this.options.selectedClass,!1),de[n]===se&&k(he[n],this.options.chosenClass,!1);e._hideClone(),t()}},clone:function(t){var e=t.sortable,n=t.rootEl,o=t.dispatchSortableEvent,t=t.cancel;this.isMultiDrag&&(this.options.removeCloneOnHide||de.length&&le===e&&(me(!0,n),o("clone"),t()))},showClone:function(t){var e=t.cloneNowShown,n=t.rootEl,t=t.cancel;this.isMultiDrag&&(me(!1,n),he.forEach(function(t){R(t,"display","")}),e(),ue=!1,t())},hideClone:function(t){var e=this,n=(t.sortable,t.cloneNowHidden),t=t.cancel;this.isMultiDrag&&(he.forEach(function(t){R(t,"display","none"),e.options.removeCloneOnHide&&t.parentNode&&t.parentNode.removeChild(t)}),n(),ue=!0,t())},dragStartGlobal:function(t){t.sortable;!this.isMultiDrag&&le&&le.multiDrag._deselectMultiDrag(),de.forEach(function(t){t.sortableIndex=j(t)}),de=de.sort(function(t,e){return t.sortableIndex-e.sortableIndex}),ge=!0},dragStarted:function(t){var e,n=this,t=t.sortable;this.isMultiDrag&&(this.options.sort&&(t.captureAnimationState(),this.options.animation&&(de.forEach(function(t){t!==se&&R(t,"position","absolute")}),e=X(se,!1,!0,!0),de.forEach(function(t){t!==se&&T(t,e)}),pe=fe=!0)),t.animateAll(function(){pe=fe=!1,n.options.animation&&de.forEach(function(t){x(t)}),n.options.sort&&ve()}))},dragOver:function(t){var e=t.target,n=t.completed,t=t.cancel;fe&&~de.indexOf(e)&&(n(!1),t())},revert:function(t){var n,o,e=t.fromSortable,i=t.rootEl,r=t.sortable,a=t.dragRect;1<de.length&&(de.forEach(function(t){r.addAnimationState({target:t,rect:fe?X(t):a}),x(t),t.fromRect=a,e.removeAnimationState(t)}),fe=!1,n=!this.options.removeCloneOnHide,o=i,de.forEach(function(t,e){e=o.children[t.sortableIndex+(n?Number(e):0)];e?o.insertBefore(t,e):o.appendChild(t)}))},dragOverCompleted:function(t){var e,n=t.sortable,o=t.isOwner,i=t.insertion,r=t.activeSortable,a=t.parentEl,l=t.putSortable,t=this.options;i&&(o&&r._hideClone(),pe=!1,t.animation&&1<de.length&&(fe||!o&&!r.options.sort&&!l)&&(e=X(se,!1,!0,!0),de.forEach(function(t){t!==se&&(T(t,e),a.appendChild(t))}),fe=!0),o||(fe||ve(),1<de.length?(o=ue,r._showClone(n),r.options.animation&&!ue&&o&&he.forEach(function(t){r.addAnimationState({target:t,rect:ce}),t.fromRect=ce,t.thisAnimationDuration=null})):r._showClone(n)))},dragOverAnimationCapture:function(t){var e=t.dragRect,n=t.isOwner,t=t.activeSortable;de.forEach(function(t){t.thisAnimationDuration=null}),t.options.animation&&!n&&t.multiDrag.isMultiDrag&&(ce=a({},e),e=b(se,!0),ce.top-=e.f,ce.left-=e.e)},dragOverAnimationComplete:function(){fe&&(fe=!1,ve())},drop:function(t){var o,i,r,a,n,e,l,s=t.originalEvent,c=t.rootEl,u=t.parentEl,d=t.sortable,h=t.dispatchSortableEvent,p=t.oldIndex,t=t.putSortable,f=t||this.sortable;s&&(o=this.options,i=u.children,ge||(o.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),k(se,o.selectedClass,!~de.indexOf(se)),~de.indexOf(se)?(de.splice(de.indexOf(se),1),ae=null,G({sortable:d,rootEl:c,name:"deselect",targetEl:se,originalEvent:s})):(de.push(se),G({sortable:d,rootEl:c,name:"select",targetEl:se,originalEvent:s}),s.shiftKey&&ae&&d.el.contains(ae)?(r=j(ae),a=j(se),~r&&~a&&r!==a&&function(){for(var e,t=r<a?(e=r,a):(e=a,r+1),n=o.filter;e<t;e++)~de.indexOf(i[e])||P(i[e],o.draggable,u,!1)&&(n&&("function"==typeof n?n.call(d,s,i[e],d):n.split(",").some(function(t){return P(i[e],t.trim(),u,!1)}))||(k(i[e],o.selectedClass,!0),de.push(i[e]),G({sortable:d,rootEl:c,name:"select",targetEl:i[e],originalEvent:s})))}()):ae=se,le=f)),ge&&this.isMultiDrag&&(fe=!1,(u[K].options.sort||u!==c)&&1<de.length&&(n=X(se),e=j(se,":not(."+this.options.selectedClass+")"),!pe&&o.animation&&(se.thisAnimationDuration=null),f.captureAnimationState(),pe||(o.animation&&(se.fromRect=n,de.forEach(function(t){var e;t.thisAnimationDuration=null,t!==se&&(e=fe?X(t):n,t.fromRect=e,f.addAnimationState({target:t,rect:e}))})),ve(),de.forEach(function(t){i[e]?u.insertBefore(t,i[e]):u.appendChild(t),e++}),p===j(se)&&(l=!1,de.forEach(function(t){t.sortableIndex!==j(t)&&(l=!0)}),l&&(h("update"),h("sort")))),de.forEach(function(t){x(t)}),f.animateAll()),le=f),(c===u||t&&"clone"!==t.lastPutMode)&&he.forEach(function(t){t.parentNode&&t.parentNode.removeChild(t)}))},nullingGlobal:function(){this.isMultiDrag=ge=!1,he.length=0},destroyGlobal:function(){this._deselectMultiDrag(),p(document,"pointerup",this._deselectMultiDrag),p(document,"mouseup",this._deselectMultiDrag),p(document,"touchend",this._deselectMultiDrag),p(document,"keydown",this._checkKeyDown),p(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(t){if(!(void 0!==ge&&ge||le!==this.sortable||t&&P(t.target,this.options.draggable,this.sortable.el,!1)||t&&0!==t.button))for(;de.length;){var e=de[0];k(e,this.options.selectedClass,!1),de.shift(),G({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:e,originalEvent:t})}},_checkKeyDown:function(t){t.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp:function(t){t.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},a(t,{pluginName:"multiDrag",utils:{select:function(t){var e=t.parentNode[K];e&&e.options.multiDrag&&!~de.indexOf(t)&&(le&&le!==e&&(le.multiDrag._deselectMultiDrag(),le=e),k(t,e.options.selectedClass,!0),de.push(t))},deselect:function(t){var e=t.parentNode[K],n=de.indexOf(t);e&&e.options.multiDrag&&~n&&(k(t,e.options.selectedClass,!1),de.splice(n,1))}},eventProperties:function(){var n=this,o=[],i=[];return de.forEach(function(t){var e;o.push({multiDragElement:t,index:t.sortableIndex}),e=fe&&t!==se?-1:fe?j(t,":not(."+n.options.selectedClass+")"):j(t),i.push({multiDragElement:t,index:e})}),{items:r(de),clones:[].concat(he),oldIndicies:o,newIndicies:i}},optionListeners:{multiDragKey:function(t){return"ctrl"===(t=t.toLowerCase())?t="Control":1<t.length&&(t=t.charAt(0).toUpperCase()+t.substr(1)),t}}})}),jt});
9
+ (()=>{function _(i,s){return i?Array.prototype.slice.call(i.querySelectorAll(s)):[]}function z(i,s){return i?i.querySelector(s):null}function we(i,s){if(!i)return[];var f=_(i,s);return i.nodeType===1&&i.matches(s)&&f.unshift(i),f}function G(i,s){return i?Array.prototype.filter.call(i.children,function(f){return!s||f.matches(s)}):[]}function T(i,s){return G(i,s)[0]||null}function oe(i,s,f){var l=i&&i.nodeType===1?i.closest(s):null;return l&&f&&l!==f&&!f.contains(l)?null:l}function Me(i,s){return!!i&&i.nodeType===1&&i.matches(s)}function ct(i){return!!i&&document.documentElement.contains(i)}function Er(i,s){for(var f=[],l=i.nextElementSibling;l;l=l.nextElementSibling)(!s||l.matches(s))&&f.push(l);return f}function xr(i,s){for(var f=[],l=i.parentElement;l&&l!==s;l=l.parentElement)f.push(l);return f}function Ei(i){var s=document.createElement("template");return s.innerHTML=i,Array.prototype.slice.call(s.content.childNodes)}function q(i){for(var s=Ei(i.trim()),f=0;f<s.length;f++)if(s[f].nodeType===1)return s[f];return null}function v(i,s,f){var l=document.createElement(i);return Object.keys(s||{}).forEach(function(d){var E=s[d];E!=null&&E!==!1&&l.setAttribute(d,E)}),f!=null&&(l.textContent=f),l}function ft(i,s){return i.innerHTML=s==null?"":String(s),i}function k(i,s){return ze(s).forEach(function(f){i.classList.add(f)}),i}function O(i,s){return ze(s).forEach(function(f){i.classList.remove(f)}),i}function I(i,s,f){return ze(s).forEach(function(l){f===void 0?i.classList.toggle(l):i.classList.toggle(l,!!f)}),i}function y(i,s){return!!i&&i.nodeType===1&&i.classList.contains(s)}function ze(i){return String(i||"").split(/\s+/).filter(Boolean)}function mt(i){return i.getAttribute("class")||i.removeAttribute("class"),i}function pt(i){return i.getAttribute("style")||i.removeAttribute("style"),i}function gt(i,s){return Object.keys(s).forEach(function(f){var l=s[f];l==null?i.removeAttribute(f):i.setAttribute(f,l)}),i}function me(i,s){return Object.keys(s).forEach(function(f){var l=s[f];typeof l=="number"&&!xi[f]&&(l=l+"px"),i.style.setProperty(f,l==null?"":String(l))}),i}var xi={opacity:!0,"z-index":!0,"flex-grow":!0,"flex-shrink":!0,order:!0},qe={};function _i(i){var s=i.nodeName;if(!qe[s]){var f=document.body.appendChild(document.createElement(s));qe[s]=getComputedStyle(f).display,f.remove(),qe[s]==="none"&&(qe[s]="block")}return qe[s]}function Pe(i){return i.style.removeProperty("display"),getComputedStyle(i).display==="none"&&(i.style.display=_i(i)),i}function ye(i){return i.style.display="none",i}function ln(i,s){return s===void 0&&(s=!vt(i)),s?Pe(i):ye(i)}function vt(i){return!!(i.offsetWidth||i.offsetHeight||i.getClientRects().length)}function Xe(i){return i.getBoundingClientRect().width}function ht(i){return i.getBoundingClientRect().height}function _r(i){var s=getComputedStyle(i);return i.clientHeight-parseFloat(s.paddingTop)-parseFloat(s.paddingBottom)}function bt(i){var s=i.getBoundingClientRect();return{top:s.top+window.pageYOffset,left:s.left+window.pageXOffset}}function wt(i,s){return s.parentNode.insertBefore(i,s.nextSibling),i}function yt(i){for(var s=i.parentNode;i.firstChild;)s.insertBefore(i.firstChild,i);i.remove()}function kr(i,s){return i.parentNode.insertBefore(s,i),s.appendChild(i),s}function Ye(i,s,f,l,d){var E=function(b){var j=oe(b.target,f,i);if(j&&i.contains(j))return l.call(j,b)};return ze(s).forEach(function(b){i.addEventListener(b,E,d)}),E}function Q(i,s,f,l){return ze(s).forEach(function(d){i.addEventListener(d,f,l)}),f}function sn(i,s,f,l){ze(s).forEach(function(d){i.removeEventListener(d,f,l)})}var ki=400;function Ar(i,s,f,l){f=f===void 0?ki:f;var d=function(){ye(i),l&&l()};if(!vt(i)||!i.animate||f<=0){window.setTimeout(d,0);return}var E=i.animate(s(getComputedStyle(i)),{duration:f,easing:"ease-in-out"}),b=!1,j=function(){b||(b=!0,d())};E.onfinish=j,E.oncancel=j}function Je(i,s,f){typeof s=="function"&&(f=s,s=void 0),i.style.overflow="hidden",Ar(i,function(l){return[{height:l.height,paddingTop:l.paddingTop,paddingBottom:l.paddingBottom,marginTop:l.marginTop,marginBottom:l.marginBottom},{height:"0px",paddingTop:"0px",paddingBottom:"0px",marginTop:"0px",marginBottom:"0px"}]},s,function(){i.style.removeProperty("overflow"),f&&f()})}function Sr(i,s,f,l){i.style.overflow="hidden",Ar(i,function(d){var E={opacity:d.opacity,height:d.height},b={opacity:0,height:"0px"};return l&&(E.width=d.width,b.width="0px"),[E,b]},s,function(){i.style.removeProperty("overflow"),f&&f()})}var Tr={getHtml:{value:!0},getPlainHtml:{value:!0},init:{},deinit:{},reset:{},destroy:{},changeView:{},getView:{value:!0},createRow:{value:!0},createColumn:{value:!0},createElement:{value:!0},createText:{value:!0},createSection:{value:!0},createContainer:{value:!0},addTab:{value:!0},addAccordionItem:{value:!0},setLocale:{},getUtility:{value:!0},setUtility:{value:!0}},Si=["appendTo","prependTo","insertAfter","insertBefore"],h=[{key:"xs",infix:"",colPrefix:"col-",offsetPrefix:"offset-",min:0,preview:400,labelKey:"view.xs"},{key:"sm",infix:"sm",colPrefix:"col-sm-",offsetPrefix:"offset-sm-",min:576,preview:576,labelKey:"view.sm"},{key:"md",infix:"md",colPrefix:"col-md-",offsetPrefix:"offset-md-",min:768,preview:768,labelKey:"view.md"},{key:"lg",infix:"lg",colPrefix:"col-lg-",offsetPrefix:"offset-lg-",min:992,preview:992,labelKey:"view.lg"},{key:"xl",infix:"xl",colPrefix:"col-xl-",offsetPrefix:"offset-xl-",min:1200,preview:1200,labelKey:"view.xl"},{key:"xxl",infix:"xxl",colPrefix:"col-xxl-",offsetPrefix:"offset-xxl-",min:1400,preview:null,labelKey:"view.xxl"}],W="all",Ti="view.all",Ct=[W].concat(h.map(function(i){return i.key})),Or=["lg","sm","xs"],P=12,Lr=11,un=["equal","auto"],je=["1","2","3","4","5","6","auto"];function dn(i,s){return"row-cols"+(i.infix?"-"+i.infix:"")+"-"+s}function F(i){return typeof i=="number"}function Ce(i,s){return s==="equal"?i.infix?"col-"+i.infix:"col":i.colPrefix+s}function K(i){for(var s=0;s<h.length;s++)if(h[s].key===i)return h[s];return null}function Mr(i){if(i===W)return[h[0]];var s=K(i);return s?[s]:[]}function $e(i){var s=K(i);return s?s.labelKey:Ti}var Ie={add_column:{size:12,picker:!0,delay:600},elements:{enabled:"auto",selector:"[data-ge-element]",auto:!1},resize:{enabled:!0,handles:"e",balance:"next"},drag:{delay:0,touch_delay:100,threshold:3,animation:150,scroll:!0}},zr={sortable_options:"drag",resizable_options:"resize"},Pr={},Oi=0,xt=new WeakMap;function _t(i,s,f){var l=C.locales,d=l[i.locale]||{},E=i.locale_strings||{},b=E[s];return b===void 0&&(b=d[s]),b===void 0&&(b=l.en[s]),b===void 0&&(Li("locale:"+s,'no string for "'+s+'" in any locale, showing the key'),b=s),b.replace(/\{(\w+)\}/g,function(j,ge){return f&&f[ge]!==void 0?f[ge]:j})}function N(i){window.console&&window.console.warn&&window.console.warn("grid-editor: "+i)}function Li(i,s){Pr[i]||(Pr[i]=!0,N(s))}function Mi(i,s){return _t({locale:"en"},i,s)}function zi(i){if(typeof i=="string"){var s=document.querySelector(i);if(!s)throw new TypeError("grid-editor: no element matches "+JSON.stringify(i));return s}if(i&&i.nodeType===1)return i;throw new TypeError("grid-editor: the target is an element or a selector, not "+(i===null?"null":typeof i))}function pe(i){return typeof i=="string"?document.querySelector(i):i&&i.nodeType===1?i:null}function jr(){return C.Sortable||window.Sortable||null}function Et(){var i=C.bootstrap||window.bootstrap;return i&&i.Modal?i.Modal:null}function cn(i){var s=document.implementation.createHTMLDocument("").body;s.innerHTML=i;var f=[];return _(s,"*").forEach(function(l){var d=!1;Array.prototype.slice.call(l.attributes).forEach(function(j){j.name.indexOf("data-ge-")===0&&(l.removeAttribute(j.name),d=!0)});var E=(l.getAttribute("class")||"").split(/\s+/).filter(Boolean),b=E.filter(function(j){return j!=="column"&&j.indexOf("ge-")!==0});b.length!==E.length&&(d=!0),b.length?l.setAttribute("class",b.join(" ")):l.removeAttribute("class"),d&&l.tagName==="DIV"&&!l.attributes.length&&f.push(l)}),f.forEach(function(l){yt(l)}),s.innerHTML}function C(i,s){var f=zi(i),l=xt.get(f);if(l)return Ir.has(f)||(Ir.add(f),N(Mi("warning.already_editing"))),l;if(!(this instanceof C))return new C(f,s);Pi(this,f,s||{})}var Ir=new WeakSet;C.create=function(i,s){return new C(i,s)};C.get=function(i){var s=pe(i);return s&&xt.get(s)||null};function Pi(i,s,f){var l=Object.assign({new_row_layouts:[[12],[6,6],[4,4,4],[3,3,3,3],[2,2,2,2,2,2],[2,8,2],[4,8],[8,4]],row_classes:[],col_classes:[],col_tools:[],row_tools:[],drag_handle:"tool",toolbar_drag:"auto",element_tools:[],element_classes:[],container_classes:[],pane_classes:[],container_tools:[],tab_tools:[],accordion_tools:[],plugins:null,row_cols:!0,utilities:{},elements:Ie.elements,custom_filter:"",valid_col_sizes:[1,2,3,4,5,6,7,8,9,10,11,12,"equal","auto"],valid_col_offsets:[0,1,2,3,4,5,6,7,8,9,10,11],add_column:Ie.add_column,layout_modes:Ct.slice(),default_view:W,resize:Ie.resize,source_textarea:"",edit_source:!0,locale:"en",locale_strings:{},callbacks:{},confirm_delete:!0,settings_panel:"offcanvas",drag:Ie.drag},f);Object.keys(Ie).forEach(function(e){l[e]=Object.assign({},Ie[e],l[e])}),Object.keys(zr).forEach(function(e){f&&f[e]!==void 0&&N(_t(l,"warning.setting_removed",{setting:e,replacement:zr[e]}))});var d,E,b,j,ge,Ee,B,A=l.default_view,R=null,X=null,xe=!1,_e=null,fn={},kt=[],Nr=++Oi,mn=!1,pn=new WeakMap,At=new WeakMap,Qe=new WeakMap,gn=new WeakMap,St=new WeakSet,vn=new AbortController;d=k(s,"ge-canvas");function J(e,t){fn[e]||(fn[e]=!0,N(t))}function p(e,t){return _t(l,e,t)}function Rr(e){l.locale=e,i.settings=nn(),hn(),tr(),E.remove(),xn(),zn()}var Ne=0,Tt=[];function Y(e,t,n){return Object.assign({kind:e,node:t,parent:t.parentElement,canvas:d,breakpoint:an(),source:"api"},n||{})}function L(e,t){var n=[e],r=e.replace(/^(before|after)-add-.+$/,"$1-add");r!==e&&n.push(r);var o=!1;return n.forEach(function(a){var u=new CustomEvent("grideditor:"+a,{detail:t,bubbles:!0,cancelable:!0});d.dispatchEvent(u)||(o=!0)}),n.forEach(function(a){var u=l.callbacks[a.replace(/-/g,"_")];typeof u=="function"&&u(t)===!1&&(o=!0)}),!o}function H(e){Ne++;try{return e()}finally{if(Ne--,Ne===0)for(;Tt.length;)Tt.shift()()}}function Ot(e){if(Ne===0){e();return}Tt.push(e)}function $(e,t,n,r){var o=Dr(e);return H(function(){var a=Y(e,t,r);return L("before-add-"+o,a)?(n(),le(),L("after-add-"+o,a),t):null})}function Dr(e){return C.containers[e]?"container":e}function Ur(e,t){if(!l.confirm_delete){t();return}var n=Et();if(!n){window.confirm(e)&&t();return}var r=Fr(),o=!1;z(r,".ge-confirm-message").textContent=e,z(r,".ge-confirm-ok").onclick=function(){o=!0,n.getInstance(r).hide()},ie.hidden=function(){o&&t()},ie.shown=function(){z(r,".ge-confirm-ok").focus()},n.getOrCreateInstance(r).show()}var ie={hidden:null,shown:null};function Fr(){return R||(R=q('<div class="modal fade ge-confirm" tabindex="-1" aria-hidden="true"><div class="modal-dialog modal-dialog-centered"><div class="modal-content"><div class="modal-header"><h5 class="modal-title"></h5><button type="button" class="btn-close" data-bs-dismiss="modal"></button></div><div class="modal-body"><p class="ge-confirm-message"></p></div><div class="modal-footer"><button type="button" class="btn btn-secondary ge-confirm-cancel" data-bs-dismiss="modal"></button><button type="button" class="btn btn-danger ge-confirm-ok"></button></div></div></div></div>'),document.body.appendChild(R),z(R,".modal-title").textContent=p("confirm.title"),z(R,".btn-close").setAttribute("aria-label",p("confirm.cancel")),z(R,".ge-confirm-cancel").textContent=p("confirm.cancel"),z(R,".ge-confirm-ok").textContent=p("confirm.ok"),wn(R),R.addEventListener("hidden.bs.modal",function(){ie.hidden&&ie.hidden()}),R.addEventListener("shown.bs.modal",function(){ie.shown&&ie.shown()}),R)}function hn(){R&&(ie.hidden=null,ie.shown=null,bn(R),R=null)}function bn(e){var t=Et(),n=t?t.getInstance(e):null,r=!1,o=function(){r||(r=!0,n&&n.dispose(),e.remove())};if(!n||!Lt.get(e)&&!y(e,"show")){o();return}e.addEventListener("hidden.bs.modal",o,{once:!0}),e.addEventListener("shown.bs.modal",function(){n.hide()},{once:!0}),n.hide()}var Lt=new WeakMap;function wn(e){Q(e,"show.bs.modal hide.bs.modal",function(){Lt.set(e,!0)}),Q(e,"shown.bs.modal hidden.bs.modal",function(){Lt.set(e,!1)})}function ve(e,t,n,r){H(function(){var o=Y(e,t,{source:"tool"});L("before-delete",o)&&Ur(n,function(){H(function(){r(function(){t.remove(),H(function(){le(),L("after-delete",o)})})})})})}function Mt(e,t,n){if(n=n||A,n!==W){var r=K(n),o=st({size:t,offset:at(e,r)||0});return o.refused||Te(e,r)===o.size?null:{writes:[{tier:r,size:o.size}],cleared:null,size:o.size}}var a=h.some(function(g){return st({size:t,offset:at(e,g)||0}).refused});if(a)return null;var u=h[0],c=[],m=[];return h.slice(1).forEach(function(g){var w=Te(e,g);w!==null&&(c.push({tier:g,size:null}),m.push({breakpoint:g.key,value:w}))}),Te(e,u)!==t&&c.unshift({tier:u,size:t}),c.length?{writes:c,cleared:m,size:t}:null}function zt(e,t){t.writes.forEach(function(n){lt(e,n.tier,n.size)}),Ge(e)}function Pt(e,t){return t&&(e.cleared=t),e}function jt(e,t,n,r){r=r||A;var o=Fe(e),a=Mt(e,t,r);return a?H(function(){var u=Y("column",e,Pt({source:n,breakpoint:r,from:o,to:a.size},a.cleared));return L("before-resize",u)?(zt(e,a),ee(e),L("after-resize",u),!0):(ee(e),!1)}):!1}function yn(e,t,n){var r=A===W,o=r?h[0]:K(A),a=We(e);t=Math.min(Math.max(t,0),Lr);var u=r?h.slice(1).filter(function(c){return it(e,c)!==null}):[];return(it(e,o)||0)===t&&!u.length?!1:H(function(){var c=Y("column",e,Pt({source:n,from:a,to:t},r?u.map(function(m){return{breakpoint:m.key,value:it(e,m)}}):null));return L("before-indent",c)?(Jt(e,o,t),u.forEach(function(m){Jt(e,m,0)}),(r?h:[o]).forEach(function(m){var g=Yt(e,m);if(F(g)){var w=st({size:g,offset:t,leading:"offset"});w.size!==g&&lt(e,m,w.size)}}),ee(e),L("after-indent",c),!0):!1})}function It(e){var t=e.parentElement;return{parent:t,index:G(t).filter(function(n){return!y(n,"ge-tools-drawer")}).indexOf(e)}}function ae(e){var t=null;return Object.keys(S).forEach(function(n){var r=S[n];!t&&r.kindOf&&(t=r.kindOf(e))}),t||(e.getAttribute("data-ge-container")?e.getAttribute("data-ge-container"):y(e,"ge-tab")?"tab":y(e,"ge-accordion-item")?"accordion-item":y(e,"row")?"row":y(e,"column")?"column":y(e,"ge-element")?"element":(y(e,"ge-text-block")&&(e=T(e,".ge-content")||e),y(e,"ge-content")?e.getAttribute("data-ge-content-type")?"text":"plain":"node"))}if(l.source_textarea){var Re=pe(l.source_textarea).value,Cn=v("div");Cn.innerHTML=Re,Re.length>0&&!Cn.querySelector(".row")&&(Re='<div class="row"><div class="col-lg-12">'+Re+"</div></div>"),ft(s,Re)}if(s.children.length&&!s.querySelector("div.row")){var Hr=G(s),En=q('<div class="row"><div class="col-lg-12"></div></div>');s.appendChild(En),Hr.forEach(function(e){En.firstChild.appendChild(e)})}function Wr(){B=v("textarea",{class:"ge-html-output"}),d.parentNode.insertBefore(B,d),xn();var e={signal:vn.signal};window.addEventListener("scroll",eo,e),Ye(d,"click",".ge-content",to,e),Ye(d,"click",".ge-popup-trigger, [data-ge-popup-target]",function(t){y(d,"ge-editing")&&t.preventDefault()},e)}function Kr(e){!Me(e,".ge-content")||!d.contains(e)||(Z("onContentReady",e),tt(e))}function xn(){E=v("div",{class:"ge-mainControls"}),B.parentNode.insertBefore(E,B),b=E.appendChild(v("div",{class:"ge-wrapper ge-top"})),j=b.appendChild(v("div",{class:"ge-addRowGroup btn-group"})),ge=v("div",{class:"ge-addContainerGroup btn-group ms-1"}),l.new_row_layouts.forEach(function(u){var c=!Array.isArray(u),m=v("a",{class:"btn btn-sm btn-primary",title:c?p("row.add_row_cols",{columns:u.columns,counts:Qr(u.row_cols)}):p("row.add",{layout:u.join("-")}),"data-ge-toolbar":"row","data-ge-layout":c?JSON.stringify(u):u.join(",")});m.addEventListener("click",function(){var x=De(u),be=$("row",x,function(){d.appendChild(x)},{parent:d,source:"tool"});be&&x.scrollIntoView&&x.scrollIntoView({behavior:"smooth"})}),j.appendChild(m),m.appendChild(q('<i class="bi bi-plus"></i>'));var g=c?Zr(u):u,w='<div class="row ge-row-icon">';g.forEach(function(x){w+='<div class="column '+Ce(h[0],x)+'"></div>'}),w+="</div>",m.appendChild(q(w))}),b.appendChild(ge),Object.keys(D).forEach(function(u){var c=D[u],m=_n(v("a",{class:"btn btn-sm btn-primary ge-add-container"}),p(c.labelKey),c.iconClass);gt(m,{"data-ge-toolbar":"container","data-ge-container-type":u}),m.addEventListener("click",function(){var g=Oe(),w=g.appendChild(fe(P)),x=w.appendChild(c.create({}));$(u,x,function(){d.appendChild(g)},{parent:d,source:"tool"})}),ge.appendChild(m)});var e=[];Object.keys(S).forEach(function(u){(S[u].toolbar||[]).forEach(function(c,m){var g=Br(u,c,m);c.align==="end"?e.push(g):ge.appendChild(g)})}),Ee=q('<div class="dropdown pull-right ge-layout-mode"><button type="button" class="btn btn-sm btn-primary dropdown-toggle" data-bs-toggle="dropdown"></button><div class="dropdown-menu" role="menu"></div></div>'),Ye(Ee,"click","a",function(){wr(this.getAttribute("data-ge-view"))}),b.appendChild(Ee),l.layout_modes.forEach(function(u){z(Ee,".dropdown-menu").appendChild(v("a",{class:"dropdown-item","data-ge-view":u,title:p($e(u))},p($e(u))))}),z(Ee,"button").textContent=p($e(A));var t=b.appendChild(v("div",{class:"btn-group pull-right"}));if(l.edit_source){var n=q('<button type="button" class="btn btn-sm btn-primary gm-edit-mode"><i class="bi bi-code-slash"></i></button>');n.setAttribute("title",p("tool.edit_source")),I(n,"active btn-danger",xe),n.addEventListener("click",function(){xe?Pn():oo(),I(n,"active btn-danger",xe)}),t.appendChild(n)}var r=q('<button type="button" class="btn btn-sm btn-primary gm-preview"><i class="bi bi-eye-fill"></i></button>'),o=function(){y(r,"active")||k(d,"ge-editing")};if(r.setAttribute("title",p("tool.preview")),r.addEventListener("mouseenter",function(){O(d,"ge-editing")}),r.addEventListener("click",function(){I(r,"active btn-danger"),o()}),r.addEventListener("mouseleave",o),t.appendChild(r),e.length){var a=b.appendChild(v("div",{class:"pull-right ge-toolbar-end"}));e.forEach(function(u){a.appendChild(u)})}Gr()}function _n(e,t,n){return e.setAttribute("title",t),n?(e.appendChild(v("i",{class:n})),e):(e.appendChild(q('<i class="bi bi-plus"></i>')),e.appendChild(v("span",{},t)),e)}function Br(e,t,n){var r=t.iconClass||(t.align==="end"?"bi bi-plus":null),o=typeof t.label=="function"?t.label():t.label||p(t.labelKey),a=_n(v("a",{class:"btn btn-sm btn-primary ge-add-container ge-add-feature"}),o,r);return k(a,t.className||""),gt(a,{"data-ge-toolbar":"feature","data-ge-feature":e,"data-ge-item":n}),a.addEventListener("click",function(){var u=t.create(),c=t.inColumn?Nt(u):u,m=$(t.kind,u,function(){d.appendChild(c)},{parent:d,source:t.source||"tool"});m&&t.inColumn&&c.scrollIntoView&&c.scrollIntoView({behavior:"smooth"})}),a}function Vr(){return l.toolbar_drag==="auto"?l.drag_handle==="drawer":!!l.toolbar_drag}function Gr(){var e=_(E,"[data-ge-toolbar]");e.forEach(function(t){O(t,"ge-palette-button"),t.removeEventListener("pointerdown",kn)}),Vr()&&e.forEach(function(t){k(t,"ge-palette-button"),t.addEventListener("pointerdown",kn)})}function kn(e){var t=e.currentTarget,n=e.pageX,r=e.pageY,o=null;if(e.button)return;function a(m){return Math.abs(m.pageX-n)+Math.abs(m.pageY-r)>l.drag.threshold}function u(m){if(!o){if(!a(m))return;o=k(t.cloneNode(!0),"ge-toolbar-helper"),document.body.appendChild(o),k(d,"ge-dropping")}me(o,{left:m.pageX-14,top:m.pageY-14}),Xr(m.pageX,m.pageY)}function c(m){if(document.removeEventListener("pointermove",u),sn(document,"pointerup pointercancel",c),!!o){o.remove(),O(d,"ge-dropping"),Rt();var g=function(x){x.target!==t&&!t.contains(x.target)||(x.preventDefault(),x.stopImmediatePropagation())};window.addEventListener("click",g,{capture:!0,once:!0}),window.setTimeout(function(){window.removeEventListener("click",g,{capture:!0})},0);var w=An(m.pageX,m.pageY);w&&Yr(t,w)}}document.addEventListener("pointermove",u),Q(document,"pointerup pointercancel",c)}function An(e,t){var n=e-window.scrollX,r=t-window.scrollY,o=document.elementFromPoint(n,r);if(!o)return null;var a=oe(o,[".column",".ge-canvas"].concat(Zt("regions")).join(", "));if(!a||a!==d&&!d.contains(a))return null;var u=null;return G(a,Qt()).forEach(function(c){if(!u){var m=c.getBoundingClientRect();r<m.top+m.height/2&&(u=c)}}),{region:a,before:u}}function qr(e,t){var n=S[e.getAttribute("data-ge-feature")].toolbar[parseInt(e.getAttribute("data-ge-item"),10)],r=n.create(),o=r;if(n.inColumn)Me(t.region,".column")||(o=Nt(r));else if(!en(t.region,r)){var a=t.region===d?[]:xr(t.region,d).reverse().concat([t.region]),u=a[0]||null;t={region:d,before:u?u.nextElementSibling:null}}return $(n.kind,r,function(){t.before?t.before.parentNode.insertBefore(o,t.before):t.region.appendChild(o)},{parent:t.region,source:n.source||"dragdrop"})}function Nt(e){var t=Oe();return t.appendChild(fe(P)).appendChild(e),t}function Xr(e,t){var n=An(e,t);if(!n)return Rt();_e||(_e=v("div",{class:"ge-drop-marker"})),n.before?n.before.parentNode.insertBefore(_e,n.before):n.region.appendChild(_e)}function Rt(){_e&&_e.remove()}function Yr(e,t){if(e.getAttribute("data-ge-toolbar")==="feature")return qr(e,t);var n=e.getAttribute("data-ge-toolbar")==="container",r=e.getAttribute("data-ge-container-type"),o=n?D[r].create({}):$r(e.getAttribute("data-ge-layout")),a=o;return n&&!Me(t.region,".column")&&(a=Nt(o)),$(n?r:"row",o,function(){t.before?t.before.parentNode.insertBefore(a,t.before):t.region.appendChild(a)},{parent:t.region,source:"dragdrop"})}function Jr(){for(var e=[],t=1;t<=P;t++)e.push(String(t));return{name:"col",values:e.concat(un),appliesTo:["column"],labelKey:"utility.col_width",className:function(n,r){return Ce(K(n),Dt(r))},choices:function(){return l.valid_col_sizes.map(String)},label:function(n){return n==="equal"?p("utility.col_equal"):n==="auto"?p("utility.col_auto"):n},write:function(n,r,o,a){return jt(n,r===null?null:Dt(r),a,o)},blank:function(n,r){var o=r===W?null:ot(n,K(r));return o?p("utility.col_from_row",{count:ar(o.value)}):null}}}function Dt(e){return/^\d+$/.test(String(e))?parseInt(e,10):e}function $r(e){return/^\s*\{/.test(e||"")?De(JSON.parse(e)):De((e||"").split(",").filter(function(t){return t!==""}).map(Dt))}function De(e){var t=Oe();if(Array.isArray(e))return e.forEach(function(r){t.appendChild(fe(r))}),t;Object.keys(e.row_cols||{}).forEach(function(r){var o=e.row_cols[r],a=K(r);a&&je.indexOf(String(o))!==-1&&k(t,dn(a,o))});for(var n=0;n<(e.columns||0);n++)t.appendChild(fe(null));return t}function Qr(e){return h.filter(function(t){return e&&e[t.key]!==void 0}).map(function(t){return(t.infix?t.key+": ":"")+e[t.key]}).join(", ")}function Zr(e){var t=1;return Object.keys(e.row_cols||{}).forEach(function(n){var r=e.row_cols[n];r!=="auto"&&(t=Math.max(t,parseInt(r,10)||1))}),Array.apply(null,Array(Math.min(t,e.columns||t))).map(function(){return"equal"})}function eo(){var e=window.pageYOffset;e>bt(E).top&&e<bt(d).top+_r(d)?y(b,"ge-top")&&(me(b,{left:bt(b).left,width:Xe(b)}),O(b,"ge-top"),k(b,"ge-fixed")):y(b,"ge-fixed")&&(me(b,{left:"",width:""}),O(b,"ge-fixed"),k(b,"ge-top"))}function to(){var e=this;if(!e.getAttribute("data-ge-content-type")&&!te()&&vt(e)){var t=Mn();t.length&&(t.length===1?Sn(e,t[0]):no(e,t))}}function Sn(e,t){return t.available&&!t.available()?(t.missingKey&&console.error(p(t.missingKey)),!1):H(function(){var n=Y("plain",e,{source:"tool",from:"plain",to:t.type});if(!L("before-convert",n))return!1;k(e,"ge-content-type-"+t.type),e.setAttribute("data-ge-content-type",t.type);var r=e.parentElement;return y(r,"ge-text-block")&&(O(r,"ge-plain-block"),G(r,".ge-tools-drawer").forEach(function(o){o.remove()})),L("after-convert",n),t.edit(e),!0})}function no(e,t){var n=y(e.parentElement,"ge-text-block")?e.parentElement:null;n&&Tn(T(n,".ge-tools-drawer"),t.map(function(r){return{label:r.label,title:p("tool.convert_type",{editor:r.label}),attributes:{"data-ge-content-type":r.type},choose:function(){Sn(e,r)}}}),"ge-text-picker ge-convert-picker",n)}function Tn(e,t,n,r){if(te(),!!e){var o=oe(e,".ge-tools-drawer");o&&k(o,"ge-picker-open"),X=e.appendChild(k(v("div",{class:"ge-size-picker"}),n||"")),t.forEach(function(a){var u=gt(v("a",{class:"ge-size ge-size-flex"}),a.attributes||{});u.setAttribute("title",a.title||a.label),u.textContent=a.label,u.addEventListener("click",function(c){c.preventDefault(),c.stopPropagation(),te(),a.choose()}),X.appendChild(u)}),On(r||e)}}function On(e){e.addEventListener("mouseleave",function(){window.setTimeout(function(){X&&!X.matches(":hover")&&te()},400)},{once:!0})}function Ln(){var e={},t=[];return Object.keys(S).forEach(function(n){var r=S[n];r.textTypes&&(r.textTypes()||[]).forEach(function(o){if(e[o.type]){e[o.type]!==n&&J("text-type:"+o.type,'the "'+n+'" plugin declares the text type "'+o.type+'", which the "'+e[o.type]+'" plugin already declares: ignored');return}e[o.type]=n,t.push(o)})}),t}function Mn(){return Ln().filter(function(e){return e.offered!==!1})}function ro(e){return Ln().some(function(t){return t.type===e})}function zn(){ke(),le()}function oo(){ke(),B.style.height=.8*document.documentElement.clientHeight+"px",B.value=d.innerHTML,Pe(B),ye(d),xe=!0,Z("onSourceOpen",B)}function Pn(){Z("onSourceClose",B),xe=!1,ft(d,B.value),Pe(d),le(),ye(B)}function le(){U&&!ct(U.node)&&ne(),vr(!0),k(d,"ge-editing"),I(d,"ge-drag-drawer",l.drag_handle==="drawer"),Bo();var e=mi();pi(e),vi(e),hi(),zo(),Po(),Eo(),Z("onInit"),$o(),ti(),br(A),tt(d)}function ke(){ne(),O(d,"ge-editing ge-drag-drawer ge-dropping"),Z("onBeforeDeinit"),te(),Rt(),_(d,".ge-tools-drawer").forEach(function(e){e.remove()}),bi(),Z("onDeinit"),Wn(d),_(d,"[data-ge-row-cols]").forEach(function(e){e.removeAttribute("data-ge-row-cols")}),xo(),ui(),oi(),vr(!1)}function jn(){ke(),Ge(d);var e=d.innerHTML;return le(),e}function io(e){ke(),Ge(e);var t=e.outerHTML;return le(),t}function ao(){return cn(jn())}function lo(){xe&&Pn(),ke(),hn(),tr(),E.remove(),B.remove(),vn.abort(),xt.delete(d),mn=!0}function so(){var e=uo();Ft("grid",{},Jr()),l.row_cols!==!1&&Ft("grid",{},Xo());var t=function(r){return!l.plugins||l.plugins.indexOf(r)!==-1},n=function(r,o){return o.always===!0||t(r)};Object.keys(C.containers).forEach(function(r){t(r)&&(D[r]=C.containers[r](e))}),Object.keys(C.features).forEach(function(r){var o=C.features[r];n(r,o)&&(S[r]=o(e))}),Object.keys(C.utilities).forEach(function(r){t(r)&&(V[r]=C.utilities[r](e),(V[r].families||[]).forEach(function(o){Ft(r,V[r],o)}))}),Object.keys(S).forEach(function(r){var o=S[r].methods||{};Object.keys(o).forEach(function(a){Ue[a]=o[a]})}),(l.plugins||[]).forEach(function(r){D[r]||S[r]||V[r]||J("plugin:"+r,'the "'+r+'" plugin is not loaded: include dist/plugins/grideditor.'+r+".js after the editor")})}function Z(e,t){[D,S,V].forEach(function(n){Object.keys(n).forEach(function(r){n[r][e]&&n[r][e](t)})})}function uo(){return{canvas:d,settings:l,t:p,warn:N,containerId:yo,defaultRegion:Co,createTool:M,createMoveTool:he,addSettingsTool:Be,deleteNode:ve,place:dt,createPaneControls:ko,makeLabelEditable:Ao,labelIn:So,unwrapLabels:To,suspendToggles:qn,resumeToggles:Xn,emit:L,payloadFor:Y,operate:H,kindOf:ae,view:an,viewTiers:function(){return Mr(A).map(function(e){return e.key})},breakpoints:h.map(function(e){return e.key}),getUtility:Hn,setUtility:Kt,utilityField:wo,bareStyle:po,rowFromLayout:De,nodeHtml:io,textReady:Kr,attachPicker:Jn,openPicker:Tn,closePicker:te,detailsOf:Zn,drawerOf:co,toolbarItems:function(e){return E?_(E,'[data-ge-toolbar="feature"][data-ge-feature="'+e+'"]'):[]}}}function co(e){if(y(e,"ge-content")){var t=e.parentElement;return y(t,"ge-text-block")?T(t,".ge-tools-drawer"):null}return T(e,".ge-tools-drawer")}var se={},fo=".row, .column, .ge-content, .ge-element, [data-ge-container]",Ze="data-ge-preview",Ut=!1;function Ft(e,t,n){var r=n.name||n.prefix;if(se[r]){N('the "'+e+'" plugin declares the utility "'+r+'", which the "'+se[r].plugin+'" plugin already declared: ignored');return}se[r]={plugin:e,family:Object.assign({},n,{name:r,values:n.values.map(String),appliesTo:n.appliesTo||t.appliesTo||["row","column"]})}}function et(e,t){return se[e]?se[e].family:(J("utility:"+e,t+"("+JSON.stringify(e)+"): no loaded plugin declares that utility"),null)}function In(e,t){return t==="plain"&&(t="text"),e.appliesTo.indexOf(t)!==-1?!0:!!D[t]&&e.appliesTo.indexOf("container")!==-1}function Nn(e){return Object.keys(se).map(function(t){return se[t].family}).filter(function(t){return In(t,e)})}function Ht(e,t,n){return e.className?e.className(t.key,n):e.prefix+(t.infix?"-"+t.infix:"")+"-"+n}function ue(e,t,n){for(var r=(e.getAttribute("class")||"").split(/\s+/),o=0;o<t.values.length;o++)if(r.indexOf(Ht(t,n,t.values[o]))!==-1)return t.values[o];return null}function Rn(e,t,n){for(var r=h.indexOf(n)-1;r>=0;r--){var o=ue(e,t,h[r]);if(o!==null)return{tier:h[r],value:o}}return null}function Dn(e,t,n){var r=ue(e,t,n);if(r!==null)return r;var o=Rn(e,t,n);return o?o.value:null}function Wt(e,t){return h.map(function(n){return{tier:n,value:ue(e,t,n)}}).filter(function(n){return n.value!==null})}function Un(e,t,n,r){t.values.forEach(function(o){O(e,Ht(t,n,o))}),r!==null&&k(e,Ht(t,n,r)),mt(e)}function Fn(e,t,n){return n===W?ue(e,t,h[0]):Dn(e,t,K(n))}function mo(e,t,n,r){if(n!==W){var o=K(n);return ue(e,t,o)===r?null:{writes:[{tier:o,value:r}],cleared:[]}}var a=[],u=[];return Wt(e,t).forEach(function(c){c.tier!==h[0]&&(a.push({tier:c.tier,value:null}),u.push({breakpoint:c.tier.key,value:c.value}))}),ue(e,t,h[0])!==r&&a.unshift({tier:h[0],value:r}),a.length?{writes:a,cleared:u}:null}function Hn(e,t,n){e=pe(e);var r=et(t,"getUtility");if(!r||!e)return null;var o=n===void 0?A:on(n);return o===null?(N("getUtility("+JSON.stringify(n)+"): no such layout mode"),null):Fn(e,r,o)}function Kt(e,t,n,r){r=typeof r=="string"?{view:r}:r||{},e=pe(e);var o=et(t,"setUtility");if(!o||!e)return!1;var a=r.view===void 0?A:on(r.view);if(a===null)return N("setUtility("+JSON.stringify(r.view)+"): no such layout mode"),!1;if(n=n==null||n===""?null:String(n),n!==null&&o.values.indexOf(n)===-1)return N("setUtility: "+JSON.stringify(n)+' is not a value of "'+t+'", which takes '+JSON.stringify(o.values)),!1;var u=ae(e);if(!In(o,u))return N('setUtility: "'+t+'" does not apply to a '+u),!1;if(o.write)return o.write(e,n,a,r.source||"api");var c=mo(e,o,a,n);return c?H(function(){var m=Y(u,e,{family:t,breakpoint:a,tiers:c.writes.map(function(g){return g.tier.key}),from:Fn(e,o,a),to:n,cleared:c.cleared,source:r.source||"api"});return L("before-utility",m)?(c.writes.forEach(function(g){Un(e,o,g.tier,g.value)}),ee(e),L("after-utility",m),!0):(ee(e),!1)}):!1}function po(e,t,n){var r=et(t,"bareStyle");if(e=pe(e),!r||!e)return null;var o=e.getAttribute("class");h.forEach(function(u){Un(e,r,u,null)});var a=getComputedStyle(e).getPropertyValue(n);return o===null?e.removeAttribute("class"):e.setAttribute("class",o),a}function ee(e){var t=Zn(e);if(t){var n=z(t,".ge-classes");n&&(n.value=Gt(e).join(" ")),G(t,".ge-utilities").forEach(function(r){Bt(r)})}tt(e)}function go(e){return we(e,fo)}function tt(e){Wn(e),A!==W&&vo(e,K(A)),qo(e),Z("onRefresh",e)}function vo(e,t){go(e).forEach(function(n){var r=ae(n),o={};Nn(r).forEach(function(a){!a.preview||!Wt(n,a).length||Object.assign(o,a.preview(Dn(n,a,t),n,r))}),r==="column"&&Object.assign(o,Go(n,t)),Object.keys(V).forEach(function(a){var u=V[a];u.preview&&Object.assign(o,u.preview(n,r,t.key))}),Object.keys(o).length&&ho(n,o)})}function ho(e,t){var n=e.style,r={};Object.keys(t).forEach(function(o){r[o]=[n.getPropertyValue(o),n.getPropertyPriority(o)],n.setProperty(o,String(t[o]),"important")}),e.setAttribute(Ze,JSON.stringify(r))}function Wn(e){we(e,"["+Ze+"]").forEach(function(t){var n=t.style,r={};try{r=JSON.parse(t.getAttribute(Ze))||{}}catch(o){}Object.keys(r).forEach(function(o){var a=r[o];a&&a[0]?n.setProperty(o,a[0],a[1]):n.removeProperty(o)}),t.removeAttribute(Ze),pt(t)})}function bo(e){var t=ae(e),n=Nn(t).filter(function(u){return u.panel!==!1}).map(function(u){return Kn(e,u)});if(Object.keys(V).forEach(function(u){var c=V[u],m=c.panel?c.panel(e,t):null;m&&n.push(m)}),!n.length)return null;var r=I(v("div",{class:"ge-utilities"}),"ge-open",Ut);gn.set(r,e);var o=r.appendChild(v("a",{class:"ge-utilities-toggle"}));o.addEventListener("click",function(){Ut=!y(r,"ge-open"),er().forEach(function(u){_(u,".ge-utilities").forEach(function(c){I(c,"ge-open",Ut)})})});var a=r.appendChild(v("div",{class:"ge-utilities-body"}));return n.forEach(function(u){a.appendChild(u)}),Bt(r),r}function Kn(e,t){var n=v("label",{class:"ge-utility","data-ge-family":t.name});n.appendChild(v("span",{class:"ge-utility-label"},t.labelKey?p(t.labelKey):t.name));var r=n.appendChild(v("select",{class:"form-select form-select-sm"}));return r.addEventListener("change",function(){Kt(e,t.name,this.value,{source:"panel"})}),n.appendChild(v("small",{class:"ge-utility-note"})),n}function wo(e,t){var n=et(t,"utilityField");if(!n)return null;var r=Kn(e,n);return Bn(r,e),r}function Bt(e){var t=gn.get(e);G(e,".ge-utilities-toggle").forEach(function(n){n.textContent=p("utility.section",{view:p($e(A))})}),_(e,".ge-utility").forEach(function(n){Bn(n,t)})}function Bn(e,t){var n=se[e.getAttribute("data-ge-family")].family,r=T(e,"select"),o=n.choices?n.choices(t,ae(t)):n.values,a,u,c="";if(r.innerHTML="",A===W){a=ue(t,n,h[0]),u=p("utility.default");var m=Wt(t,n).filter(function(Le){return Le.tier!==h[0]});m.length&&(c=p("utility.varies",{breakpoints:m.map(function(Le){return Le.tier.key}).join(", ")}))}else{var g=K(A),w=Rn(t,n,g);a=ue(t,n,g),u=w?p("utility.inherit",{value:Vn(n,w.value),breakpoint:w.tier.key}):p("utility.default");var x=n.blank?n.blank(t,A):null;x&&a===null&&(u=x)}a!==null&&o.indexOf(a)===-1&&(o=o.concat([a])),r.appendChild(v("option",{value:""},u)),o.forEach(function(Le){r.appendChild(v("option",{value:Le},Vn(n,Le)))}),r.value=a===null?"":a;var be=T(e,".ge-utility-note");be.textContent=c,ln(be,c!=="")}function Vn(e,t){return e.label?e.label(t):t}var D={},S={},V={},Ue={},Gn=0;function yo(e){return Gn++,"ge-"+e+"-"+Gn+"-"+Math.random().toString(36).slice(2,6)}function Co(){var e=Oe();return e.appendChild(fe(P)),e}function Ae(e){return e?e.getAttribute("data-ge-container"):null}function Eo(){_(d,"[data-ge-container]").forEach(function(e){var t=Ae(e),n=D[t];if(!n){J("container:"+t,'unknown container type "'+t+'"');return}k(e,"ge-container ge-container-"+t),n.mark(e),T(e,".ge-tools-drawer")||_o(e,t,n)})}function xo(){_(d,"[data-ge-container]").forEach(function(e){var t=D[Ae(e)];t&&t.unmark(e),O(e,"ge-container ge-container-"+Ae(e)),mt(e)})}function Se(e,t){var n=v("div",{class:t});return e.insertBefore(n,e.firstChild),n}function nt(e,t){(t||[]).forEach(function(n){M(e,n.title||"",n.className||"",n.iconClass||"bi bi-wrench",n.on)})}function _o(e,t,n){var r=Se(e,"ge-tools-drawer ge-container-drawer");he(r),Be(r,e,l.container_classes),nt(r,l.container_tools),n.tools&&n.tools(r,e),M(r,p("tool.delete_container"),"ge-delete-container","bi bi-trash",function(){ve(t,e,p("confirm.delete_container"),function(o){Je(e,o)})}),n.addPane&&M(r,p(n.addPaneKey),"ge-add-pane","bi bi-plus-circle",function(){var o=n.addPane(e,{});$(n.paneKind,o,function(){},{parent:e,source:"tool",container:e})})}function ko(e,t,n,r,o){var a=Se(e,"ge-tools-drawer ge-pane-drawer");return he(a),Be(a,e,l.pane_classes),nt(a,n),M(a,p("tool.delete_pane"),"ge-delete-pane","bi bi-trash",function(){ve(t,e,r,function(u){o(u)})}),a}function qn(e){e&&we(e,"[data-bs-toggle], [data-bs-dismiss]").forEach(function(t){["toggle","dismiss"].forEach(function(n){var r=t.getAttribute("data-bs-"+n);r!==null&&(t.setAttribute("data-ge-bs-"+n,r),t.removeAttribute("data-bs-"+n))})})}function Xn(e){e&&we(e,"[data-ge-bs-toggle], [data-ge-bs-dismiss]").forEach(function(t){["toggle","dismiss"].forEach(function(n){var r=t.getAttribute("data-ge-bs-"+n);r!==null&&(t.setAttribute("data-bs-"+n,r),t.removeAttribute("data-ge-bs-"+n))})})}function Ao(e){if(!St.has(e)){var t=oe(e,"[data-bs-toggle], [data-ge-bs-toggle]");St.add(e),e.setAttribute("title",p("tool.rename")),e.addEventListener("dblclick",function(n){n.preventDefault(),n.stopPropagation(),qn(t),e.setAttribute("contenteditable","true"),e.focus(),window.getSelection().selectAllChildren(e)}),e.addEventListener("keydown",function(n){e.getAttribute("contenteditable")==="true"&&n.key==="Enter"&&(n.preventDefault(),e.blur())}),e.addEventListener("blur",function(){e.removeAttribute("contenteditable"),Xn(t)})}}function So(e){var t=T(e,".ge-pane-label");return t||(t=v("span",{class:"ge-pane-label"},e.textContent.trim()),e.innerHTML="",e.appendChild(t)),t}function To(e){_(e,".ge-pane-label").forEach(function(t){St.delete(t),yt(t)})}function Yn(e,t){var n=fe(t);return $("column",n,function(){e.appendChild(n)},{parent:e,source:"tool"})}function Oo(e,t){!l.add_column.picker||!e||Jn(e,function(){Lo(e,t)})}function Jn(e,t){var n=null,r=function(){window.clearTimeout(n),n=null};Q(e,"mouseenter mousedown",function(){n||X||(n=window.setTimeout(function(){n=null,t()},l.add_column.delay))}),Q(e,"mouseleave mouseup",r)}function Lo(e,t){te();var n=$t(t,de()),r=oe(e,".ge-tools-drawer");r&&k(r,"ge-picker-open"),X=e.appendChild(v("div",{class:"ge-size-picker"})),l.valid_col_sizes.forEach(function(o){var a=v("a",{class:"ge-size","data-ge-size":o,title:Mo(o)},F(o)?o:Ce(h[0],o));I(a,"ge-size-tight",F(o)&&o>n),I(a,"ge-size-flex",!F(o)),a.addEventListener("click",function(u){u.preventDefault(),u.stopPropagation(),te(),Yn(t,o)}),X.appendChild(a)}),On(e)}function Mo(e){return e==="equal"?p("tool.column_equal"):e==="auto"?p("tool.column_auto"):p("tool.column_size",{size:e})}function te(){if(!X)return!1;var e=oe(X,".ge-tools-drawer");return e&&O(e,"ge-picker-open"),X.remove(),X=null,!0}function zo(){_(d,".row").forEach(function(e){if(!T(e,".ge-tools-drawer")){var t=Se(e,"ge-tools-drawer");he(t),Be(t,e,l.row_classes),nt(t,l.row_tools),M(t,p("tool.delete_row"),"ge-delete-row","bi bi-trash",function(){ve("row",e,p("confirm.delete_row"),function(n){Je(e,n)})}),M(t,p("tool.add_column"),"ge-add-column","bi bi-plus-circle",function(){te()||Yn(e,Ve(e,de())?null:l.add_column.size)}),Oo(T(t,".ge-add-column"),e)}})}function Po(){_(d,".column").forEach(function(e){if(!T(e,".ge-tools-drawer")){var t=Se(e,"ge-tools-drawer");he(t),M(t,p("tool.column_narrower"),"ge-decrease-col-width","bi bi-dash-lg",function(n){jt(e,n.shiftKey?Ke(l.valid_col_sizes):rt(l.valid_col_sizes.filter(F),He(e),-1),"tool")}),M(t,p("tool.column_wider"),"ge-increase-col-width","bi bi-plus-lg",function(n){jt(e,n.shiftKey?jo(e):rt(l.valid_col_sizes.filter(F),He(e),1),"tool")}),M(t,p("tool.indent_decrease"),"ge-decrease-col-offset","bi bi-text-indent-right",function(n){yn(e,n.shiftKey?Ke(l.valid_col_offsets):rt(l.valid_col_offsets,We(e),-1),"tool")}),M(t,p("tool.indent_increase"),"ge-increase-col-offset","bi bi-text-indent-left",function(n){yn(e,n.shiftKey?Io(e):rt(l.valid_col_offsets,We(e),1),"tool")}),Be(t,e,l.col_classes),nt(t,l.col_tools),M(t,p("tool.delete_column"),"ge-delete-column","bi bi-trash",function(){ve("column",e,p("confirm.delete_column"),function(n){Sr(e,400,n,!0)})}),M(t,p("tool.add_row"),"ge-add-row","bi bi-plus-circle",function(){var n=Oe();$("row",n,function(){e.appendChild(n)},{parent:e,source:"tool"})})}})}function de(){return A===W?h[h.length-1]:K(A)}function Fe(e){var t=de();if(ot(e,t))return null;var n=Yt(e,t);return n===null?P:n}function He(e){var t=Fe(e);if(F(t))return t;var n=Math.round(Xe(e)/$n(e.parentElement)*P);return Math.min(Math.max(n,1),P)}function $n(e){var t=window.getComputedStyle(e);return e.clientWidth-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight)}function We(e){return at(e,de())||0}function rt(e,t,n){var r=e.indexOf(t);return r===-1?e.reduce(function(o,a){return Math.abs(a-t)<Math.abs(o-t)?a:o},e[0]):e[Math.min(Math.max(r+n,0),e.length-1)]}function Ke(e){return e.filter(F).reduce(function(t,n){return Math.min(t,n)},P)}function Vt(e){return e.filter(F).reduce(function(t,n){return Math.max(t,n)},0)}function jo(e){var t=$t(e.parentElement,de(),e)-We(e);return Math.min(Vt(l.valid_col_sizes),Math.max(t,1))}function Io(e){var t=$t(e.parentElement,de(),e)-He(e);return Math.min(Vt(l.valid_col_offsets),Math.max(t,0))}function he(e){return l.drag_handle==="drawer"?null:M(e,p("tool.move"),"ge-move","bi bi-arrows-move")}function M(e,t,n,r,o){var a=v("a",{title:t,class:n});return a.appendChild(v("i",{class:r})),e.appendChild(a),typeof o=="function"&&a.addEventListener("click",o),o&&typeof o=="object"&&Object.keys(o).forEach(function(u){Q(a,u,o[u])}),a}function Gt(e){return(e.getAttribute("class")||"").split(/\s+/).filter(function(t){return t!==""&&!No(t)})}function No(e){return e==="row"||e==="column"||/^(ge-|ui-)/.test(e)||/^col(-(sm|md|lg|xl|xxl))?(-auto)?$/.test(e)?!0:h.some(function(t){return new RegExp("^("+t.colPrefix+"|"+t.offsetPrefix+")\\d+$").test(e)})}function Ro(e,t){Gt(e).forEach(function(n){O(e,n)}),t.split(/\s+/).forEach(function(n){n!==""&&k(e,n)}),mt(e)}function Be(e,t,n){var r=Do(t,n||[]);pn.set(t,r),M(e,p("tool.settings"),"ge-settings","bi bi-gear-fill",function(){Fo(t,r,this)});var o=ae(t);return Object.keys(V).forEach(function(a){V[a].drawerTools&&V[a].drawerTools(e,t,o)}),Object.keys(S).forEach(function(a){S[a].drawerTools&&S[a].drawerTools(e,t,o)}),e.appendChild(r)}function Do(e,t){var n=v("div",{class:"ge-details"}),r=n.appendChild(v("div",{class:"ge-details-general"})),o=function(g){var w=v("label",{class:"ge-field"});return w.appendChild(v("span",{class:"ge-field-label"},g)),r.appendChild(w)},a=v("input",{class:"ge-id form-control form-control-sm",placeholder:p("tool.id_placeholder"),title:p("tool.id_title")});a.value=e.getAttribute("id")||"",o(p("panel.id")).appendChild(a),a.addEventListener("change",function(){this.value===""?e.removeAttribute("id"):e.setAttribute("id",this.value)});var u=v("input",{class:"ge-classes form-control form-control-sm",placeholder:p("tool.classes_placeholder"),title:p("tool.classes_title")});u.value=Gt(e).join(" "),o(p("panel.classes")).appendChild(u),u.addEventListener("change",function(){Ro(e,this.value),ee(e)});var c=r.appendChild(v("div",{class:"btn-group btn-group-sm ge-presets",role:"group"}));t.forEach(function(g){var w=y(e,g.cssClass),x=v("a",{role:"button",class:"btn btn-sm btn-outline-secondary",title:g.title?g.title:p("tool.toggle_class",{label:g.label}),"aria-pressed":w?"true":"false"});x.innerHTML=g.label,I(x,"active",w),x.addEventListener("click",function(){I(x,"active"),x.setAttribute("aria-pressed",y(x,"active")?"true":"false"),I(e,g.cssClass,y(x,"active")),ee(e)}),c.appendChild(x)});var m=bo(e);return m&&n.appendChild(m),n}var Qn=["offcanvas","popover","modal","inline"],ce={},U=null,qt=new WeakMap;function Uo(){return Qn.indexOf(l.settings_panel)!==-1?l.settings_panel:(J("settings_panel",'settings_panel "'+l.settings_panel+'" is not one of '+Qn.join(", ")+": using offcanvas"),"offcanvas")}function Zn(e){return e&&pn.get(e)||null}function er(){return U&&U.mode!=="inline"?[d,U.details]:[d]}function Fo(e,t,n){var r=Uo();if(r==="inline"){ln(t);return}var o=U&&U.details===t;ne(),o||Ho(r,e,t,n)}function Ho(e,t,n,r){var o=Wo(e),a=new AbortController;U={mode:e,node:t,details:n,home:n.parentElement,next:n.nextElementSibling,gear:r,listening:a},z(o,".ge-settings-title").textContent=p("panel.title",{kind:Ko(t)}),z(o,".ge-settings-body").appendChild(n),Pe(n),k(t,"ge-settings-target");var u={signal:a.signal};if(document.addEventListener("keydown",function(m){m.key==="Escape"&&ne()},u),e==="offcanvas"){var c=window.innerWidth<576;I(o,"offcanvas-end",!c),I(o,"offcanvas-bottom",c),O(o,"hiding"),o.getBoundingClientRect(),k(o,"show")}else e==="popover"?(Xt(o,r),Q(window,"scroll resize",function(){Xt(o,r)},u),window.ResizeObserver&&(U.observer=new window.ResizeObserver(function(){Xt(o,r)}),U.observer.observe(n)),Q(document,"mousedown touchstart",function(m){!o.contains(m.target)&&!r.contains(m.target)&&ne()},u)):nr(o)}function ne(){var e=U;if(e){U=null;var t=ce[e.mode];e.listening.abort(),e.observer&&e.observer.disconnect(),e.mode==="offcanvas"?(O(t,"show"),k(t,"hiding"),window.setTimeout(function(){O(t,"hiding")},300)):e.mode==="popover"?ye(t):rr(t),O(e.node,"ge-settings-target"),e.details.style.removeProperty("display"),pt(e.details),e.home&&ct(e.home)?e.next&&e.next.parentElement===e.home?e.home.insertBefore(e.details,e.next):e.home.appendChild(e.details):e.details.remove()}}function Wo(e){if(ce[e])return ce[e];var t=function(){return v("button",{type:"button",class:"btn-close ge-settings-close","aria-label":p("panel.close")})},n;return e==="offcanvas"?(n=q('<div class="offcanvas offcanvas-end ge-settings-panel ge-settings-offcanvas" tabindex="-1" role="dialog"><div class="offcanvas-header"><h5 class="offcanvas-title ge-settings-title"></h5></div><div class="offcanvas-body ge-settings-body"></div></div>'),z(n,".offcanvas-header").appendChild(t())):e==="popover"?(n=q('<div class="popover bs-popover-bottom ge-settings-panel ge-settings-popover" role="dialog"><div class="popover-arrow"></div><div class="popover-header"><span class="ge-settings-title"></span></div><div class="popover-body ge-settings-body"></div></div>'),z(n,".popover-header").appendChild(t()),ye(n)):(n=q('<div class="modal fade ge-settings-panel ge-settings-modal" tabindex="-1" role="dialog" aria-hidden="true"><div class="modal-dialog modal-dialog-centered modal-dialog-scrollable"><div class="modal-content"><div class="modal-header"><h5 class="modal-title ge-settings-title"></h5></div><div class="modal-body ge-settings-body"></div><div class="modal-footer"></div></div></div></div>'),z(n,".modal-header").appendChild(t()),z(n,".modal-footer").appendChild(v("button",{type:"button",class:"btn btn-primary ge-settings-close"},p("panel.done")))),Ye(n,"click",".ge-settings-close",function(r){r.preventDefault(),ne()}),ce[e]=document.body.appendChild(n),n}function tr(){ne(),Object.keys(ce).forEach(function(e){e==="modal"?bn(ce[e]):ce[e].remove()}),re&&(re.remove(),re=null),ce={}}function Xt(e,t){if(ct(t)){Pe(e);var n=t.getBoundingClientRect(),r=8,o=T(e,".popover-body");o.style.removeProperty("max-height");var a=Xe(e),u=ht(e),c=window.innerHeight-n.bottom-2*r,m=n.top-2*r,g=u<=c||c>=m,w=g?c:m;u>w&&(me(o,{"max-height":Math.max(120,w-(u-ht(o)))}),u=ht(e));var x=g?n.bottom+r:n.top-r-u,be=Math.max(r,Math.min(n.left+n.width/2-24,window.innerWidth-a-r));I(e,"bs-popover-bottom",g),I(e,"bs-popover-top",!g),me(e,{top:x+window.pageYOffset,left:be+window.pageXOffset}),me(T(e,".popover-arrow"),{left:Math.max(r,Math.min(n.left+n.width/2-be-8,a-24))})}}var re=null;function nr(e){var t=Et();if(!t){re=v("div",{class:"modal-backdrop fade show ge-settings-backdrop"}),re.addEventListener("click",function(){ne()}),document.body.appendChild(re),k(e,"show"),e.style.display="block",e.removeAttribute("aria-hidden");return}var n=t.getOrCreateInstance(e),r=qt.get(e);r||(r={wanted:null,busy:!1},qt.set(e,r),wn(e),e.addEventListener("hide.bs.modal",function(){r.wanted==="open"&&(r.wanted="closed",r.busy=!0)}),e.addEventListener("shown.bs.modal",function(){r.busy=!1,r.wanted==="closed"&&rr(e)}),e.addEventListener("hidden.bs.modal",function(){r.busy=!1,r.wanted==="open"?nr(e):U&&U.mode==="modal"&&ne()})),r.wanted="open",r.busy||(r.busy=!0,n.show())}function rr(e){var t=Et();if(!t){re&&(re.remove(),re=null),O(e,"show"),e.style.removeProperty("display"),e.setAttribute("aria-hidden","true");return}var n=qt.get(e)||{wanted:null,busy:!1};n.wanted="closed",!n.busy&&y(e,"show")&&(n.busy=!0,t.getOrCreateInstance(e).hide())}function Ko(e){var t=ae(e);if(D[t]&&D[t].labelKey)return p(D[t].labelKey);switch(t){case"row":return p("panel.kind_row");case"column":return p("panel.kind_column");case"text":return p("panel.kind_text");case"element":return p("panel.kind_element");case"section":return p("panel.kind_section");case"tab":return p("panel.kind_tab");case"accordion-item":return p("panel.kind_accordion_item");default:return t}}function Bo(){_(d,'.column, div[class*="col-"], div.col').forEach(function(e){k(e,"column"),!(Yo(e).length||or(e.parentElement))&&lt(e,h[0],P)})}function or(e){return y(e,"row")&&h.some(function(t){return je.some(function(n){return y(e,dn(t,n))})})}function Ve(e,t){if(!y(e,"row"))return null;for(var n=h.indexOf(t);n>=0;n--)for(var r=0;r<je.length;r++)if(y(e,dn(h[n],je[r])))return{tier:n,value:je[r]};return null}function ir(e,t){for(var n=h.indexOf(t);n>=0;n--){var r=Te(e,h[n]);if(r!==null)return{tier:n,size:r}}return null}function ot(e,t){var n=Ve(e.parentElement,t);if(!n)return null;var r=ir(e,t);return!r||n.tier>r.tier||n.tier===r.tier&&r.size==="equal"?n:null}function Vo(e){return e.value==="auto"?0:P/parseInt(e.value,10)}function Go(e,t){var n=ot(e,t);return n?{flex:"0 0 auto",width:n.value==="auto"?"auto":100/parseInt(n.value,10)+"%","max-width":"100%"}:or(e.parentElement)&&!ir(e,t)?{flex:"0 0 auto",width:"100%","max-width":"100%"}:{}}function qo(e){we(e,".row").forEach(function(t){var n=l.row_cols===!1?null:A===W?Ve(t,h[0])||null:Ve(t,K(A));n?t.setAttribute("data-ge-row-cols",ar(n.value)):t.removeAttribute("data-ge-row-cols")})}function ar(e){return e==="auto"?p("badge.row_cols_auto"):p("badge.row_cols",{count:e})}function Xo(){return{name:"row-cols",prefix:"row-cols",values:je,appliesTo:["row"],labelKey:"utility.row_cols"}}function Te(e,t){var n=sr(e,t.colPrefix);return n!==null?n:y(e,Ce(t,"auto"))?"auto":y(e,Ce(t,"equal"))?"equal":null}function it(e,t){return sr(e,t.offsetPrefix)}function Yt(e,t){return lr(e,t,Te)}function at(e,t){return lr(e,t,it)}function lr(e,t,n){for(var r=h.indexOf(t);r>=0;r--){var o=n(e,h[r]);if(o!==null)return o}return null}function sr(e,t){var n=new RegExp("(?:^|\\s)"+t+"(\\d+)(?:\\s|$)").exec(e.getAttribute("class")||"");return n?parseInt(n[1],10):null}function ur(e,t,n){var r=(e.getAttribute("class")||"").split(/\s+/).filter(function(o){return o!==""&&!new RegExp("^"+t+"\\d+$").test(o)});n!==null&&r.push(t+n),e.setAttribute("class",r.join(" "))}function lt(e,t,n){ur(e,t.colPrefix,null),un.forEach(function(r){O(e,Ce(t,r))}),n!=null&&k(e,Ce(t,n))}function Jt(e,t,n){ur(e,t.offsetPrefix,n||null)}function Yo(e){return h.filter(function(t){return Te(e,t)!==null})}function $t(e,t,n){var r=0;return G(e,".column").forEach(function(o){if(!(n&&o===n)){var a=ot(o,t),u=a?Vo(a):Yt(o,t);r+=(F(u)?u:0)+(at(o,t)||0)}}),P-r}function st(e){var t=e.size===null||e.size===void 0?null:e.size,n=e.offset===null||e.offset===void 0?0:e.offset;return n=Math.min(Math.max(n,0),Lr),t===null||!F(t)?{size:t,offset:n,refused:!1}:(t=Math.min(Math.max(t,1),P),t+n<=P?{size:t,offset:n,refused:!1}:e.leading==="offset"?{size:P-n,offset:n,refused:!1}:{size:null,offset:n,refused:!0})}function Ge(e){we(e,".column").forEach(function(t){me(t,{width:"",height:"",left:"",top:""}),pt(t)})}function dr(e){return"ge-"+e+"-"+Nr}function Qt(){return[".row",".ge-text-block",".ge-content","[data-ge-container]"].concat(Zt("blocks")).join(", ")}function Zt(e){return Object.keys(S).map(function(t){return S[t][e]||null}).filter(function(t){return t!==null})}function en(e,t){var n=!0;return Object.keys(S).forEach(function(r){var o=S[r];n&&o.accepts&&o.accepts(e,t)===!1&&(n=!1)}),n}function Jo(){return l.drag_handle==="drawer"?".ge-tools-drawer > a:not(.ge-text-info):not(.ge-element-info), .ge-details, input, textarea, button, select, option":"input, textarea, button, select, option"}function ut(e,t){var n=jr();if(e=Array.isArray(e)?e:e?[e]:[],!(!e.length||!n)){var r=l.drag_handle==="drawer",o=Jo(),a=0;e.forEach(function(u){var c=t.group?{name:dr(t.group)}:{name:dr(t.draggable+"-"+ ++a),pull:!1,put:!1};t.group&&t.accepts&&(c.put=function(m,g,w){return g.options.group.name===c.name&&t.accepts(m.el,w)}),kt.push(n.create(u,Object.assign({group:c,draggable:t.draggable,handle:r?".ge-tools-drawer":".ge-tools-drawer .ge-move",filter:function(m,g){return oe(m.target,o,u)?!0:!g||g.parentNode!==u},preventOnFilter:!1,forceFallback:!0,fallbackOnBody:!1,ghostClass:"ge-drag-placeholder",chosenClass:"ge-drag-chosen",dragClass:"ge-drag-helper",fallbackClass:"ge-drag-helper",animation:l.drag.animation,delay:l.drag.delay||l.drag.touch_delay,delayOnTouchOnly:!l.drag.delay,touchStartThreshold:l.drag.threshold,scroll:l.drag.scroll,onStart:Qo,onEnd:ei},t.options||{})))})}}function $o(){if(!jr()){J("sortable_missing",p("error.sortable_missing"));return}ut(_(d,".row"),{draggable:".column",group:"column"}),ut([d].concat(_(d,".column")),{draggable:Qt(),group:"block",accepts:en});var e=Zt("regions");e.length&&ut(_(d,e.join(", ")),{draggable:">"+Qt(),group:"block",accepts:en}),Z("onSortable",ut)}function Qo(e){var t=e.item,n=It(t),r=cr(t),o={from:n,canceled:!1};At.set(t,o),H(function(){var a=L("before-move",Y(r.kind,r.node,{parent:n.parent,source:"dragdrop",from:n}));a||(o.canceled=!0)})}function cr(e){var t=y(e,"ge-text-block")&&T(e,".ge-content")||e;return{kind:ae(t),node:t}}function Zo(e,t){var n=G(t.parent).filter(function(r){return r!==e&&!y(r,"ge-tools-drawer")});!n.length||t.index>=n.length?t.parent.appendChild(e):t.parent.insertBefore(e,n[t.index])}function ei(e){var t=e.item,n=At.get(t),r=n?n.from:It(t);if(At.delete(t),n&&n.canceled){Zo(t,r);return}var o=It(t);if(!(o.parent===r.parent&&o.index===r.index)){var a=oe(t,"[data-ge-container]"),u=D[Ae(a)];u&&u.afterPaneMove&&u.afterPaneMove(a,t,r);var c=cr(t);H(function(){L("after-move",Y(c.kind,c.node,{parent:o.parent,source:"dragdrop",from:r,to:o,container:a||void 0}))})}}function ti(){l.resize.enabled&&_(d,".column").forEach(function(e){if(!T(e,".ge-resize-handle")){var t=T(e,".ge-tools-drawer");t&&t.appendChild(v("span",{class:"ge-resize-size"})),ni().forEach(function(n){var r=v("span",{class:"ge-resize-handle ge-resize-"+n,"data-ge-edge":n});r.addEventListener("pointerdown",ri),e.appendChild(r)})}})}function ni(){return String(l.resize.handles).split(",").map(function(e){return e.trim()}).filter(function(e){return e==="e"||e==="w"})}function ri(e){var t=e.currentTarget,n=t.parentElement,r=t.getAttribute("data-ge-edge")==="w",o=e.pageX,a=Xe(n);if(e.preventDefault(),!ii(n))return;k(n,"ge-resizing"),e.pointerId!==void 0&&t.setPointerCapture&&t.setPointerCapture(e.pointerId);function u(g){var w=g.pageX-o;return Math.max(1,a+(r?-w:w))}function c(g){n.style.width=u(g)+"px",ai(n,u(g))}function m(g){t.removeEventListener("pointermove",c),sn(t,"pointerup pointercancel",m),O(n,"ge-resizing"),li(n,u(g))}t.addEventListener("pointermove",c),Q(t,"pointerup pointercancel",m)}function oi(){_(d,".ge-resize-handle").forEach(function(e){e.remove()}),_(d,".ge-resize-size").forEach(function(e){e.remove()}),Ge(d)}function fr(e,t){var n=Math.round(t/$n(e.parentElement)*P),r=mr(e),o=r?Fe(r):null,a=Qe.get(e),u=a?a.units:He(e),c=r&&F(o)?u+o-Ke(l.valid_col_sizes):P-We(e);return Math.min(Math.max(n,Ke(l.valid_col_sizes)),Math.max(c,Ke(l.valid_col_sizes)),Vt(l.valid_col_sizes))}function mr(e){return l.resize.balance!=="next"?null:Er(e,".column")[0]||null}function tn(e,t){var n=T(e,".ge-tools-drawer"),r=n?T(n,".ge-resize-size"):null;r&&(r.textContent=t)}function pr(e){return(A===W?h[0].colPrefix:de().colPrefix)+e}function ii(e){var t=Fe(e),n=H(function(){return L("before-resize",Y("column",e,{source:"dragdrop",from:t,to:null}))});if(!n)return!1;var r={from:t,units:He(e)};return Qe.set(e,r),tn(e,pr(r.units)),!0}function ai(e,t){tn(e,pr(fr(e,t)))}function li(e,t){var n=Qe.get(e),r=fr(e,t);if(Qe.delete(e),tn(e,""),Ge(e),!!n&&r!==n.units){var o=Mt(e,r);o&&H(function(){zt(e,o),si(e,r-n.units),ee(e),L("after-resize",Y("column",e,Pt({source:"dragdrop",from:n.from,to:o.size},o.cleared)))})}}function si(e,t){var n=mr(e);if(!(!n||!t)){var r=Fe(n);if(F(r)){var o=Mt(n,r-t);o&&(zt(n,o),ee(n))}}}function ui(){kt.forEach(function(e){e.destroy()}),kt=[]}function Oe(){return v("div",{class:"row"})}function dt(e,t,n){var r=null;if(Si.forEach(function(c){r===null&&n&&n[c]!==void 0&&(r=c)}),r===null)return e;var o=pe(n[r]);if(!o)return N(t+": "+r+" matches no element; the "+t+" is left detached"),e;var a=r==="appendTo"||r==="prependTo"?o:o.parentElement,u=function(){return $(t,e,function(){r==="appendTo"?o.appendChild(e):r==="prependTo"?o.insertBefore(e,o.firstChild):r==="insertBefore"?o.parentNode.insertBefore(e,o):wt(e,o)},{parent:a,source:n.source||"api"})};return Ne>0?(Ot(u),e):u()}function di(e,t){var n=Oe();return e!==void 0&&!Array.isArray(e)&&!(e&&e.row_cols)&&(N("createRow: the layout is an array of column sizes, as in [8, 4], or { row_cols, columns }. Making an empty row instead."),e=[]),e&&!Array.isArray(e)&&(n=De(e)),(Array.isArray(e)?e:[]).forEach(function(r){n.appendChild(fe(r))}),dt(n,"row",t)}function ci(e,t){t=t||{};var n=pe(t.appendTo||t.prependTo||null);e===void 0&&n&&Ve(n,de())?e=null:!F(e)&&un.indexOf(e)===-1&&(N("createColumn: no column size given, using "+P),e=P);var r=fe(e,t.offset);return t.content!==void 0&&r.appendChild(Ci(t.content)),dt(r,"column",t)}function fi(e,t){t=t||{};var n=D[e];return n?dt(n.create(t),e,t):(N('createContainer: no such container type "'+e+'"'),null)}function gr(e,t,n){e=pe(e),n=n||{};var r=D[Ae(e)];if(!r||Ae(e)!==t)return N("this is not a "+t+" container"),null;var o=r.addPane(e,n);return $(r.paneKind,o,function(){},{parent:e,source:"api",container:e})}function nn(){var e={};return Object.keys(l).forEach(function(t){var n=l[t];e[t]=Array.isArray(n)?n.slice():n}),Object.freeze(e)}function fe(e,t){var n=v("div",{class:"column"}),r=Mr(A)[0],o=st({size:e,offset:t||0,leading:"offset"});return lt(n,r,o.size===null?e:o.size),Jt(n,r,o.offset),n}function vr(e){if(!(!l.custom_filter||!l.custom_filter.length)){var t=typeof l.custom_filter=="string"||typeof l.custom_filter=="function"?[l.custom_filter]:l.custom_filter;Array.prototype.forEach.call(t,function(n){typeof n=="string"&&(n=window[n]),n(d,e)})}}function mi(){var e=[".row","[data-ge-container]"];return Object.keys(S).forEach(function(t){var n=S[t],r=typeof n.cuts=="function"?n.cuts():n.cuts;r&&e.push(r)}),e.join(", ")}function pi(e){_(d,".column > .ge-content, .column > .ge-text-block > .ge-content").forEach(function(t){if(!(y(t,"ge-rte-active")||!G(t,e).length)){var n=t.getAttribute("data-ge-content-type"),r=y(t.parentElement,"ge-text-block")?t.parentElement:t,o=[],a=[];for(Array.prototype.slice.call(t.childNodes).forEach(function(m){m.nodeType===1&&m.matches(e)?(o.push({text:a},{block:m}),a=[]):a.push(m)}),o.push({text:a});t.firstChild;)t.removeChild(t.firstChild);var u=!1,c=r;o.forEach(function(m){var g;if(m.block)g=m.block;else if(gi(m.text))u?(g=rn(n),m.text.forEach(function(w){g.appendChild(w)})):(m.text.forEach(function(w){t.appendChild(w)}),g=r,u=!0);else return;g!==c&&wt(g,c),c=g}),u||r.remove()}})}function gi(e){return e.some(function(t){return t.nodeType===1||t.nodeType===3&&/\S/.test(t.nodeValue)})}function vi(e){_(d,".column").forEach(function(t){var n=[];G(t).forEach(function(r){Me(r,".ge-tools-drawer, .ge-resize-handle")||(Me(r,".ge-content, .ge-text-block")||r.matches(e)?n=hr(n):n.push(r))}),hr(n)})}function hr(e){if(e.length){var t=wt(rn(),e[e.length-1]);e.forEach(function(n){t.appendChild(n)})}return[]}function rn(e){var t=v("div",{class:"ge-content"});return e&&(k(t,"ge-content-type-"+e),t.setAttribute("data-ge-content-type",e)),t}function hi(){_(d,".column > .ge-content").forEach(function(e){kr(e,v("div",{class:"ge-text-block"}))}),_(d,".ge-text-block").forEach(function(e){if(!T(e,".ge-tools-drawer")){var t=T(e,".ge-content"),n=t?t.getAttribute("data-ge-content-type"):null;n?ro(n)||yi(e,n):wi(e)}})}function bi(){_(d,".ge-text-block").forEach(function(e){yt(e)})}function wi(e){var t=T(e,".ge-content"),n=Se(e,"ge-tools-drawer ge-text-drawer ge-plain-drawer");k(e,"ge-plain-block"),he(n),Object.keys(S).forEach(function(r){S[r].plainTools&&S[r].plainTools(n,t)}),M(n,p("tool.delete_plain"),"ge-delete-plain","bi bi-trash",function(){ve("plain",t,p("confirm.delete_plain"),function(r){Je(e,function(){e.remove(),r()})})})}function yi(e,t){var n=T(e,".ge-content"),r=Se(e,"ge-tools-drawer ge-text-drawer");he(r),M(r,p("text.no_editor",{type:t}),"ge-text-info ge-text-missing","bi bi-exclamation-triangle"),M(r,p("tool.delete_text"),"ge-delete-text","bi bi-trash",function(){ve("text",n,p("confirm.delete_text"),function(o){Je(e,function(){e.remove(),o()})})})}function Ci(e){var t=Mn(),n=rn(t.length?t[0].type:null);return e&&e.nodeType?n.appendChild(e):ft(n,e),n}function br(e){A=e,Ct.forEach(function(t){I(d,"ge-layout-"+t,t===e)}),z(Ee,"button").textContent=p($e(e))}function on(e){return typeof e=="number"?(J("changeView-index","changeView("+e+"): layout modes are identified by breakpoint key now, so pass one of "+JSON.stringify(Ct)+". Numeric indexes still work, but they mean what they meant in 2.x ("+Or.join(", ")+") and will be dropped."),Or[e]||null):Ct.indexOf(e)===-1?null:e}function wr(e){var t=on(e);if(t===null){N("changeView("+JSON.stringify(e)+"): no such layout mode");return}var n=A;br(t),t!==n&&(er().forEach(function(r){_(r,".ge-utilities").forEach(function(o){Bt(o)})}),tt(d),Z("onViewChange",t),L("view-change",{canvas:d,breakpoint:t,from:n,to:t}))}function an(){return A}function yr(e,t,n){return function(){return Ue[e]?Ue[e].apply(null,arguments):(J("plugin:"+t,e+" needs the "+t+" plugin: include dist/plugins/grideditor."+n+".js after the editor"),null)}}var Cr={getHtml:jn,getPlainHtml:ao,init:function(){Ot(le)},reset:function(){Ot(zn)},deinit:ke,destroy:lo,changeView:wr,getView:an,createRow:di,createColumn:ci,createText:function(e,t){return Ue.createText?Ue.createText(e,t):(J("plugin:text","createText needs a text editor plugin: include dist/plugins/grideditor.tinymce.js, or another editor's, after the editor"),null)},createElement:yr("createElement","elements","elements"),createSection:yr("createSection","sections","sections"),createContainer:fi,addTab:function(e,t){return gr(e,"tabs",t)},addAccordionItem:function(e,t){return gr(e,"accordion",t)},setLocale:Rr,getUtility:Hn,setUtility:Kt};Object.keys(Cr).forEach(function(e){var t=!!(Tr[e]&&Tr[e].value);i[e]=function(){if(mn)return J("destroyed:"+e,p("warning.destroyed",{method:e})),e==="getHtml"?d.innerHTML:e==="getPlainHtml"?cn(d.innerHTML):t?null:i;var n=Cr[e].apply(i,arguments);return t?n:i}}),i.canvas=d,i.settings=nn(),xt.set(d,i),so(),i.settings=nn(),Wr(),le(),C._created.forEach(function(e){e(i)})}C._created=[];C.containers={};C.features={};C.utilities={};C.texts={};C.t=_t;C._plainHtml=cn;C.Sortable=null;C.bootstrap=null;C.version="7.0.0";C.locales={en:{"tool.move":"Move","tool.settings":"Settings","tool.add_row":"Add row","tool.delete_text":"Remove text","tool.delete_plain":"Remove content","tool.convert_type":"Edit as {editor} text","text.no_editor":'No text editor "{type}" is loaded: this text can be moved and deleted, not edited',"tool.add_column":`Add column
10
+ (hold to choose the width)`,"tool.column_size":"{size} of 12","tool.column_equal":"Equal: shares what the row has left","tool.column_auto":"Auto: as wide as its content","tool.delete_row":"Remove row","tool.delete_column":"Remove col","tool.delete_container":"Remove container","tool.delete_pane":"Remove pane","tool.rename":"Double click to rename","tool.column_narrower":`Make column narrower
11
+ (hold shift for min)`,"tool.column_wider":`Make column wider
12
+ (hold shift for max)`,"tool.indent_decrease":`Decrease indent
13
+ (hold shift for none)`,"tool.indent_increase":`Increase indent
14
+ (hold shift for max)`,"tool.edit_source":"Edit Source Code","tool.preview":"Preview","panel.title":"{kind} settings","panel.close":"Close","panel.done":"Done","panel.id":"Id","panel.classes":"Classes","panel.kind_row":"Row","panel.kind_column":"Column","panel.kind_element":"Element","panel.kind_section":"Section","panel.kind_tab":"Tab","panel.kind_accordion_item":"Accordion item","tool.id_placeholder":"id","tool.id_title":"Set a unique identifier","tool.classes_placeholder":"classes","tool.classes_title":"Css classes, separated by spaces","tool.toggle_class":'Toggle "{label}" styling',"row.add":"Add row {layout}","row.add_row_cols":"Add a row of {columns} columns, {counts} per row","confirm.title":"Confirm","confirm.ok":"Delete","confirm.cancel":"Cancel","confirm.delete_row":"Delete row?","confirm.delete_column":"Delete column?","confirm.delete_text":"Delete this text?","confirm.delete_plain":"Delete this content?","confirm.delete_container":"Delete this container and everything in it?","view.all":"All sizes","view.xs":"Phone","view.sm":"Tablet","view.md":"Small desktop","view.lg":"Desktop","view.xl":"Large desktop","view.xxl":"Widescreen","utility.section":"Responsive: {view}","utility.col_width":"Width","utility.col_equal":"Equal","utility.col_auto":"Auto","utility.col_from_row":"From the row: {count}","utility.row_cols":"Columns per row","badge.row_cols":"{count} per row","badge.row_cols_auto":"As wide as their content","utility.default":"Default","utility.inherit":"Inherit: {value} (from {breakpoint})","utility.varies":"Changes at {breakpoints}; choosing here replaces that","error.sortable_missing":"SortableJS not available! Make sure you loaded the Sortable js file; dragging is off without it.","warning.setting_removed":"The {setting} setting was removed in 4.0. Use {replacement} instead.","warning.already_editing":"This element already has an editor: that one is handed back, with the options it was made with.","warning.destroyed":"{method}() was called on an editor that has been destroyed, and does nothing.","warning.duplicate_build":"grideditor.js was loaded twice: the first GridEditor is kept.","warning.plugin_6x":'The "{name}" plugin is written for grid-editor 6 and is not loaded. Plugins register on GridEditor since 7.0: see UPGRADING.md.',"warning.adapter_no_jquery":"grideditor.jquery.js needs jQuery 4, and there is no jQuery on the page: the jQuery API is not there.","error.tinymce_missing":"tinyMCE not available! Make sure you loaded the tinyMCE js file.","error.ckeditor_missing":"CKEditor not available! Make sure you loaded the CKEditor js file.","error.summernote_missing":"Summernote not available! Make sure you loaded jQuery and the Summernote js file."}};window.GridEditor?window.console&&window.console.warn&&window.console.warn("grid-editor: "+C.t({locale:"en"},"warning.duplicate_build")):window.GridEditor=C;})();