@themarioga/grid-editor 8.2.0 → 8.3.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.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
7
 
8
+ ## [8.3.0] - 2026-10-01
9
+
10
+ ### Added
11
+ - `toolbar_overflow`: the toolbar keeps to one line. The add buttons that
12
+ don't fit go behind a `⋯` button at its end, which opens them in a panel,
13
+ and come back onto the line when there is room. `'wrap'` keeps the old
14
+ behaviour of wrapping onto another line. The `tool.more` locale key is the
15
+ button's title.
16
+
8
17
  ## [8.2.0] - 2026-09-30
9
18
 
10
19
  ### Added
package/README.md CHANGED
@@ -363,6 +363,14 @@ new GridEditor('#myGrid', {
363
363
  });
364
364
  ```
365
365
 
366
+ __`toolbar_overflow`:__ What the toolbar does with the add buttons that don't fit on its line. `'menu'`, the default, keeps it to one line: the last add buttons go behind a `⋯` button at its end, which opens them in a panel, and they come back onto the line when there is room again. They are the same buttons, so a click, a drag or `toolbarItems` work on them as on the line. `'wrap'` lets the toolbar wrap onto another line, as it did before 8.3.
367
+
368
+ ```javascript
369
+ new GridEditor('#myGrid', {
370
+ toolbar_overflow: 'wrap',
371
+ });
372
+ ```
373
+
366
374
  __`active_target`:__ Whether a click in a column or a section makes it where the toolbar's buttons add. Default `false`, and the toolbar adds at the end of the canvas. With `true`, the column or section clicked last - marked with a dashed outline - gets what a button makes at its end, as if the button had been dropped there: a text or a container goes into a column as it is, and into a section in a row of its own; a row goes into a column as a nested row; a section, which only the canvas takes, goes to the canvas just after the block the target is in. The toolbar's paste button pastes there too. Escape, a click in the canvas on no column or section, or deleting the target clears it, and the toolbar adds at the end of the canvas again; dragging a button still drops it where it is let go.
367
375
 
368
376
  ```javascript
@@ -1,14 +1,14 @@
1
1
  /*!
2
- * grid-editor 8.2.0 bundled with SortableJS.
2
+ * grid-editor 8.3.0 bundled with SortableJS.
3
3
  *
4
4
  * grid-editor: MIT, https://github.com/themarioga/grid-editor
5
5
  * SortableJS: MIT, https://github.com/SortableJS/Sortable
6
6
  */
7
7
  /*! Sortable 1.15.6 - MIT | git://github.com/SortableJS/Sortable.git */
8
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 k(i,s){return i?Array.prototype.slice.call(i.querySelectorAll(s)):[]}function O(i,s){return i?i.querySelector(s):null}function _e(i,s){if(!i)return[];var g=k(i,s);return i.nodeType===1&&i.matches(s)&&g.unshift(i),g}function J(i,s){return i?Array.prototype.filter.call(i.children,function(g){return!s||g.matches(s)}):[]}function T(i,s){return J(i,s)[0]||null}function Z(i,s,g){var l=i&&i.nodeType===1?i.closest(s):null;return l&&g&&l!==g&&!g.contains(l)?null:l}function be(i,s){return!!i&&i.nodeType===1&&i.matches(s)}function ke(i){return!!i&&document.documentElement.contains(i)}function Nr(i,s){for(var g=[],l=i.nextElementSibling;l;l=l.nextElementSibling)(!s||l.matches(s))&&g.push(l);return g}function Ur(i,s){for(var g=[],l=i.parentElement;l&&l!==s;l=l.parentElement)g.push(l);return g}function Ui(i){var s=document.createElement("template");return s.innerHTML=i,Array.prototype.slice.call(s.content.childNodes)}function V(i){for(var s=Ui(i.trim()),g=0;g<s.length;g++)if(s[g].nodeType===1)return s[g];return null}function v(i,s,g){var l=document.createElement(i);return Object.keys(s||{}).forEach(function(d){var x=s[d];x!=null&&x!==!1&&l.setAttribute(d,x)}),g!=null&&(l.textContent=g),l}function Ct(i,s){return i.innerHTML=s==null?"":String(s),i}function C(i,s){return Fe(s).forEach(function(g){i.classList.add(g)}),i}function L(i,s){return Fe(s).forEach(function(g){i.classList.remove(g)}),i}function I(i,s,g){return Fe(s).forEach(function(l){g===void 0?i.classList.toggle(l):i.classList.toggle(l,!!g)}),i}function y(i,s){return!!i&&i.nodeType===1&&i.classList.contains(s)}function Fe(i){return String(i||"").split(/\s+/).filter(Boolean)}function Et(i){return i.getAttribute("class")||i.removeAttribute("class"),i}function nt(i){return i.getAttribute("style")||i.removeAttribute("style"),i}function xt(i,s){return Object.keys(s).forEach(function(g){var l=s[g];l==null?i.removeAttribute(g):i.setAttribute(g,l)}),i}function we(i,s){return Object.keys(s).forEach(function(g){var l=s[g];typeof l=="number"&&!Fi[g]&&(l=l+"px"),i.style.setProperty(g,l==null?"":String(l))}),i}var Fi={opacity:!0,"z-index":!0,"flex-grow":!0,"flex-shrink":!0,order:!0},tt={};function Hi(i){var s=i.nodeName;if(!tt[s]){var g=document.body.appendChild(document.createElement(s));tt[s]=getComputedStyle(g).display,g.remove(),tt[s]==="none"&&(tt[s]="block")}return tt[s]}function Ae(i){return i.style.removeProperty("display"),getComputedStyle(i).display==="none"&&(i.style.display=Hi(i)),i}function ue(i){return i.style.display="none",i}function vn(i,s){return s===void 0&&(s=!_t(i)),s?Ae(i):ue(i)}function _t(i){return!!(i.offsetWidth||i.offsetHeight||i.getClientRects().length)}function rt(i){return i.getBoundingClientRect().width}function kt(i){return i.getBoundingClientRect().height}function Fr(i){var s=getComputedStyle(i);return i.clientHeight-parseFloat(s.paddingTop)-parseFloat(s.paddingBottom)}function At(i){var s=i.getBoundingClientRect();return{top:s.top+window.pageYOffset,left:s.left+window.pageXOffset}}function St(i,s){return s.parentNode.insertBefore(i,s.nextSibling),i}function Tt(i){for(var s=i.parentNode;i.firstChild;)s.insertBefore(i.firstChild,i);i.remove()}function Hr(i,s){return i.parentNode.insertBefore(s,i),s.appendChild(i),s}function He(i,s,g,l,d){var x=function(b){var j=Z(b.target,g,i);if(j&&i.contains(j))return l.call(j,b)};return Fe(s).forEach(function(b){i.addEventListener(b,x,d)}),x}function ne(i,s,g,l){return Fe(s).forEach(function(d){i.addEventListener(d,g,l)}),g}function hn(i,s,g,l){Fe(s).forEach(function(d){i.removeEventListener(d,g,l)})}var Ki=400;function Kr(i,s,g,l){g=g===void 0?Ki:g;var d=function(){ue(i),l&&l()};if(!_t(i)||!i.animate||g<=0){window.setTimeout(d,0);return}var x=i.animate(s(getComputedStyle(i)),{duration:g,easing:"ease-in-out"}),b=!1,j=function(){b||(b=!0,d())};x.onfinish=j,x.oncancel=j}function ot(i,s,g){typeof s=="function"&&(g=s,s=void 0),i.style.overflow="hidden",Kr(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"),g&&g()})}function Wr(i,s,g,l){i.style.overflow="hidden",Kr(i,function(d){var x={opacity:d.opacity,height:d.height},b={opacity:0,height:"0px"};return l&&(x.width=d.width,b.width="0px"),[x,b]},s,function(){i.style.removeProperty("overflow"),g&&g()})}var Br={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},getActiveTarget:{value:!0},setActiveTarget:{}},Bi=["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"}],q="all",Vi="view.all",bn=[q].concat(h.map(function(i){return i.key})),z=12,Vr=11,wn=["equal","auto"],Ke=["1","2","3","4","5","6","auto"];function yn(i,s){return"row-cols"+(i.infix?"-"+i.infix:"")+"-"+s}function K(i){return typeof i=="number"}function Se(i,s){return s==="equal"?i.infix?"col-"+i.infix:"col":i.colPrefix+s}function X(i){for(var s=0;s<h.length;s++)if(h[s].key===i)return h[s];return null}function qr(i){if(i===q)return[h[0]];var s=X(i);return s?[s]:[]}function it(i){var s=X(i);return s?s.labelKey:Vi}var Te={add_column:{size:12,picker:!0,delay:600},elements:{enabled:"auto",selector:"[data-ge-element]",auto:!1},resize:{enabled:!0,tools:!0,handles:"e",balance:"next"},indent:{tools:!0},drag:{delay:0,touch_delay:100,threshold:3,animation:150,scroll:!0}},Xr={},qi=0,Ot=new WeakMap;function En(i,s,g){var l=E.locales,d=l[i.locale]||{},x=i.locale_strings||{},b=x[s];return b===void 0&&(b=d[s]),b===void 0&&(b=l.en[s]),b===void 0&&(Xi("locale:"+s,'no string for "'+s+'" in any locale, showing the key'),b=s),b.replace(/\{(\w+)\}/g,function(j,ye){return g&&g[ye]!==void 0?g[ye]:j})}function N(i){window.console&&window.console.warn&&window.console.warn("grid-editor: "+i)}function Xi(i,s){Xr[i]||(Xr[i]=!0,N(s))}function Gi(i,s){return En({locale:"en"},i,s)}function Yi(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 de(i){return typeof i=="string"?document.querySelector(i):i&&i.nodeType===1?i:null}function Gr(){return E.Sortable||window.Sortable||null}function at(){var i=E.bootstrap||window.bootstrap;return i&&i.Modal?i.Modal:null}function Cn(i){var s=document.implementation.createHTMLDocument("").body;s.innerHTML=i;var g=[];return k(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 x=(l.getAttribute("class")||"").split(/\s+/).filter(Boolean),b=x.filter(function(j){return j!=="column"&&j.indexOf("ge-")!==0});b.length!==x.length&&(d=!0),b.length?l.setAttribute("class",b.join(" ")):l.removeAttribute("class"),d&&l.tagName==="DIV"&&!l.attributes.length&&g.push(l)}),g.forEach(function(l){Tt(l)}),s.innerHTML}function E(i,s){var g=Yi(i),l=Ot.get(g);if(l)return Yr.has(g)||(Yr.add(g),N(Gi("warning.already_editing"))),l;if(!(this instanceof E))return new E(g,s);Ji(this,g,s||{})}var Yr=new WeakSet;E.create=function(i,s){return new E(i,s)};E.get=function(i){var s=de(i);return s&&Ot.get(s)||null};function Ji(i,s,g){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",active_target:!1,element_tools:[],element_classes:[],container_classes:[],pane_classes:[],container_tools:[],tab_tools:[],accordion_tools:[],plugins:null,row_cols:!0,utilities:{},elements:Te.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:Te.add_column,layout_modes:bn.slice(),default_view:q,resize:Te.resize,indent:Te.indent,source_textarea:"",edit_source:!0,locale:"en",locale_strings:{},callbacks:{},confirm_delete:!0,settings_panel:"offcanvas",drag:Te.drag},g);Object.keys(Te).forEach(function(e){l[e]=Object.assign({},Te[e],l[e])});var d,x,b,j,ye,Oe,G,S=l.default_view,U=null,$=null,Le=!1,Me=null,D=null,xn={},Lt=[],Jr=++qi,_n=!1,kn=new WeakMap,Mt=new WeakMap,lt=new WeakMap,An=new WeakMap,Pt=new WeakSet,Sn=new AbortController;d=C(s,"ge-canvas");function ee(e,t){xn[e]||(xn[e]=!0,N(t))}function m(e,t){return En(l,e,t)}function $r(e){l.locale=e,i.settings=fn(),Tn(),pr(),br(),x.remove(),zn(),Wn()}var We=0,zt=[];function Q(e,t,n){return Object.assign({kind:e,node:t,parent:t.parentElement,canvas:d,breakpoint:pn(),source:"api"},n||{})}function M(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 W(e){We++;try{return e()}finally{if(We--,We===0)for(;zt.length;)zt.shift()()}}function jt(e){if(We===0){e();return}zt.push(e)}function te(e,t,n,r){var o=Qr(e);return W(function(){var a=Q(e,t,r);return M("before-add-"+o,a)?(n(),fe(),M("after-add-"+o,a),t):null})}function Qr(e){return E.containers[e]?"container":e}function Zr(e,t){if(!l.confirm_delete){t();return}var n=at();if(!n){window.confirm(e)&&t();return}var r=eo(),o=!1;O(r,".ge-confirm-message").textContent=e,O(r,".ge-confirm-ok").onclick=function(){o=!0,n.getInstance(r).hide()},ce.hidden=function(){o&&t()},ce.shown=function(){O(r,".ge-confirm-ok").focus()},n.getOrCreateInstance(r).show()}var ce={hidden:null,shown:null};function eo(){return U||(U=V('<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(U),O(U,".modal-title").textContent=m("confirm.title"),O(U,".btn-close").setAttribute("aria-label",m("confirm.cancel")),O(U,".ge-confirm-cancel").textContent=m("confirm.cancel"),O(U,".ge-confirm-ok").textContent=m("confirm.ok"),On(U),U.addEventListener("hidden.bs.modal",function(){ce.hidden&&ce.hidden()}),U.addEventListener("shown.bs.modal",function(){ce.shown&&ce.shown()}),U)}function Tn(){U&&(ce.hidden=null,ce.shown=null,It(U),U=null)}function It(e){var t=at(),n=t?t.getInstance(e):null,r=!1,o=function(){r||(r=!0,n&&n.dispose(),e.remove())};if(!n||!Dt.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 Dt=new WeakMap;function On(e){ne(e,"show.bs.modal hide.bs.modal",function(){Dt.set(e,!0)}),ne(e,"shown.bs.modal hidden.bs.modal",function(){Dt.set(e,!1)})}function Ce(e,t,n,r){W(function(){var o=Q(e,t,{source:"tool"});M("before-delete",o)&&Zr(n,function(){W(function(){r(function(){t.remove(),W(function(){fe(),M("after-delete",o)})})})})})}function Rt(e,t,n){if(n=n||S,n!==q){var r=X(n),o=ht({size:t,offset:pt(e,r)||0});return o.refused||Re(e,r)===o.size?null:{writes:[{tier:r,size:o.size}],cleared:null,size:o.size}}var a=h.some(function(p){return ht({size:t,offset:pt(e,p)||0}).refused});if(a)return null;var u=h[0],c=[],f=[];return h.slice(1).forEach(function(p){var w=Re(e,p);w!==null&&(c.push({tier:p,size:null}),f.push({breakpoint:p.key,value:w}))}),Re(e,u)!==t&&c.unshift({tier:u,size:t}),c.length?{writes:c,cleared:f,size:t}:null}function Nt(e,t){t.writes.forEach(function(n){vt(e,n.tier,n.size)}),et(e)}function Ut(e,t){return t&&(e.cleared=t),e}function Ft(e,t,n,r){r=r||S;var o=Ge(e),a=Rt(e,t,r);return a?W(function(){var u=Q("column",e,Ut({source:n,breakpoint:r,from:o,to:a.size},a.cleared));return M("before-resize",u)?(Nt(e,a),ie(e),M("after-resize",u),!0):(ie(e),!1)}):!1}function Ln(e,t,n){var r=S===q,o=r?h[0]:X(S),a=Je(e);t=Math.min(Math.max(t,0),Vr);var u=r?h.slice(1).filter(function(c){return gt(e,c)!==null}):[];return(gt(e,o)||0)===t&&!u.length?!1:W(function(){var c=Q("column",e,Ut({source:n,from:a,to:t},r?u.map(function(f){return{breakpoint:f.key,value:gt(e,f)}}):null));return M("before-indent",c)?(ln(e,o,t),u.forEach(function(f){ln(e,f,0)}),(r?h:[o]).forEach(function(f){var p=an(e,f);if(K(p)){var w=ht({size:p,offset:t,leading:"offset"});w.size!==p&&vt(e,f,w.size)}}),ie(e),M("after-indent",c),!0):!1})}function Ht(e){var t=e.parentElement;return{parent:t,index:J(t).filter(function(n){return!y(n,"ge-tools-drawer")}).indexOf(e)}}function re(e){var t=null;return Object.keys(A).forEach(function(n){var r=A[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 Be=de(l.source_textarea).value,Mn=v("div");Mn.innerHTML=Be,Be.length>0&&!Mn.querySelector(".row")&&(Be='<div class="row"><div class="col-lg-12">'+Be+"</div></div>"),Ct(s,Be)}if(s.children.length&&!s.querySelector("div.row")){var to=J(s),Pn=V('<div class="row"><div class="col-lg-12"></div></div>');s.appendChild(Pn),to.forEach(function(e){Pn.firstChild.appendChild(e)})}function no(){G=v("textarea",{class:"ge-html-output"}),d.parentNode.insertBefore(G,d),zn();var e={signal:Sn.signal};if(window.addEventListener("scroll",go,e),He(d,"click",".ge-content",po,e),He(d,"click",".ge-popup-trigger, [data-ge-popup-target]",function(n){y(d,"ge-editing")&&n.preventDefault()},e),l.active_target){var t=null;d.addEventListener("pointerdown",function(n){t={x:n.clientX,y:n.clientY}},e),d.addEventListener("click",function(n){var r=t;if(t=null,!!y(d,"ge-editing")&&!(r&&Math.abs(n.clientX-r.x)+Math.abs(n.clientY-r.y)>l.drag.threshold)){var o=Z(n.target,Vn());Pe(o&&o!==d&&d.contains(o)?o:null)}},e),document.addEventListener("keydown",function(n){if(!(n.key!=="Escape"||!D||F||le)){var r=document.activeElement;r&&(be(r,"input, textarea, select")||r.isContentEditable)||Pe(null)}},e)}}function ro(e){!be(e,".ge-content")||!d.contains(e)||(oe("onContentReady",e),qe(e))}function zn(){x=v("div",{class:"ge-mainControls"}),G.parentNode.insertBefore(x,G),b=x.appendChild(v("div",{class:"ge-wrapper ge-top"})),j=b.appendChild(v("div",{class:"ge-addRowGroup btn-group"})),ye=v("div",{class:"ge-addContainerGroup btn-group ms-1"}),l.new_row_layouts.forEach(function(u){var c=!Array.isArray(u),f=v("a",{class:"btn btn-sm btn-primary",title:c?m("row.add_row_cols",{columns:u.columns,counts:fo(u.row_cols)}):m("row.add",{layout:u.join("-")}),"data-ge-toolbar":"row","data-ge-layout":c?JSON.stringify(u):u.join(",")});f.addEventListener("click",function(){if(D){Vt(f,"tool");return}var _=Ve(u),xe=te("row",_,function(){d.appendChild(_)},{parent:d,source:"tool"});xe&&_.scrollIntoView&&_.scrollIntoView({behavior:"smooth"})}),j.appendChild(f),f.appendChild(V('<i class="bi bi-plus"></i>'));var p=c?mo(u):u,w='<div class="row ge-row-icon">';p.forEach(function(_){w+='<div class="column '+Se(h[0],_)+'"></div>'}),w+="</div>",f.appendChild(V(w))}),b.appendChild(ye),Object.keys(R).forEach(function(u){var c=R[u],f=jn(v("a",{class:"btn btn-sm btn-primary ge-add-container"}),m(c.labelKey),c.iconClass);xt(f,{"data-ge-toolbar":"container","data-ge-container-type":u}),f.addEventListener("click",function(){if(D){Vt(f,"tool");return}var p=Ne(),w=p.appendChild(he(z)),_=w.appendChild(c.create({}));te(u,_,function(){d.appendChild(p)},{parent:d,source:"tool"})}),ye.appendChild(f)});var e=[];Object.keys(A).forEach(function(u){(A[u].toolbar||[]).forEach(function(c,f){var p=oo(u,c,f);c.align==="end"?e.push(p):ye.appendChild(p)})}),Oe=V('<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>'),He(Oe,"click","a",function(){Ir(this.getAttribute("data-ge-view"))}),b.appendChild(Oe),l.layout_modes.forEach(function(u){O(Oe,".dropdown-menu").appendChild(v("a",{class:"dropdown-item","data-ge-view":u,title:m(it(u))},m(it(u))))}),O(Oe,"button").textContent=m(it(S));var t=b.appendChild(v("div",{class:"btn-group pull-right"}));if(l.edit_source){var n=V('<button type="button" class="btn btn-sm btn-primary gm-edit-mode"><i class="bi bi-code-slash"></i></button>');n.setAttribute("title",m("tool.edit_source")),I(n,"active btn-danger",Le),n.addEventListener("click",function(){Le?Bn():bo(),I(n,"active btn-danger",Le)}),t.appendChild(n)}var r=V('<button type="button" class="btn btn-sm btn-primary gm-preview"><i class="bi bi-eye-fill"></i></button>'),o=function(){y(r,"active")||C(d,"ge-editing")};if(r.setAttribute("title",m("tool.preview")),r.addEventListener("mouseenter",function(){L(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)})}ao()}function jn(e,t,n){return e.setAttribute("title",t),n?(e.appendChild(v("i",{class:n})),e):(e.appendChild(V('<i class="bi bi-plus"></i>')),e.appendChild(v("span",{},t)),e)}function oo(e,t,n){var r=t.iconClass||(t.align==="end"?"bi bi-plus":null),o=typeof t.label=="function"?t.label():t.label||m(t.labelKey),a=jn(v("a",{class:"btn btn-sm btn-primary ge-add-container ge-add-feature"}),o,r);return C(a,t.className||""),xt(a,{"data-ge-toolbar":"feature","data-ge-feature":e,"data-ge-item":n}),a.addEventListener("click",function(){if(D){Vt(a,t.source||"tool");return}var u=t.create(),c=t.inColumn?Kt(u):u,f=te(t.kind,u,function(){d.appendChild(c)},{parent:d,source:t.source||"tool"});f&&t.inColumn&&c.scrollIntoView&&c.scrollIntoView({behavior:"smooth"})}),a}function io(){return l.toolbar_drag==="auto"?l.drag_handle==="drawer":!!l.toolbar_drag}function ao(){var e=k(x,"[data-ge-toolbar]");e.forEach(function(t){L(t,"ge-palette-button"),t.removeEventListener("pointerdown",In)}),io()&&e.forEach(function(t){C(t,"ge-palette-button"),t.addEventListener("pointerdown",In)})}function In(e){var t=e.currentTarget,n=e.pageX,r=e.pageY,o=null;if(e.button)return;function a(f){return Math.abs(f.pageX-n)+Math.abs(f.pageY-r)>l.drag.threshold}function u(f){if(!o){if(!a(f))return;o=C(t.cloneNode(!0),"ge-toolbar-helper"),document.body.appendChild(o),C(d,"ge-dropping")}we(o,{left:f.pageX-14,top:f.pageY-14}),so(f.pageX,f.pageY)}function c(f){if(document.removeEventListener("pointermove",u),hn(document,"pointerup pointercancel",c),!!o){o.remove(),L(d,"ge-dropping"),Wt();var p=function(_){_.target!==t&&!t.contains(_.target)||(_.preventDefault(),_.stopImmediatePropagation())};window.addEventListener("click",p,{capture:!0,once:!0}),window.setTimeout(function(){window.removeEventListener("click",p,{capture:!0})},0);var w=Dn(f.pageX,f.pageY);w&&Rn(t,w)}}document.addEventListener("pointermove",u),ne(document,"pointerup pointercancel",c)}function Dn(e,t){var n=e-window.scrollX,r=t-window.scrollY,o=document.elementFromPoint(n,r);if(!o)return null;var a=Z(o,[".column",".ge-canvas"].concat(bt("regions")).join(", "));if(!a||a!==d&&!d.contains(a))return null;var u=null;return J(a,un()).forEach(function(c){if(!u){var f=c.getBoundingClientRect();r<f.top+f.height/2&&(u=c)}}),{region:a,before:u}}function lo(e,t,n){var r=A[e.getAttribute("data-ge-feature")].toolbar[parseInt(e.getAttribute("data-ge-item"),10)],o=r.create(),a=o;if(r.inColumn)be(t.region,".column")||(a=Kt(o));else if(!dn(t.region,o)){var u=t.region===d?[]:Ur(t.region,d).reverse().concat([t.region]),c=u[0]||null;t={region:d,before:c?c.nextElementSibling:null}}return te(r.kind,o,function(){t.before?t.before.parentNode.insertBefore(a,t.before):t.region.appendChild(a)},{parent:t.region,source:r.source||n||"dragdrop"})}function Kt(e){var t=Ne();return t.appendChild(he(z)).appendChild(e),t}function so(e,t){var n=Dn(e,t);if(!n)return Wt();Me||(Me=v("div",{class:"ge-drop-marker"})),n.before?n.before.parentNode.insertBefore(Me,n.before):n.region.appendChild(Me)}function Wt(){Me&&Me.remove()}function Rn(e,t,n){if(e.getAttribute("data-ge-toolbar")==="feature")return lo(e,t,n);var r=e.getAttribute("data-ge-toolbar")==="container",o=e.getAttribute("data-ge-container-type"),a=r?R[o].create({}):co(e.getAttribute("data-ge-layout")),u=a;return r&&!be(t.region,".column")&&(u=Kt(a)),te(r?o:"row",a,function(){t.before?t.before.parentNode.insertBefore(u,t.before):t.region.appendChild(u)},{parent:t.region,source:n||"dragdrop"})}function uo(){for(var e=[],t=1;t<=z;t++)e.push(String(t));return{name:"col",values:e.concat(wn),appliesTo:["column"],labelKey:"utility.col_width",className:function(n,r){return Se(X(n),Bt(r))},choices:function(){return l.valid_col_sizes.map(String)},label:function(n){return n==="equal"?m("utility.col_equal"):n==="auto"?m("utility.col_auto"):n},write:function(n,r,o,a){return Ft(n,r===null?null:Bt(r),a,o)},blank:function(n,r){var o=r===q?null:mt(n,X(r));return o?m("utility.col_from_row",{count:Er(o.value)}):null}}}function Bt(e){return/^\d+$/.test(String(e))?parseInt(e,10):e}function co(e){return/^\s*\{/.test(e||"")?Ve(JSON.parse(e)):Ve((e||"").split(",").filter(function(t){return t!==""}).map(Bt))}function Ve(e){var t=Ne();if(Array.isArray(e))return e.forEach(function(r){t.appendChild(he(r))}),t;Object.keys(e.row_cols||{}).forEach(function(r){var o=e.row_cols[r],a=X(r);a&&Ke.indexOf(String(o))!==-1&&C(t,yn(a,o))});for(var n=0;n<(e.columns||0);n++)t.appendChild(he(null));return t}function fo(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 mo(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 go(){var e=window.pageYOffset;e>At(x).top&&e<At(d).top+Fr(d)?y(b,"ge-top")&&(we(b,{left:At(b).left,width:rt(b)}),L(b,"ge-top"),C(b,"ge-fixed")):y(b,"ge-fixed")&&(we(b,{left:"",width:""}),L(b,"ge-fixed"),C(b,"ge-top"))}function po(){var e=this;if(!e.getAttribute("data-ge-content-type")&&!ae()&&_t(e)){var t=Kn();t.length&&(t.length===1?Nn(e,t[0]):vo(e,t))}}function Nn(e,t){return t.available&&!t.available()?(t.missingKey&&console.error(m(t.missingKey)),!1):W(function(){var n=Q("plain",e,{source:"tool",from:"plain",to:t.type});if(!M("before-convert",n))return!1;C(e,"ge-content-type-"+t.type),e.setAttribute("data-ge-content-type",t.type);var r=e.parentElement;return y(r,"ge-text-block")&&(L(r,"ge-plain-block"),J(r,".ge-tools-drawer").forEach(function(o){o.remove()})),M("after-convert",n),t.edit(e),!0})}function vo(e,t){var n=y(e.parentElement,"ge-text-block")?e.parentElement:null;n&&Un(T(n,".ge-tools-drawer"),t.map(function(r){return{label:r.label,title:m("tool.convert_type",{editor:r.label}),attributes:{"data-ge-content-type":r.type},choose:function(){Nn(e,r)}}}),"ge-text-picker ge-convert-picker",n)}function Un(e,t,n,r){if(ae(),!!e){var o=Z(e,".ge-tools-drawer");o&&C(o,"ge-picker-open"),$=e.appendChild(C(v("div",{class:"ge-size-picker"}),n||"")),t.forEach(function(a){var u=xt(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(),ae(),a.choose()}),$.appendChild(u)}),Fn(r||e)}}function Fn(e){e.addEventListener("mouseleave",function(){window.setTimeout(function(){$&&!$.matches(":hover")&&ae()},400)},{once:!0})}function Hn(){var e={},t=[];return Object.keys(A).forEach(function(n){var r=A[n];r.textTypes&&(r.textTypes()||[]).forEach(function(o){if(e[o.type]){e[o.type]!==n&&ee("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 Kn(){return Hn().filter(function(e){return e.offered!==!1})}function ho(e){return Hn().some(function(t){return t.type===e})}function Wn(){ze(),fe()}function bo(){ze(),Pe(null),G.style.height=.8*document.documentElement.clientHeight+"px",G.value=d.innerHTML,Ae(G),ue(d),Le=!0,oe("onSourceOpen",G)}function Bn(){oe("onSourceClose",G),Le=!1,Ct(d,G.value),Ae(d),fe(),ue(G)}function Vn(){return[".column"].concat(bt("regions")).join(", ")}function wo(e){return!!e&&e!==d&&d.contains(e)&&be(e,Vn())}function Pe(e){if(e!==D){var t=D;t&&L(t,"ge-active-target"),D=e,e&&y(d,"ge-editing")&&C(e,"ge-active-target"),M("target-change",{canvas:d,target:e,from:t})}}function Vt(e,t){var n=Rn(e,{region:D,before:null},t);n&&n.scrollIntoView&&n.scrollIntoView({behavior:"smooth"})}function fe(){F&&!ke(F.node)&&ve(),le&&le.home&&!ke(le.home)&&se(),Pr(!0),C(d,"ge-editing"),I(d,"ge-drag-drawer",l.drag_handle==="drawer"),ai();var e=Oi();Li(e),Pi(e),zi(),Go(),Yo(),No(),oe("onInit"),mi(),hi(),jr(S),qe(d),D&&!d.contains(D)?Pe(null):D&&C(D,"ge-active-target")}function ze(){ve(),L(d,"ge-editing ge-drag-drawer ge-dropping"),D&&L(D,"ge-active-target"),oe("onBeforeDeinit"),ae(),Wt(),se(),k(d,".ge-tools-drawer").forEach(function(e){e.remove()}),ut.clear(),ji(),oe("onDeinit"),$t(d),k(d,"[data-ge-row-cols]").forEach(function(e){e.removeAttribute("data-ge-row-cols")}),Uo(),ki(),yi(),Pr(!1)}function qn(){ze(),et(d);var e=d.innerHTML;return fe(),e}function yo(e){ze(),et(e);var t=e.outerHTML;return fe(),t}function Co(){return Cn(qn())}function Eo(){Le&&Bn(),ze(),D=null,Tn(),pr(),br(),x.remove(),G.remove(),Sn.abort(),Ot.delete(d),_n=!0}function xo(){var e=_o();Xt("grid",{},uo()),l.row_cols!==!1&&Xt("grid",{},di());var t=function(r){return!l.plugins||l.plugins.indexOf(r)!==-1},n=function(r,o){return o.always===!0||t(r)};Object.keys(E.containers).forEach(function(r){t(r)&&(R[r]=E.containers[r](e))}),Object.keys(E.features).forEach(function(r){var o=E.features[r];n(r,o)&&(A[r]=o(e))}),Object.keys(E.utilities).forEach(function(r){t(r)&&(B[r]=E.utilities[r](e),(B[r].families||[]).forEach(function(o){Xt(r,B[r],o)}))}),Object.keys(A).forEach(function(r){var o=A[r].methods||{};Object.keys(o).forEach(function(a){Xe[a]=o[a]})}),(l.plugins||[]).forEach(function(r){R[r]||A[r]||B[r]||ee("plugin:"+r,'the "'+r+'" plugin is not loaded: include dist/plugins/grideditor.'+r+".js after the editor")})}function oe(e,t){[R,A,B].forEach(function(n){Object.keys(n).forEach(function(r){n[r][e]&&n[r][e](t)})})}function _o(){return{canvas:d,settings:l,t:m,warn:N,containerId:Do,defaultRegion:Ro,createTool:P,createMoveTool:Ee,addSettingsTool:Qe,deleteNode:Ce,place:yt,createPaneControls:Ho,makeLabelEditable:Ko,labelIn:Wo,unwrapLabels:Bo,suspendToggles:ir,resumeToggles:ar,emit:M,payloadFor:Q,operate:W,kindOf:re,view:pn,viewTiers:function(){return qr(S).map(function(e){return e.key})},breakpoints:h.map(function(e){return e.key}),getUtility:Zn,setUtility:Jt,utilityField:Io,bareStyle:To,hostStyle:er,setHostStyle:zo,openDialog:hr,closeDialog:se,rowFromLayout:Ve,nodeHtml:yo,textReady:ro,attachPicker:sr,openPicker:Un,closePicker:ae,detailsOf:mr,drawerOf:ko,toolbarItems:function(e){return x?k(x,'[data-ge-toolbar="feature"][data-ge-feature="'+e+'"]'):[]}}}function ko(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 me={},Ao=".row, .column, .ge-content, .ge-element, [data-ge-container]",je="data-ge-preview",qt=!1;function Xt(e,t,n){var r=n.name||n.prefix;if(me[r]){N('the "'+e+'" plugin declares the utility "'+r+'", which the "'+me[r].plugin+'" plugin already declared: ignored');return}me[r]={plugin:e,family:Object.assign({},n,{name:r,values:n.values.map(String),appliesTo:n.appliesTo||t.appliesTo||["row","column"]})}}function st(e,t){return me[e]?me[e].family:(ee("utility:"+e,t+"("+JSON.stringify(e)+"): no loaded plugin declares that utility"),null)}function Xn(e,t){return t==="plain"&&(t="text"),e.appliesTo.indexOf(t)!==-1?!0:!!R[t]&&e.appliesTo.indexOf("container")!==-1}function Gn(e){return Object.keys(me).map(function(t){return me[t].family}).filter(function(t){return Xn(t,e)})}function Gt(e,t,n){return e.className?e.className(t.key,n):e.prefix+(t.infix?"-"+t.infix:"")+"-"+n}function ge(e,t,n){for(var r=(e.getAttribute("class")||"").split(/\s+/),o=0;o<t.values.length;o++)if(r.indexOf(Gt(t,n,t.values[o]))!==-1)return t.values[o];return null}function Yn(e,t,n){for(var r=h.indexOf(n)-1;r>=0;r--){var o=ge(e,t,h[r]);if(o!==null)return{tier:h[r],value:o}}return null}function Jn(e,t,n){var r=ge(e,t,n);if(r!==null)return r;var o=Yn(e,t,n);return o?o.value:null}function Yt(e,t){return h.map(function(n){return{tier:n,value:ge(e,t,n)}}).filter(function(n){return n.value!==null})}function $n(e,t,n,r){t.values.forEach(function(o){L(e,Gt(t,n,o))}),r!==null&&C(e,Gt(t,n,r)),Et(e)}function Qn(e,t,n){return n===q?ge(e,t,h[0]):Jn(e,t,X(n))}function So(e,t,n,r){if(n!==q){var o=X(n);return ge(e,t,o)===r?null:{writes:[{tier:o,value:r}],cleared:[]}}var a=[],u=[];return Yt(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}))}),ge(e,t,h[0])!==r&&a.unshift({tier:h[0],value:r}),a.length?{writes:a,cleared:u}:null}function Zn(e,t,n){e=de(e);var r=st(t,"getUtility");if(!r||!e)return null;var o=n===void 0?S:gn(n);return o===null?(N("getUtility("+JSON.stringify(n)+"): no such layout mode"),null):Qn(e,r,o)}function Jt(e,t,n,r){r=typeof r=="string"?{view:r}:r||{},e=de(e);var o=st(t,"setUtility");if(!o||!e)return!1;var a=r.view===void 0?S:gn(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=re(e);if(!Xn(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=So(e,o,a,n);return c?W(function(){var f=Q(u,e,{family:t,breakpoint:a,tiers:c.writes.map(function(p){return p.tier.key}),from:Qn(e,o,a),to:n,cleared:c.cleared,source:r.source||"api"});return M("before-utility",f)?(c.writes.forEach(function(p){$n(e,o,p.tier,p.value)}),ie(e),M("after-utility",f),!0):(ie(e),!1)}):!1}function To(e,t,n){var r=st(t,"bareStyle");if(e=de(e),!r||!e)return null;var o=e.getAttribute("class");h.forEach(function(u){$n(e,r,u,null)});var a=getComputedStyle(e).getPropertyValue(n);return o===null?e.removeAttribute("class"):e.setAttribute("class",o),a}function ie(e){var t=mr(e);if(t){var n=O(t,".ge-classes");n&&(n.value=tn(e).join(" ")),J(t,".ge-utilities").forEach(function(r){Qt(r)})}nr(e),qe(e)}function Oo(e){return _e(e,Ao)}function qe(e){$t(e),S!==q&&Lo(e,X(S)),ui(e),oe("onRefresh",e)}function Lo(e,t){Oo(e).forEach(function(n){var r=re(n),o={};Gn(r).forEach(function(a){!a.preview||!Yt(n,a).length||Object.assign(o,a.preview(Jn(n,a,t),n,r))}),r==="column"&&Object.assign(o,si(n,t)),Object.keys(B).forEach(function(a){var u=B[a];u.preview&&Object.assign(o,u.preview(n,r,t.key))}),Object.keys(o).length&&Mo(n,o)})}function Mo(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(je,JSON.stringify(r))}function $t(e){_e(e,"["+je+"]").forEach(function(t){var n=t.style,r={};try{r=JSON.parse(t.getAttribute(je))||{}}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(je),nt(t)})}function Po(e){var t=document.createElement("div"),n={};t.style.cssText=e.style.cssText;try{n=JSON.parse(e.getAttribute(je))||{}}catch(r){}return Object.keys(n).forEach(function(r){var o=n[r];o&&o[0]?t.style.setProperty(r,o[0],o[1]):t.style.removeProperty(r)}),t.style}function er(e,t){var n=Po(e);return t===void 0?n.cssText:{value:n.getPropertyValue(t),priority:n.getPropertyPriority(t)}}function zo(e,t,n,r){if(n=n==null?"":String(n).trim(),r===void 0&&(r=er(e,t).priority),n!==""){var o=document.createElement("div").style;if(o.setProperty(t,n,r||""),o.getPropertyValue(t)==="")return!1}var a=e.hasAttribute(je);return a&&$t(e),n===""?e.style.removeProperty(t):e.style.setProperty(t,n,r||""),nt(e),a&&qe(e),!0}function jo(e){var t=re(e),n=Gn(t).filter(function(u){return u.panel!==!1}).map(function(u){return tr(e,u)});if(Object.keys(B).forEach(function(u){var c=B[u],f=c.panel?c.panel(e,t):null;f&&n.push(f)}),!n.length)return null;var r=I(v("div",{class:"ge-utilities"}),"ge-open",qt);An.set(r,e);var o=r.appendChild(v("a",{class:"ge-utilities-toggle"}));o.addEventListener("click",function(){qt=!y(r,"ge-open"),gr().forEach(function(u){k(u,".ge-utilities").forEach(function(c){I(c,"ge-open",qt)})})});var a=r.appendChild(v("div",{class:"ge-utilities-body"}));return n.forEach(function(u){a.appendChild(u)}),Qt(r),r}function tr(e,t){var n=v("label",{class:"ge-utility","data-ge-family":t.name});n.appendChild(v("span",{class:"ge-utility-label"},t.labelKey?m(t.labelKey):t.name));var r=n.appendChild(v("select",{class:"form-select form-select-sm"}));return r.addEventListener("change",function(){Jt(e,t.name,this.value,{source:"panel"})}),n.appendChild(v("small",{class:"ge-utility-note"})),n}function Io(e,t){var n=st(t,"utilityField");if(!n)return null;var r=tr(e,n);return Zt(r,e),ut.set(r,e),r}var ut=new Map;function nr(e){ut.forEach(function(t,n){if(!n.isConnected){ut.delete(n);return}e&&t!==e||Z(n,".ge-utilities")||Zt(n,t)})}function Qt(e){var t=An.get(e);J(e,".ge-utilities-toggle").forEach(function(n){n.textContent=m("utility.section",{view:m(it(S))})}),k(e,".ge-utility").forEach(function(n){Zt(n,t)})}function Zt(e,t){var n=me[e.getAttribute("data-ge-family")].family,r=T(e,"select"),o=n.choices?n.choices(t,re(t)):n.values,a,u,c="";if(r.innerHTML="",S===q){a=ge(t,n,h[0]),u=m("utility.default");var f=Yt(t,n).filter(function(Ue){return Ue.tier!==h[0]});f.length&&(c=m("utility.varies",{breakpoints:f.map(function(Ue){return Ue.tier.key}).join(", ")}))}else{var p=X(S),w=Yn(t,n,p);a=ge(t,n,p),u=w?m("utility.inherit",{value:rr(n,w.value),breakpoint:w.tier.key}):m("utility.default");var _=n.blank?n.blank(t,S):null;_&&a===null&&(u=_)}a!==null&&o.indexOf(a)===-1&&(o=o.concat([a])),r.appendChild(v("option",{value:""},u)),o.forEach(function(Ue){r.appendChild(v("option",{value:Ue},rr(n,Ue)))}),r.value=a===null?"":a;var xe=T(e,".ge-utility-note");xe.textContent=c,vn(xe,c!=="")}function rr(e,t){return e.label?e.label(t):t}var R={},A={},B={},Xe={},or=0;function Do(e){return or++,"ge-"+e+"-"+or+"-"+Math.random().toString(36).slice(2,6)}function Ro(){var e=Ne();return e.appendChild(he(z)),e}function Ie(e){return e?e.getAttribute("data-ge-container"):null}function No(){k(d,"[data-ge-container]").forEach(function(e){var t=Ie(e),n=R[t];if(!n){ee("container:"+t,'unknown container type "'+t+'"');return}C(e,"ge-container ge-container-"+t),n.mark(e),T(e,".ge-tools-drawer")||Fo(e,t,n)})}function Uo(){k(d,"[data-ge-container]").forEach(function(e){var t=R[Ie(e)];t&&t.unmark(e),L(e,"ge-container ge-container-"+Ie(e)),Et(e)})}function De(e,t){var n=v("div",{class:t});return e.insertBefore(n,e.firstChild),n}function dt(e,t){(t||[]).forEach(function(n){P(e,n.title||"",n.className||"",n.iconClass||"bi bi-wrench",n.on)})}function Fo(e,t,n){var r=De(e,"ge-tools-drawer ge-container-drawer");Ee(r),Qe(r,e,l.container_classes),dt(r,l.container_tools),n.tools&&n.tools(r,e),P(r,m("tool.delete_container"),"ge-delete-container","bi bi-trash",function(){Ce(t,e,m("confirm.delete_container"),function(o){ot(e,o)})}),n.addPane&&P(r,m(n.addPaneKey),"ge-add-pane","bi bi-plus-circle",function(){var o=n.addPane(e,{});te(n.paneKind,o,function(){},{parent:e,source:"tool",container:e})})}function Ho(e,t,n,r,o){var a=De(e,"ge-tools-drawer ge-pane-drawer");return Ee(a),Qe(a,e,l.pane_classes),dt(a,n),P(a,m("tool.delete_pane"),"ge-delete-pane","bi bi-trash",function(){Ce(t,e,r,function(u){o(u)})}),a}function ir(e){e&&_e(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 ar(e){e&&_e(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 Ko(e){if(!Pt.has(e)){var t=Z(e,"[data-bs-toggle], [data-ge-bs-toggle]");Pt.add(e),e.setAttribute("title",m("tool.rename")),e.addEventListener("dblclick",function(n){n.preventDefault(),n.stopPropagation(),ir(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"),ar(t)})}}function Wo(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 Bo(e){k(e,".ge-pane-label").forEach(function(t){Pt.delete(t),Tt(t)})}function lr(e,t){var n=he(t);return te("column",n,function(){e.appendChild(n)},{parent:e,source:"tool"})}function Vo(e,t){!l.add_column.picker||!e||sr(e,function(){qo(e,t)})}function sr(e,t){var n=null,r=function(){window.clearTimeout(n),n=null};ne(e,"mouseenter mousedown",function(){n||$||(n=window.setTimeout(function(){n=null,t()},l.add_column.delay))}),ne(e,"mouseleave mouseup",r)}function qo(e,t){ae();var n=sn(t,pe()),r=Z(e,".ge-tools-drawer");r&&C(r,"ge-picker-open"),$=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:Xo(o)},K(o)?o:Se(h[0],o));I(a,"ge-size-tight",K(o)&&o>n),I(a,"ge-size-flex",!K(o)),a.addEventListener("click",function(u){u.preventDefault(),u.stopPropagation(),ae(),lr(t,o)}),$.appendChild(a)}),Fn(e)}function Xo(e){return e==="equal"?m("tool.column_equal"):e==="auto"?m("tool.column_auto"):m("tool.column_size",{size:e})}function ae(){if(!$)return!1;var e=Z($,".ge-tools-drawer");return e&&L(e,"ge-picker-open"),$.remove(),$=null,!0}function Go(){k(d,".row").forEach(function(e){if(!T(e,".ge-tools-drawer")){var t=De(e,"ge-tools-drawer");Ee(t),Qe(t,e,l.row_classes),dt(t,l.row_tools),P(t,m("tool.delete_row"),"ge-delete-row","bi bi-trash",function(){Ce("row",e,m("confirm.delete_row"),function(n){ot(e,n)})}),P(t,m("tool.add_column"),"ge-add-column","bi bi-plus-circle",function(){ae()||lr(e,Ze(e,pe())?null:l.add_column.size)}),Vo(T(t,".ge-add-column"),e)}})}function Yo(){k(d,".column").forEach(function(e){if(!T(e,".ge-tools-drawer")){var t=De(e,"ge-tools-drawer");Ee(t),l.resize.tools!==!1&&(P(t,m("tool.column_narrower"),"ge-decrease-col-width","bi bi-dash-lg",function(n){Ft(e,n.shiftKey?$e(l.valid_col_sizes):ct(l.valid_col_sizes.filter(K),Ye(e),-1),"tool")}),P(t,m("tool.column_wider"),"ge-increase-col-width","bi bi-plus-lg",function(n){Ft(e,n.shiftKey?Jo(e):ct(l.valid_col_sizes.filter(K),Ye(e),1),"tool")})),l.indent.tools!==!1&&(P(t,m("tool.indent_decrease"),"ge-decrease-col-offset","bi bi-text-indent-right",function(n){Ln(e,n.shiftKey?$e(l.valid_col_offsets):ct(l.valid_col_offsets,Je(e),-1),"tool")}),P(t,m("tool.indent_increase"),"ge-increase-col-offset","bi bi-text-indent-left",function(n){Ln(e,n.shiftKey?$o(e):ct(l.valid_col_offsets,Je(e),1),"tool")})),Qe(t,e,l.col_classes),dt(t,l.col_tools),P(t,m("tool.delete_column"),"ge-delete-column","bi bi-trash",function(){Ce("column",e,m("confirm.delete_column"),function(n){Wr(e,400,n,!0)})}),P(t,m("tool.add_row"),"ge-add-row","bi bi-plus-circle",function(){var n=Ne();te("row",n,function(){e.appendChild(n)},{parent:e,source:"tool"})})}})}function pe(){return S===q?h[h.length-1]:X(S)}function Ge(e){var t=pe();if(mt(e,t))return null;var n=an(e,t);return n===null?z:n}function Ye(e){var t=Ge(e);if(K(t))return t;var n=Math.round(rt(e)/ur(e.parentElement)*z);return Math.min(Math.max(n,1),z)}function ur(e){var t=window.getComputedStyle(e);return e.clientWidth-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight)}function Je(e){return pt(e,pe())||0}function ct(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 $e(e){return e.filter(K).reduce(function(t,n){return Math.min(t,n)},z)}function en(e){return e.filter(K).reduce(function(t,n){return Math.max(t,n)},0)}function Jo(e){var t=sn(e.parentElement,pe(),e)-Je(e);return Math.min(en(l.valid_col_sizes),Math.max(t,1))}function $o(e){var t=sn(e.parentElement,pe(),e)-Ye(e);return Math.min(en(l.valid_col_offsets),Math.max(t,0))}function Ee(e){return l.drag_handle==="drawer"?null:P(e,m("tool.move"),"ge-move","bi bi-arrows-move")}function P(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){ne(a,u,o[u])}),a}function tn(e){return(e.getAttribute("class")||"").split(/\s+/).filter(function(t){return t!==""&&!Qo(t)})}function Qo(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 Zo(e,t){tn(e).forEach(function(n){L(e,n)}),t.split(/\s+/).forEach(function(n){n!==""&&C(e,n)}),Et(e)}function Qe(e,t,n){var r=ei(t,n||[]);kn.set(t,r),P(e,m("tool.settings"),"ge-settings","bi bi-gear-fill",function(){ni(t,r,this)});var o=re(t);return Object.keys(B).forEach(function(a){B[a].drawerTools&&B[a].drawerTools(e,t,o)}),Object.keys(A).forEach(function(a){A[a].drawerTools&&A[a].drawerTools(e,t,o)}),e.appendChild(r)}function ei(e,t){var n=v("div",{class:"ge-details"});n.appendChild(dr(m("panel.section_general")));var r=n.appendChild(v("div",{class:"ge-details-general"})),o=function(p){var w=v("label",{class:"ge-field"});return w.appendChild(v("span",{class:"ge-field-label"},p)),r.appendChild(w)},a=v("input",{class:"ge-id form-control form-control-sm",placeholder:m("tool.id_placeholder"),title:m("tool.id_title")});a.value=e.getAttribute("id")||"",o(m("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:m("tool.classes_placeholder"),title:m("tool.classes_title")});u.value=tn(e).join(" "),o(m("panel.classes")).appendChild(u),u.addEventListener("change",function(){Zo(e,this.value),ie(e)});var c=r.appendChild(v("div",{class:"btn-group btn-group-sm ge-presets",role:"group"}));t.forEach(function(p){var w=y(e,p.cssClass),_=v("a",{role:"button",class:"btn btn-sm btn-outline-secondary",title:p.title?p.title:m("tool.toggle_class",{label:p.label}),"aria-pressed":w?"true":"false"});_.innerHTML=p.label,I(_,"active",w),_.addEventListener("click",function(){I(_,"active"),_.setAttribute("aria-pressed",y(_,"active")?"true":"false"),I(e,p.cssClass,y(_,"active")),ie(e)}),c.appendChild(_)}),ti(e).forEach(function(p){n.appendChild(p)});var f=jo(e);return f&&n.appendChild(f),n}function dr(e){return v("h6",{class:"ge-section-title"},e)}function ti(e){var t=re(e),n=fr(),r=[];return[R,A,B].forEach(function(o){Object.keys(o).forEach(function(a){var u=o[a],c=u.panelSection?u.panelSection(e,t):null;if(!(!c||!c.body)){var f=v("div",{class:"ge-panel-section","data-ge-plugin":a});if(n==="offcanvas"||n==="modal")f.appendChild(dr(m(c.labelKey))),f.appendChild(c.body);else{var p=m(c.labelKey),w=f.appendChild(v("button",{type:"button",class:"btn btn-sm btn-outline-secondary ge-panel-section-open"},p));ue(c.body),f.appendChild(c.body),w.addEventListener("click",function(){hr(c.titleKey?m(c.titleKey,{kind:wr(e)}):p,c.body,w)})}r.push(f)}})}),r}var cr=["offcanvas","popover","modal","inline"],H={},F=null,ft=new WeakMap;function fr(){return cr.indexOf(l.settings_panel)!==-1?l.settings_panel:(ee("settings_panel",'settings_panel "'+l.settings_panel+'" is not one of '+cr.join(", ")+": using offcanvas"),"offcanvas")}function mr(e){return e&&kn.get(e)||null}function gr(){return F&&F.mode!=="inline"?[d,F.details]:[d]}function ni(e,t,n){var r=fr();if(r==="inline"){vn(t);return}var o=F&&F.details===t;ve(),o||ri(r,e,t,n)}function ri(e,t,n,r){var o=oi(e),a=new AbortController;F={mode:e,node:t,details:n,home:n.parentElement,next:n.nextElementSibling,gear:r,listening:a},O(o,".ge-settings-title").textContent=m("panel.title",{kind:wr(t)}),O(o,".ge-settings-body").appendChild(n),Ae(n),C(t,"ge-settings-target");var u={signal:a.signal};if(document.addEventListener("keydown",function(f){f.key==="Escape"&&!le&&ve()},u),e==="offcanvas"){var c=window.innerWidth<576;I(o,"offcanvas-end",!c),I(o,"offcanvas-bottom",c),L(o,"hiding"),o.getBoundingClientRect(),C(o,"show")}else e==="popover"?(nn(o,r),ne(window,"scroll resize",function(){nn(o,r)},u),window.ResizeObserver&&(F.observer=new window.ResizeObserver(function(){nn(o,r)}),F.observer.observe(n)),ne(document,"mousedown touchstart",function(f){!le&&!o.contains(f.target)&&!r.contains(f.target)&&ve()},u)):rn(o,function(){F&&F.mode==="modal"&&ve()})}function ve(){se();var e=F;if(e){F=null;var t=H[e.mode];e.listening.abort(),e.observer&&e.observer.disconnect(),e.mode==="offcanvas"?(L(t,"show"),C(t,"hiding"),window.setTimeout(function(){L(t,"hiding")},300)):e.mode==="popover"?ue(t):on(t),L(e.node,"ge-settings-target"),e.details.style.removeProperty("display"),nt(e.details),e.home&&ke(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 oi(e){if(H[e])return H[e];var t=function(){return v("button",{type:"button",class:"btn-close ge-settings-close","aria-label":m("panel.close")})},n;return e==="offcanvas"?(n=V('<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>'),O(n,".offcanvas-header").appendChild(t())):e==="popover"?(n=V('<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>'),O(n,".popover-header").appendChild(t()),ue(n)):(n=V('<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>'),O(n,".modal-header").appendChild(t()),O(n,".modal-footer").appendChild(v("button",{type:"button",class:"btn btn-primary ge-settings-close"},m("panel.done")))),He(n,"click",".ge-settings-close",function(r){r.preventDefault(),ve()}),H[e]=document.body.appendChild(n),n}function pr(){ve(),Object.keys(H).forEach(function(e){e==="modal"?It(H[e]):H[e].remove()}),Object.keys(H).forEach(function(e){vr(H[e])}),H={}}function nn(e,t){if(ke(t)){Ae(e);var n=t.getBoundingClientRect(),r=8,o=T(e,".popover-body");o.style.removeProperty("max-height");var a=rt(e),u=kt(e),c=window.innerHeight-n.bottom-2*r,f=n.top-2*r,p=u<=c||c>=f,w=p?c:f;u>w&&(we(o,{"max-height":Math.max(120,w-(u-kt(o)))}),u=kt(e));var _=p?n.bottom+r:n.top-r-u,xe=Math.max(r,Math.min(n.left+n.width/2-24,window.innerWidth-a-r));I(e,"bs-popover-bottom",p),I(e,"bs-popover-top",!p),we(e,{top:_+window.pageYOffset,left:xe+window.pageXOffset}),we(T(e,".popover-arrow"),{left:Math.max(r,Math.min(n.left+n.width/2-xe-8,a-24))})}}function rn(e,t){var n=at(),r=ft.get(e);if(r||(r={wanted:null,busy:!1,backdrop:null,dismissed:t},ft.set(e,r)),r.dismissed=t,!n){r.backdrop||(r.backdrop=v("div",{class:"modal-backdrop fade show ge-settings-backdrop"}),r.backdrop.addEventListener("click",function(){r.dismissed()}),document.body.appendChild(r.backdrop)),C(e,"show"),e.style.display="block",e.removeAttribute("aria-hidden");return}var o=n.getOrCreateInstance(e);r.watched||(r.watched=!0,On(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"&&on(e)}),e.addEventListener("hidden.bs.modal",function(){r.busy=!1,r.wanted==="open"?rn(e,r.dismissed):r.dismissed()})),r.wanted="open",r.busy||(r.busy=!0,o.show())}function on(e){var t=at(),n=ft.get(e);if(n){if(n.wanted="closed",!t){n.backdrop&&(n.backdrop.remove(),n.backdrop=null),L(e,"show"),e.style.removeProperty("display"),e.setAttribute("aria-hidden","true");return}!n.busy&&y(e,"show")&&(n.busy=!0,t.getOrCreateInstance(e).hide())}}function vr(e){var t=ft.get(e);t&&t.backdrop&&(t.backdrop.remove(),t.backdrop=null)}var Y=null,le=null;function ii(){return Y||(Y=V('<div class="modal fade ge-dialog" 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-dialog-title"></h5></div><div class="modal-body ge-dialog-body"></div><div class="modal-footer"></div></div></div></div>'),O(Y,".modal-header").appendChild(v("button",{type:"button",class:"btn-close ge-dialog-close","aria-label":m("panel.close")})),O(Y,".modal-footer").appendChild(v("button",{type:"button",class:"btn btn-primary ge-dialog-close"},m("panel.done"))),He(Y,"click",".ge-dialog-close",function(e){e.preventDefault(),se()}),document.body.appendChild(Y))}function hr(e,t,n){se();var r=ii(),o=new AbortController;le={body:t,home:t.parentElement,next:t.nextElementSibling,opener:n||document.activeElement,listening:o},O(r,".ge-dialog-title").textContent=e,O(r,".ge-dialog-body").appendChild(t),Ae(t),at()||document.addEventListener("keydown",function(a){a.key==="Escape"&&se()},{signal:o.signal}),Object.keys(H).forEach(function(a){C(H[a],"ge-under-dialog")}),rn(r,function(){se()})}function se(){var e=le;e&&(le=null,e.listening.abort(),on(Y),Object.keys(H).forEach(function(t){L(H[t],"ge-under-dialog")}),ue(e.body),e.home&&ke(e.home)?e.next&&e.next.parentElement===e.home?e.home.insertBefore(e.body,e.next):e.home.appendChild(e.body):e.body.remove(),e.opener&&ke(e.opener)&&e.opener.focus&&e.opener.focus())}function br(){se(),Y&&(vr(Y),It(Y),Y=null)}function wr(e){var t=re(e);if(R[t]&&R[t].labelKey)return m(R[t].labelKey);switch(t){case"row":return m("panel.kind_row");case"column":return m("panel.kind_column");case"text":return m("panel.kind_text");case"element":return m("panel.kind_element");case"section":return m("panel.kind_section");case"tab":return m("panel.kind_tab");case"accordion-item":return m("panel.kind_accordion_item");default:return t}}function ai(){k(d,'.column, div[class*="col-"], div.col').forEach(function(e){C(e,"column"),!(ci(e).length||yr(e.parentElement))&&vt(e,h[0],z)})}function yr(e){return y(e,"row")&&h.some(function(t){return Ke.some(function(n){return y(e,yn(t,n))})})}function Ze(e,t){if(!y(e,"row"))return null;for(var n=h.indexOf(t);n>=0;n--)for(var r=0;r<Ke.length;r++)if(y(e,yn(h[n],Ke[r])))return{tier:n,value:Ke[r]};return null}function Cr(e,t){for(var n=h.indexOf(t);n>=0;n--){var r=Re(e,h[n]);if(r!==null)return{tier:n,size:r}}return null}function mt(e,t){var n=Ze(e.parentElement,t);if(!n)return null;var r=Cr(e,t);return!r||n.tier>r.tier||n.tier===r.tier&&r.size==="equal"?n:null}function li(e){return e.value==="auto"?0:z/parseInt(e.value,10)}function si(e,t){var n=mt(e,t);return n?{flex:"0 0 auto",width:n.value==="auto"?"auto":100/parseInt(n.value,10)+"%","max-width":"100%"}:yr(e.parentElement)&&!Cr(e,t)?{flex:"0 0 auto",width:"100%","max-width":"100%"}:{}}function ui(e){_e(e,".row").forEach(function(t){var n=l.row_cols===!1?null:S===q?Ze(t,h[0])||null:Ze(t,X(S));n?t.setAttribute("data-ge-row-cols",Er(n.value)):t.removeAttribute("data-ge-row-cols")})}function Er(e){return e==="auto"?m("badge.row_cols_auto"):m("badge.row_cols",{count:e})}function di(){return{name:"row-cols",prefix:"row-cols",values:Ke,appliesTo:["row"],labelKey:"utility.row_cols"}}function Re(e,t){var n=_r(e,t.colPrefix);return n!==null?n:y(e,Se(t,"auto"))?"auto":y(e,Se(t,"equal"))?"equal":null}function gt(e,t){return _r(e,t.offsetPrefix)}function an(e,t){return xr(e,t,Re)}function pt(e,t){return xr(e,t,gt)}function xr(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 _r(e,t){var n=new RegExp("(?:^|\\s)"+t+"(\\d+)(?:\\s|$)").exec(e.getAttribute("class")||"");return n?parseInt(n[1],10):null}function kr(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 vt(e,t,n){kr(e,t.colPrefix,null),wn.forEach(function(r){L(e,Se(t,r))}),n!=null&&C(e,Se(t,n))}function ln(e,t,n){kr(e,t.offsetPrefix,n||null)}function ci(e){return h.filter(function(t){return Re(e,t)!==null})}function sn(e,t,n){var r=0;return J(e,".column").forEach(function(o){if(!(n&&o===n)){var a=mt(o,t),u=a?li(a):an(o,t);r+=(K(u)?u:0)+(pt(o,t)||0)}}),z-r}function ht(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),Vr),t===null||!K(t)?{size:t,offset:n,refused:!1}:(t=Math.min(Math.max(t,1),z),t+n<=z?{size:t,offset:n,refused:!1}:e.leading==="offset"?{size:z-n,offset:n,refused:!1}:{size:null,offset:n,refused:!0})}function et(e){_e(e,".column").forEach(function(t){we(t,{width:"",height:"",left:"",top:""}),nt(t)})}function Ar(e){return"ge-"+e+"-"+Jr}function un(){return[".row",".ge-text-block",".ge-content","[data-ge-container]"].concat(bt("blocks")).join(", ")}function bt(e){return Object.keys(A).map(function(t){return A[t][e]||null}).filter(function(t){return t!==null})}function dn(e,t){var n=!0;return Object.keys(A).forEach(function(r){var o=A[r];n&&o.accepts&&o.accepts(e,t)===!1&&(n=!1)}),n}function fi(){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 wt(e,t){var n=Gr();if(e=Array.isArray(e)?e:e?[e]:[],!(!e.length||!n)){var r=l.drag_handle==="drawer",o=fi(),a=0;e.forEach(function(u){var c=t.group?{name:Ar(t.group)}:{name:Ar(t.draggable+"-"+ ++a),pull:!1,put:!1};t.group&&t.accepts&&(c.put=function(f,p,w){return p.options.group.name===c.name&&t.accepts(f.el,w)}),Lt.push(n.create(u,Object.assign({group:c,draggable:t.draggable,handle:r?".ge-tools-drawer":".ge-tools-drawer .ge-move",filter:function(f,p){return Z(f.target,o,u)?!0:!p||p.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:gi,onEnd:vi},t.options||{})))})}}function mi(){if(!Gr()){ee("sortable_missing",m("error.sortable_missing"));return}wt(k(d,".row"),{draggable:".column",group:"column"}),wt([d].concat(k(d,".column")),{draggable:un(),group:"block",accepts:dn});var e=bt("regions");e.length&&wt(k(d,e.join(", ")),{draggable:">"+un(),group:"block",accepts:dn}),oe("onSortable",wt)}function gi(e){var t=e.item,n=Ht(t),r=Sr(t),o={from:n,canceled:!1};Mt.set(t,o),W(function(){var a=M("before-move",Q(r.kind,r.node,{parent:n.parent,source:"dragdrop",from:n}));a||(o.canceled=!0)})}function Sr(e){var t=y(e,"ge-text-block")&&T(e,".ge-content")||e;return{kind:re(t),node:t}}function pi(e,t){var n=J(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 vi(e){var t=e.item,n=Mt.get(t),r=n?n.from:Ht(t);if(Mt.delete(t),n&&n.canceled){pi(t,r);return}var o=Ht(t);if(!(o.parent===r.parent&&o.index===r.index)){var a=Z(t,"[data-ge-container]"),u=R[Ie(a)];u&&u.afterPaneMove&&u.afterPaneMove(a,t,r);var c=Sr(t);W(function(){M("after-move",Q(c.kind,c.node,{parent:o.parent,source:"dragdrop",from:r,to:o,container:a||void 0}))})}}function hi(){l.resize.enabled&&k(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"})),bi().forEach(function(n){var r=v("span",{class:"ge-resize-handle ge-resize-"+n,"data-ge-edge":n});r.addEventListener("pointerdown",wi),e.appendChild(r)})}})}function bi(){return String(l.resize.handles).split(",").map(function(e){return e.trim()}).filter(function(e){return e==="e"||e==="w"})}function wi(e){var t=e.currentTarget,n=t.parentElement,r=t.getAttribute("data-ge-edge")==="w",o=e.pageX,a=rt(n);if(e.preventDefault(),!Ci(n))return;C(n,"ge-resizing"),e.pointerId!==void 0&&t.setPointerCapture&&t.setPointerCapture(e.pointerId);function u(p){var w=p.pageX-o;return Math.max(1,a+(r?-w:w))}function c(p){n.style.width=u(p)+"px",Ei(n,u(p))}function f(p){t.removeEventListener("pointermove",c),hn(t,"pointerup pointercancel",f),L(n,"ge-resizing"),xi(n,u(p))}t.addEventListener("pointermove",c),ne(t,"pointerup pointercancel",f)}function yi(){k(d,".ge-resize-handle").forEach(function(e){e.remove()}),k(d,".ge-resize-size").forEach(function(e){e.remove()}),et(d)}function Tr(e,t){var n=Math.round(t/ur(e.parentElement)*z),r=Or(e),o=r?Ge(r):null,a=lt.get(e),u=a?a.units:Ye(e),c=r&&K(o)?u+o-$e(l.valid_col_sizes):z-Je(e);return Math.min(Math.max(n,$e(l.valid_col_sizes)),Math.max(c,$e(l.valid_col_sizes)),en(l.valid_col_sizes))}function Or(e){return l.resize.balance!=="next"?null:Nr(e,".column")[0]||null}function cn(e,t){var n=T(e,".ge-tools-drawer"),r=n?T(n,".ge-resize-size"):null;r&&(r.textContent=t)}function Lr(e){return(S===q?h[0].colPrefix:pe().colPrefix)+e}function Ci(e){var t=Ge(e),n=W(function(){return M("before-resize",Q("column",e,{source:"dragdrop",from:t,to:null}))});if(!n)return!1;var r={from:t,units:Ye(e)};return lt.set(e,r),cn(e,Lr(r.units)),!0}function Ei(e,t){cn(e,Lr(Tr(e,t)))}function xi(e,t){var n=lt.get(e),r=Tr(e,t);if(lt.delete(e),cn(e,""),et(e),!!n&&r!==n.units){var o=Rt(e,r);o&&W(function(){Nt(e,o),_i(e,r-n.units),ie(e),M("after-resize",Q("column",e,Ut({source:"dragdrop",from:n.from,to:o.size},o.cleared)))})}}function _i(e,t){var n=Or(e);if(!(!n||!t)){var r=Ge(n);if(K(r)){var o=Rt(n,r-t);o&&(Nt(n,o),ie(n))}}}function ki(){Lt.forEach(function(e){e.destroy()}),Lt=[]}function Ne(){return v("div",{class:"row"})}function yt(e,t,n){var r=null;if(Bi.forEach(function(c){r===null&&n&&n[c]!==void 0&&(r=c)}),r===null)return e;var o=de(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 te(t,e,function(){r==="appendTo"?o.appendChild(e):r==="prependTo"?o.insertBefore(e,o.firstChild):r==="insertBefore"?o.parentNode.insertBefore(e,o):St(e,o)},{parent:a,source:n.source||"api"})};return We>0?(jt(u),e):u()}function Ai(e,t){var n=Ne();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=Ve(e)),(Array.isArray(e)?e:[]).forEach(function(r){n.appendChild(he(r))}),yt(n,"row",t)}function Si(e,t){t=t||{};var n=de(t.appendTo||t.prependTo||null);e===void 0&&n&&Ze(n,pe())?e=null:!K(e)&&wn.indexOf(e)===-1&&(N("createColumn: no column size given, using "+z),e=z);var r=he(e,t.offset);return t.content!==void 0&&r.appendChild(Ri(t.content)),yt(r,"column",t)}function Ti(e,t){t=t||{};var n=R[e];return n?yt(n.create(t),e,t):(N('createContainer: no such container type "'+e+'"'),null)}function Mr(e,t,n){e=de(e),n=n||{};var r=R[Ie(e)];if(!r||Ie(e)!==t)return N("this is not a "+t+" container"),null;var o=r.addPane(e,n);return te(r.paneKind,o,function(){},{parent:e,source:"api",container:e})}function fn(){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 he(e,t){var n=v("div",{class:"column"}),r=qr(S)[0],o=ht({size:e,offset:t||0,leading:"offset"});return vt(n,r,o.size===null?e:o.size),ln(n,r,o.offset),n}function Pr(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 Oi(){var e=[".row","[data-ge-container]"];return Object.keys(A).forEach(function(t){var n=A[t],r=typeof n.cuts=="function"?n.cuts():n.cuts;r&&e.push(r)}),e.join(", ")}function Li(e){k(d,".column > .ge-content, .column > .ge-text-block > .ge-content").forEach(function(t){if(!(y(t,"ge-rte-active")||!J(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(f){f.nodeType===1&&f.matches(e)?(o.push({text:a},{block:f}),a=[]):a.push(f)}),o.push({text:a});t.firstChild;)t.removeChild(t.firstChild);var u=!1,c=r;o.forEach(function(f){var p;if(f.block)p=f.block;else if(Mi(f.text))u?(p=mn(n),f.text.forEach(function(w){p.appendChild(w)})):(f.text.forEach(function(w){t.appendChild(w)}),p=r,u=!0);else return;p!==c&&St(p,c),c=p}),u||r.remove()}})}function Mi(e){return e.some(function(t){return t.nodeType===1||t.nodeType===3&&/\S/.test(t.nodeValue)})}function Pi(e){k(d,".column").forEach(function(t){var n=[];J(t).forEach(function(r){be(r,".ge-tools-drawer, .ge-resize-handle")||(be(r,".ge-content, .ge-text-block")||r.matches(e)?n=zr(n):n.push(r))}),zr(n)})}function zr(e){if(e.length){var t=St(mn(),e[e.length-1]);e.forEach(function(n){t.appendChild(n)})}return[]}function mn(e){var t=v("div",{class:"ge-content"});return e&&(C(t,"ge-content-type-"+e),t.setAttribute("data-ge-content-type",e)),t}function zi(){k(d,".column > .ge-content").forEach(function(e){Hr(e,v("div",{class:"ge-text-block"}))}),k(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?ho(n)||Di(e,n):Ii(e)}})}function ji(){k(d,".ge-text-block").forEach(function(e){Tt(e)})}function Ii(e){var t=T(e,".ge-content"),n=De(e,"ge-tools-drawer ge-text-drawer ge-plain-drawer");C(e,"ge-plain-block"),Ee(n),Object.keys(A).forEach(function(r){A[r].plainTools&&A[r].plainTools(n,t)}),P(n,m("tool.delete_plain"),"ge-delete-plain","bi bi-trash",function(){Ce("plain",t,m("confirm.delete_plain"),function(r){ot(e,function(){e.remove(),r()})})})}function Di(e,t){var n=T(e,".ge-content"),r=De(e,"ge-tools-drawer ge-text-drawer");Ee(r),P(r,m("text.no_editor",{type:t}),"ge-text-info ge-text-missing","bi bi-exclamation-triangle"),P(r,m("tool.delete_text"),"ge-delete-text","bi bi-trash",function(){Ce("text",n,m("confirm.delete_text"),function(o){ot(e,function(){e.remove(),o()})})})}function Ri(e){var t=Kn(),n=mn(t.length?t[0].type:null);return e&&e.nodeType?n.appendChild(e):Ct(n,e),n}function jr(e){S=e,bn.forEach(function(t){I(d,"ge-layout-"+t,t===e)}),O(Oe,"button").textContent=m(it(e))}function gn(e){return bn.indexOf(e)===-1?null:e}function Ir(e){var t=gn(e);if(t===null){N("changeView("+JSON.stringify(e)+"): no such layout mode");return}var n=S;jr(t),t!==n&&(gr().forEach(function(r){k(r,".ge-utilities").forEach(function(o){Qt(o)})}),nr(null),qe(d),oe("onViewChange",t),M("view-change",{canvas:d,breakpoint:t,from:n,to:t}))}function pn(){return S}function Dr(e,t,n){return function(){return Xe[e]?Xe[e].apply(null,arguments):(ee("plugin:"+t,e+" needs the "+t+" plugin: include dist/plugins/grideditor."+n+".js after the editor"),null)}}function Ni(e){if(!l.active_target){ee("active_target","setActiveTarget needs the active_target setting: without it, it does nothing");return}if(e==null){Pe(null);return}var t=de(e);if(!wo(t)){var n=typeof e=="string"?e:t?"<"+t.tagName.toLowerCase()+">":String(e);N("setActiveTarget: "+n+" is not a column or a region of the canvas");return}Pe(t)}var Rr={getHtml:qn,getPlainHtml:Co,init:function(){jt(fe)},reset:function(){jt(Wn)},deinit:ze,destroy:Eo,changeView:Ir,getView:pn,createRow:Ai,createColumn:Si,createText:function(e,t){return Xe.createText?Xe.createText(e,t):(ee("plugin:text","createText needs a text editor plugin: include dist/plugins/grideditor.tinymce.js, or another editor's, after the editor"),null)},createElement:Dr("createElement","elements","elements"),createSection:Dr("createSection","sections","sections"),createContainer:Ti,addTab:function(e,t){return Mr(e,"tabs",t)},addAccordionItem:function(e,t){return Mr(e,"accordion",t)},setLocale:$r,getUtility:Zn,setUtility:Jt,getActiveTarget:function(){return l.active_target?D:null},setActiveTarget:Ni};Object.keys(Rr).forEach(function(e){var t=!!(Br[e]&&Br[e].value);i[e]=function(){if(_n)return ee("destroyed:"+e,m("warning.destroyed",{method:e})),e==="getHtml"?d.innerHTML:e==="getPlainHtml"?Cn(d.innerHTML):t?null:i;var n=Rr[e].apply(i,arguments);return t?n:i}}),i.canvas=d,i.settings=fn(),Ot.set(d,i),xo(),i.settings=fn(),no(),fe(),E._created.forEach(function(e){e(i)})}E._created=[];E.containers={};E.features={};E.utilities={};E.texts={};E.t=En;E._plainHtml=Cn;E.Sortable=null;E.bootstrap=null;E.version="8.2.0";E.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
9
+ (()=>{function k(i,s){return i?Array.prototype.slice.call(i.querySelectorAll(s)):[]}function O(i,s){return i?i.querySelector(s):null}function ke(i,s){if(!i)return[];var g=k(i,s);return i.nodeType===1&&i.matches(s)&&g.unshift(i),g}function Q(i,s){return i?Array.prototype.filter.call(i.children,function(g){return!s||g.matches(s)}):[]}function L(i,s){return Q(i,s)[0]||null}function Z(i,s,g){var l=i&&i.nodeType===1?i.closest(s):null;return l&&g&&l!==g&&!g.contains(l)?null:l}function Ce(i,s){return!!i&&i.nodeType===1&&i.matches(s)}function Ae(i){return!!i&&document.documentElement.contains(i)}function Wr(i,s){for(var g=[],l=i.nextElementSibling;l;l=l.nextElementSibling)(!s||l.matches(s))&&g.push(l);return g}function Kr(i,s){for(var g=[],l=i.parentElement;l&&l!==s;l=l.parentElement)g.push(l);return g}function Bi(i){var s=document.createElement("template");return s.innerHTML=i,Array.prototype.slice.call(s.content.childNodes)}function B(i){for(var s=Bi(i.trim()),g=0;g<s.length;g++)if(s[g].nodeType===1)return s[g];return null}function v(i,s,g){var l=document.createElement(i);return Object.keys(s||{}).forEach(function(d){var A=s[d];A!=null&&A!==!1&&l.setAttribute(d,A)}),g!=null&&(l.textContent=g),l}function Et(i,s){return i.innerHTML=s==null?"":String(s),i}function C(i,s){return Fe(s).forEach(function(g){i.classList.add(g)}),i}function M(i,s){return Fe(s).forEach(function(g){i.classList.remove(g)}),i}function R(i,s,g){return Fe(s).forEach(function(l){g===void 0?i.classList.toggle(l):i.classList.toggle(l,!!g)}),i}function y(i,s){return!!i&&i.nodeType===1&&i.classList.contains(s)}function Fe(i){return String(i||"").split(/\s+/).filter(Boolean)}function xt(i){return i.getAttribute("class")||i.removeAttribute("class"),i}function nt(i){return i.getAttribute("style")||i.removeAttribute("style"),i}function _t(i,s){return Object.keys(s).forEach(function(g){var l=s[g];l==null?i.removeAttribute(g):i.setAttribute(g,l)}),i}function Ee(i,s){return Object.keys(s).forEach(function(g){var l=s[g];typeof l=="number"&&!Vi[g]&&(l=l+"px"),i.style.setProperty(g,l==null?"":String(l))}),i}var Vi={opacity:!0,"z-index":!0,"flex-grow":!0,"flex-shrink":!0,order:!0},tt={};function qi(i){var s=i.nodeName;if(!tt[s]){var g=document.body.appendChild(document.createElement(s));tt[s]=getComputedStyle(g).display,g.remove(),tt[s]==="none"&&(tt[s]="block")}return tt[s]}function Se(i){return i.style.removeProperty("display"),getComputedStyle(i).display==="none"&&(i.style.display=qi(i)),i}function ce(i){return i.style.display="none",i}function wn(i,s){return s===void 0&&(s=!kt(i)),s?Se(i):ce(i)}function kt(i){return!!(i.offsetWidth||i.offsetHeight||i.getClientRects().length)}function rt(i){return i.getBoundingClientRect().width}function At(i){return i.getBoundingClientRect().height}function Br(i){var s=getComputedStyle(i);return i.clientHeight-parseFloat(s.paddingTop)-parseFloat(s.paddingBottom)}function St(i){var s=i.getBoundingClientRect();return{top:s.top+window.pageYOffset,left:s.left+window.pageXOffset}}function Tt(i,s){return s.parentNode.insertBefore(i,s.nextSibling),i}function Ot(i){for(var s=i.parentNode;i.firstChild;)s.insertBefore(i.firstChild,i);i.remove()}function Vr(i,s){return i.parentNode.insertBefore(s,i),s.appendChild(i),s}function He(i,s,g,l,d){var A=function(b){var j=Z(b.target,g,i);if(j&&i.contains(j))return l.call(j,b)};return Fe(s).forEach(function(b){i.addEventListener(b,A,d)}),A}function oe(i,s,g,l){return Fe(s).forEach(function(d){i.addEventListener(d,g,l)}),g}function yn(i,s,g,l){Fe(s).forEach(function(d){i.removeEventListener(d,g,l)})}var Gi=400;function qr(i,s,g,l){g=g===void 0?Gi:g;var d=function(){ce(i),l&&l()};if(!kt(i)||!i.animate||g<=0){window.setTimeout(d,0);return}var A=i.animate(s(getComputedStyle(i)),{duration:g,easing:"ease-in-out"}),b=!1,j=function(){b||(b=!0,d())};A.onfinish=j,A.oncancel=j}function ot(i,s,g){typeof s=="function"&&(g=s,s=void 0),i.style.overflow="hidden",qr(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"),g&&g()})}function Gr(i,s,g,l){i.style.overflow="hidden",qr(i,function(d){var A={opacity:d.opacity,height:d.height},b={opacity:0,height:"0px"};return l&&(A.width=d.width,b.width="0px"),[A,b]},s,function(){i.style.removeProperty("overflow"),g&&g()})}var Xr={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},getActiveTarget:{value:!0},setActiveTarget:{}},Yi=["appendTo","prependTo","insertAfter","insertBefore"],w=[{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"}],X="all",Ji="view.all",Cn=[X].concat(w.map(function(i){return i.key})),D=12,Yr=11,En=["equal","auto"],We=["1","2","3","4","5","6","auto"];function xn(i,s){return"row-cols"+(i.infix?"-"+i.infix:"")+"-"+s}function V(i){return typeof i=="number"}function Te(i,s){return s==="equal"?i.infix?"col-"+i.infix:"col":i.colPrefix+s}function Y(i){for(var s=0;s<w.length;s++)if(w[s].key===i)return w[s];return null}function Jr(i){if(i===X)return[w[0]];var s=Y(i);return s?[s]:[]}function it(i){var s=Y(i);return s?s.labelKey:Ji}var Oe={add_column:{size:12,picker:!0,delay:600},elements:{enabled:"auto",selector:"[data-ge-element]",auto:!1},resize:{enabled:!0,tools:!0,handles:"e",balance:"next"},indent:{tools:!0},drag:{delay:0,touch_delay:100,threshold:3,animation:150,scroll:!0}},$r={},$i=0,Lt=new WeakMap;function kn(i,s,g){var l=x.locales,d=l[i.locale]||{},A=i.locale_strings||{},b=A[s];return b===void 0&&(b=d[s]),b===void 0&&(b=l.en[s]),b===void 0&&(Qi("locale:"+s,'no string for "'+s+'" in any locale, showing the key'),b=s),b.replace(/\{(\w+)\}/g,function(j,me){return g&&g[me]!==void 0?g[me]:j})}function F(i){window.console&&window.console.warn&&window.console.warn("grid-editor: "+i)}function Qi(i,s){$r[i]||($r[i]=!0,F(s))}function Zi(i,s){return kn({locale:"en"},i,s)}function ea(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 fe(i){return typeof i=="string"?document.querySelector(i):i&&i.nodeType===1?i:null}function Qr(){return x.Sortable||window.Sortable||null}function at(){var i=x.bootstrap||window.bootstrap;return i&&i.Modal?i.Modal:null}function _n(i){var s=document.implementation.createHTMLDocument("").body;s.innerHTML=i;var g=[];return k(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 A=(l.getAttribute("class")||"").split(/\s+/).filter(Boolean),b=A.filter(function(j){return j!=="column"&&j.indexOf("ge-")!==0});b.length!==A.length&&(d=!0),b.length?l.setAttribute("class",b.join(" ")):l.removeAttribute("class"),d&&l.tagName==="DIV"&&!l.attributes.length&&g.push(l)}),g.forEach(function(l){Ot(l)}),s.innerHTML}function x(i,s){var g=ea(i),l=Lt.get(g);if(l)return Zr.has(g)||(Zr.add(g),F(Zi("warning.already_editing"))),l;if(!(this instanceof x))return new x(g,s);ta(this,g,s||{})}var Zr=new WeakSet;x.create=function(i,s){return new x(i,s)};x.get=function(i){var s=fe(i);return s&&Lt.get(s)||null};function ta(i,s,g){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",toolbar_overflow:"menu",active_target:!1,element_tools:[],element_classes:[],container_classes:[],pane_classes:[],container_tools:[],tab_tools:[],accordion_tools:[],plugins:null,row_cols:!0,utilities:{},elements:Oe.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:Oe.add_column,layout_modes:Cn.slice(),default_view:X,resize:Oe.resize,indent:Oe.indent,source_textarea:"",edit_source:!0,locale:"en",locale_strings:{},callbacks:{},confirm_delete:!0,settings_panel:"offcanvas",drag:Oe.drag},g);Object.keys(Oe).forEach(function(e){l[e]=Object.assign({},Oe[e],l[e])});var d,A,b,j,me,Le,J,T=l.default_view,H=null,ee=null,Me=!1,Pe=null,N=null,lt=null,Mt=function(){},An={},Pt=[],eo=++$i,Sn=!1,Tn=new WeakMap,zt=new WeakMap,st=new WeakMap,On=new WeakMap,jt=new WeakSet,Ln=new AbortController;d=C(s,"ge-canvas");function ne(e,t){An[e]||(An[e]=!0,F(t))}function m(e,t){return kn(l,e,t)}function to(e){l.locale=e,i.settings=gn(),Mn(),wr(),Er(),Dn(),Rn(),Gn()}var Ke=0,It=[];function te(e,t,n){return Object.assign({kind:e,node:t,parent:t.parentElement,canvas:d,breakpoint:hn(),source:"api"},n||{})}function z(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 q(e){Ke++;try{return e()}finally{if(Ke--,Ke===0)for(;It.length;)It.shift()()}}function Rt(e){if(Ke===0){e();return}It.push(e)}function re(e,t,n,r){var o=no(e);return q(function(){var a=te(e,t,r);return z("before-add-"+o,a)?(n(),pe(),z("after-add-"+o,a),t):null})}function no(e){return x.containers[e]?"container":e}function ro(e,t){if(!l.confirm_delete){t();return}var n=at();if(!n){window.confirm(e)&&t();return}var r=oo(),o=!1;O(r,".ge-confirm-message").textContent=e,O(r,".ge-confirm-ok").onclick=function(){o=!0,n.getInstance(r).hide()},ge.hidden=function(){o&&t()},ge.shown=function(){O(r,".ge-confirm-ok").focus()},n.getOrCreateInstance(r).show()}var ge={hidden:null,shown:null};function oo(){return H||(H=B('<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(H),O(H,".modal-title").textContent=m("confirm.title"),O(H,".btn-close").setAttribute("aria-label",m("confirm.cancel")),O(H,".ge-confirm-cancel").textContent=m("confirm.cancel"),O(H,".ge-confirm-ok").textContent=m("confirm.ok"),Pn(H),H.addEventListener("hidden.bs.modal",function(){ge.hidden&&ge.hidden()}),H.addEventListener("shown.bs.modal",function(){ge.shown&&ge.shown()}),H)}function Mn(){H&&(ge.hidden=null,ge.shown=null,Dt(H),H=null)}function Dt(e){var t=at(),n=t?t.getInstance(e):null,r=!1,o=function(){r||(r=!0,n&&n.dispose(),e.remove())};if(!n||!Nt.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 Nt=new WeakMap;function Pn(e){oe(e,"show.bs.modal hide.bs.modal",function(){Nt.set(e,!0)}),oe(e,"shown.bs.modal hidden.bs.modal",function(){Nt.set(e,!1)})}function xe(e,t,n,r){q(function(){var o=te(e,t,{source:"tool"});z("before-delete",o)&&ro(n,function(){q(function(){r(function(){t.remove(),q(function(){pe(),z("after-delete",o)})})})})})}function Ut(e,t,n){if(n=n||T,n!==X){var r=Y(n),o=bt({size:t,offset:vt(e,r)||0});return o.refused||Ne(e,r)===o.size?null:{writes:[{tier:r,size:o.size}],cleared:null,size:o.size}}var a=w.some(function(p){return bt({size:t,offset:vt(e,p)||0}).refused});if(a)return null;var u=w[0],f=[],c=[];return w.slice(1).forEach(function(p){var h=Ne(e,p);h!==null&&(f.push({tier:p,size:null}),c.push({breakpoint:p.key,value:h}))}),Ne(e,u)!==t&&f.unshift({tier:u,size:t}),f.length?{writes:f,cleared:c,size:t}:null}function Ft(e,t){t.writes.forEach(function(n){ht(e,n.tier,n.size)}),et(e)}function Ht(e,t){return t&&(e.cleared=t),e}function Wt(e,t,n,r){r=r||T;var o=Xe(e),a=Ut(e,t,r);return a?q(function(){var u=te("column",e,Ht({source:n,breakpoint:r,from:o,to:a.size},a.cleared));return z("before-resize",u)?(Ft(e,a),le(e),z("after-resize",u),!0):(le(e),!1)}):!1}function zn(e,t,n){var r=T===X,o=r?w[0]:Y(T),a=Je(e);t=Math.min(Math.max(t,0),Yr);var u=r?w.slice(1).filter(function(f){return pt(e,f)!==null}):[];return(pt(e,o)||0)===t&&!u.length?!1:q(function(){var f=te("column",e,Ht({source:n,from:a,to:t},r?u.map(function(c){return{breakpoint:c.key,value:pt(e,c)}}):null));return z("before-indent",f)?(un(e,o,t),u.forEach(function(c){un(e,c,0)}),(r?w:[o]).forEach(function(c){var p=sn(e,c);if(V(p)){var h=bt({size:p,offset:t,leading:"offset"});h.size!==p&&ht(e,c,h.size)}}),le(e),z("after-indent",f),!0):!1})}function Kt(e){var t=e.parentElement;return{parent:t,index:Q(t).filter(function(n){return!y(n,"ge-tools-drawer")}).indexOf(e)}}function ie(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=L(e,".ge-content")||e),y(e,"ge-content")?e.getAttribute("data-ge-content-type")?"text":"plain":"node"))}if(l.source_textarea){var Be=fe(l.source_textarea).value,jn=v("div");jn.innerHTML=Be,Be.length>0&&!jn.querySelector(".row")&&(Be='<div class="row"><div class="col-lg-12">'+Be+"</div></div>"),Et(s,Be)}if(s.children.length&&!s.querySelector("div.row")){var io=Q(s),In=B('<div class="row"><div class="col-lg-12"></div></div>');s.appendChild(In),io.forEach(function(e){In.firstChild.appendChild(e)})}function ao(){J=v("textarea",{class:"ge-html-output"}),d.parentNode.insertBefore(J,d),Rn();var e={signal:Ln.signal};if(window.addEventListener("scroll",wo,e),He(d,"click",".ge-content",yo,e),He(d,"click",".ge-popup-trigger, [data-ge-popup-target]",function(n){y(d,"ge-editing")&&n.preventDefault()},e),l.active_target){var t=null;d.addEventListener("pointerdown",function(n){t={x:n.clientX,y:n.clientY}},e),d.addEventListener("click",function(n){var r=t;if(t=null,!!y(d,"ge-editing")&&!(r&&Math.abs(n.clientX-r.x)+Math.abs(n.clientY-r.y)>l.drag.threshold)){var o=Z(n.target,Yn());ze(o&&o!==d&&d.contains(o)?o:null)}},e),document.addEventListener("keydown",function(n){if(!(n.key!=="Escape"||!N||W||ue)){var r=document.activeElement;r&&(Ce(r,"input, textarea, select")||r.isContentEditable)||ze(null)}},e)}}function lo(e){!Ce(e,".ge-content")||!d.contains(e)||(ae("onContentReady",e),qe(e))}function Rn(){A=v("div",{class:"ge-mainControls"}),J.parentNode.insertBefore(A,J),b=A.appendChild(v("div",{class:"ge-wrapper ge-top"}));var e=l.toolbar_overflow!=="wrap",t=b;e&&(C(b,"ge-toolbar-menu"),t=b.appendChild(v("div",{class:"ge-toolbar-start"}))),j=t.appendChild(v("div",{class:"ge-addRowGroup btn-group"})),me=v("div",{class:"ge-addContainerGroup btn-group ms-1"}),l.new_row_layouts.forEach(function(c){var p=!Array.isArray(c),h=v("a",{class:"btn btn-sm btn-primary",title:p?m("row.add_row_cols",{columns:c.columns,counts:ho(c.row_cols)}):m("row.add",{layout:c.join("-")}),"data-ge-toolbar":"row","data-ge-layout":p?JSON.stringify(c):c.join(",")});h.addEventListener("click",function(){if(N){Gt(h,"tool");return}var P=Ve(c),bn=re("row",P,function(){d.appendChild(P)},{parent:d,source:"tool"});bn&&P.scrollIntoView&&P.scrollIntoView({behavior:"smooth"})}),j.appendChild(h),h.appendChild(B('<i class="bi bi-plus"></i>'));var _=p?bo(c):c,E='<div class="row ge-row-icon">';_.forEach(function(P){E+='<div class="column '+Te(w[0],P)+'"></div>'}),E+="</div>",h.appendChild(B(E))}),t.appendChild(me),Object.keys(U).forEach(function(c){var p=U[c],h=Nn(v("a",{class:"btn btn-sm btn-primary ge-add-container"}),m(p.labelKey),p.iconClass);_t(h,{"data-ge-toolbar":"container","data-ge-container-type":c}),h.addEventListener("click",function(){if(N){Gt(h,"tool");return}var _=Ue(),E=_.appendChild(ye(D)),P=E.appendChild(p.create({}));re(c,P,function(){d.appendChild(_)},{parent:d,source:"tool"})}),me.appendChild(h)});var n=[];Object.keys(S).forEach(function(c){(S[c].toolbar||[]).forEach(function(p,h){var _=uo(c,p,h);p.align==="end"?n.push(_):me.appendChild(_)})}),Le=B('<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>'),He(Le,"click","a",function(){Ur(this.getAttribute("data-ge-view"))}),b.appendChild(Le),l.layout_modes.forEach(function(c){O(Le,".dropdown-menu").appendChild(v("a",{class:"dropdown-item","data-ge-view":c,title:m(it(c))},m(it(c))))}),O(Le,"button").textContent=m(it(T));var r=b.appendChild(v("div",{class:"btn-group pull-right"}));if(l.edit_source){var o=B('<button type="button" class="btn btn-sm btn-primary gm-edit-mode"><i class="bi bi-code-slash"></i></button>');o.setAttribute("title",m("tool.edit_source")),R(o,"active btn-danger",Me),o.addEventListener("click",function(){Me?Xn():xo(),R(o,"active btn-danger",Me)}),r.appendChild(o)}var a=B('<button type="button" class="btn btn-sm btn-primary gm-preview"><i class="bi bi-eye-fill"></i></button>'),u=function(){y(a,"active")||C(d,"ge-editing")};if(a.setAttribute("title",m("tool.preview")),a.addEventListener("mouseenter",function(){M(d,"ge-editing")}),a.addEventListener("click",function(){R(a,"active btn-danger"),u()}),a.addEventListener("mouseleave",u),r.appendChild(a),n.length){var f=b.appendChild(v("div",{class:"pull-right ge-toolbar-end"}));n.forEach(function(c){f.appendChild(c)})}e&&so(t),fo()}function Dn(){lt&&lt.abort(),lt=null,Mt=function(){},A.remove()}function so(e){var t=B('<div class="ge-toolbar-more"><button type="button" class="btn btn-sm btn-primary"><i class="bi bi-three-dots"></i></button><div class="ge-toolbar-overflow"><div class="ge-addRowGroup btn-group"></div><div class="ge-addContainerGroup btn-group"></div></div></div>');e.parentNode.insertBefore(t,e.nextSibling);var n=O(t,"button"),r=O(t,".ge-toolbar-overflow"),o=k(r,".btn-group"),a=[];[j,me].forEach(function(E,P){Array.prototype.slice.call(E.children).forEach(function(bn){a.push({button:bn,home:E,spare:o[P]})})}),n.setAttribute("title",m("tool.more")),n.setAttribute("aria-haspopup","true"),n.setAttribute("aria-expanded","false");var u=lt=new AbortController,f={signal:u.signal};if(n.addEventListener("click",function(){h(!y(t,"ge-open"))}),r.addEventListener("click",function(E){Z(E.target,"[data-ge-toolbar]")&&h(!1)}),document.addEventListener("pointerdown",function(E){t.contains(E.target)||h(!1)},f),document.addEventListener("keydown",function(E){E.key==="Escape"&&h(!1)},f),Mt=function(){h(!1)},_(),window.ResizeObserver){var c=!1,p=new window.ResizeObserver(function(){c||(c=!0,window.requestAnimationFrame(function(){c=!1,u.signal.aborted||_()}))});p.observe(b),p.observe(e),u.signal.addEventListener("abort",function(){p.disconnect()})}function h(E){E=E&&y(t,"ge-needed"),R(t,"ge-open",E),n.setAttribute("aria-expanded",E?"true":"false")}function _(){if(a.forEach(function(P){P.home.appendChild(P.button)}),M(t,"ge-needed"),e.scrollWidth<=e.clientWidth){h(!1);return}C(t,"ge-needed");for(var E=a.length-1;E>=0&&e.scrollWidth>e.clientWidth;E--)a[E].spare.insertBefore(a[E].button,a[E].spare.firstChild)}}function Nn(e,t,n){return e.setAttribute("title",t),n?(e.appendChild(v("i",{class:n})),e):(e.appendChild(B('<i class="bi bi-plus"></i>')),e.appendChild(v("span",{},t)),e)}function uo(e,t,n){var r=t.iconClass||(t.align==="end"?"bi bi-plus":null),o=typeof t.label=="function"?t.label():t.label||m(t.labelKey),a=Nn(v("a",{class:"btn btn-sm btn-primary ge-add-container ge-add-feature"}),o,r);return C(a,t.className||""),_t(a,{"data-ge-toolbar":"feature","data-ge-feature":e,"data-ge-item":n}),a.addEventListener("click",function(){if(N){Gt(a,t.source||"tool");return}var u=t.create(),f=t.inColumn?Bt(u):u,c=re(t.kind,u,function(){d.appendChild(f)},{parent:d,source:t.source||"tool"});c&&t.inColumn&&f.scrollIntoView&&f.scrollIntoView({behavior:"smooth"})}),a}function co(){return l.toolbar_drag==="auto"?l.drag_handle==="drawer":!!l.toolbar_drag}function fo(){var e=k(A,"[data-ge-toolbar]");e.forEach(function(t){M(t,"ge-palette-button"),t.removeEventListener("pointerdown",Un)}),co()&&e.forEach(function(t){C(t,"ge-palette-button"),t.addEventListener("pointerdown",Un)})}function Un(e){var t=e.currentTarget,n=e.pageX,r=e.pageY,o=null;if(e.button)return;function a(c){return Math.abs(c.pageX-n)+Math.abs(c.pageY-r)>l.drag.threshold}function u(c){if(!o){if(!a(c))return;o=C(t.cloneNode(!0),"ge-toolbar-helper"),document.body.appendChild(o),Mt(),C(d,"ge-dropping")}Ee(o,{left:c.pageX-14,top:c.pageY-14}),go(c.pageX,c.pageY)}function f(c){if(document.removeEventListener("pointermove",u),yn(document,"pointerup pointercancel",f),!!o){o.remove(),M(d,"ge-dropping"),Vt();var p=function(_){_.target!==t&&!t.contains(_.target)||(_.preventDefault(),_.stopImmediatePropagation())};window.addEventListener("click",p,{capture:!0,once:!0}),window.setTimeout(function(){window.removeEventListener("click",p,{capture:!0})},0);var h=Fn(c.pageX,c.pageY);h&&Hn(t,h)}}document.addEventListener("pointermove",u),oe(document,"pointerup pointercancel",f)}function Fn(e,t){var n=e-window.scrollX,r=t-window.scrollY,o=document.elementFromPoint(n,r);if(!o)return null;var a=Z(o,[".column",".ge-canvas"].concat(wt("regions")).join(", "));if(!a||a!==d&&!d.contains(a))return null;var u=null;return Q(a,cn()).forEach(function(f){if(!u){var c=f.getBoundingClientRect();r<c.top+c.height/2&&(u=f)}}),{region:a,before:u}}function mo(e,t,n){var r=S[e.getAttribute("data-ge-feature")].toolbar[parseInt(e.getAttribute("data-ge-item"),10)],o=r.create(),a=o;if(r.inColumn)Ce(t.region,".column")||(a=Bt(o));else if(!fn(t.region,o)){var u=t.region===d?[]:Kr(t.region,d).reverse().concat([t.region]),f=u[0]||null;t={region:d,before:f?f.nextElementSibling:null}}return re(r.kind,o,function(){t.before?t.before.parentNode.insertBefore(a,t.before):t.region.appendChild(a)},{parent:t.region,source:r.source||n||"dragdrop"})}function Bt(e){var t=Ue();return t.appendChild(ye(D)).appendChild(e),t}function go(e,t){var n=Fn(e,t);if(!n)return Vt();Pe||(Pe=v("div",{class:"ge-drop-marker"})),n.before?n.before.parentNode.insertBefore(Pe,n.before):n.region.appendChild(Pe)}function Vt(){Pe&&Pe.remove()}function Hn(e,t,n){if(e.getAttribute("data-ge-toolbar")==="feature")return mo(e,t,n);var r=e.getAttribute("data-ge-toolbar")==="container",o=e.getAttribute("data-ge-container-type"),a=r?U[o].create({}):vo(e.getAttribute("data-ge-layout")),u=a;return r&&!Ce(t.region,".column")&&(u=Bt(a)),re(r?o:"row",a,function(){t.before?t.before.parentNode.insertBefore(u,t.before):t.region.appendChild(u)},{parent:t.region,source:n||"dragdrop"})}function po(){for(var e=[],t=1;t<=D;t++)e.push(String(t));return{name:"col",values:e.concat(En),appliesTo:["column"],labelKey:"utility.col_width",className:function(n,r){return Te(Y(n),qt(r))},choices:function(){return l.valid_col_sizes.map(String)},label:function(n){return n==="equal"?m("utility.col_equal"):n==="auto"?m("utility.col_auto"):n},write:function(n,r,o,a){return Wt(n,r===null?null:qt(r),a,o)},blank:function(n,r){var o=r===X?null:gt(n,Y(r));return o?m("utility.col_from_row",{count:Ar(o.value)}):null}}}function qt(e){return/^\d+$/.test(String(e))?parseInt(e,10):e}function vo(e){return/^\s*\{/.test(e||"")?Ve(JSON.parse(e)):Ve((e||"").split(",").filter(function(t){return t!==""}).map(qt))}function Ve(e){var t=Ue();if(Array.isArray(e))return e.forEach(function(r){t.appendChild(ye(r))}),t;Object.keys(e.row_cols||{}).forEach(function(r){var o=e.row_cols[r],a=Y(r);a&&We.indexOf(String(o))!==-1&&C(t,xn(a,o))});for(var n=0;n<(e.columns||0);n++)t.appendChild(ye(null));return t}function ho(e){return w.filter(function(t){return e&&e[t.key]!==void 0}).map(function(t){return(t.infix?t.key+": ":"")+e[t.key]}).join(", ")}function bo(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 wo(){var e=window.pageYOffset;e>St(A).top&&e<St(d).top+Br(d)?y(b,"ge-top")&&(Ee(b,{left:St(b).left,width:rt(b)}),M(b,"ge-top"),C(b,"ge-fixed")):y(b,"ge-fixed")&&(Ee(b,{left:"",width:""}),M(b,"ge-fixed"),C(b,"ge-top"))}function yo(){var e=this;if(!e.getAttribute("data-ge-content-type")&&!se()&&kt(e)){var t=qn();t.length&&(t.length===1?Wn(e,t[0]):Co(e,t))}}function Wn(e,t){return t.available&&!t.available()?(t.missingKey&&console.error(m(t.missingKey)),!1):q(function(){var n=te("plain",e,{source:"tool",from:"plain",to:t.type});if(!z("before-convert",n))return!1;C(e,"ge-content-type-"+t.type),e.setAttribute("data-ge-content-type",t.type);var r=e.parentElement;return y(r,"ge-text-block")&&(M(r,"ge-plain-block"),Q(r,".ge-tools-drawer").forEach(function(o){o.remove()})),z("after-convert",n),t.edit(e),!0})}function Co(e,t){var n=y(e.parentElement,"ge-text-block")?e.parentElement:null;n&&Kn(L(n,".ge-tools-drawer"),t.map(function(r){return{label:r.label,title:m("tool.convert_type",{editor:r.label}),attributes:{"data-ge-content-type":r.type},choose:function(){Wn(e,r)}}}),"ge-text-picker ge-convert-picker",n)}function Kn(e,t,n,r){if(se(),!!e){var o=Z(e,".ge-tools-drawer");o&&C(o,"ge-picker-open"),ee=e.appendChild(C(v("div",{class:"ge-size-picker"}),n||"")),t.forEach(function(a){var u=_t(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(f){f.preventDefault(),f.stopPropagation(),se(),a.choose()}),ee.appendChild(u)}),Bn(r||e)}}function Bn(e){e.addEventListener("mouseleave",function(){window.setTimeout(function(){ee&&!ee.matches(":hover")&&se()},400)},{once:!0})}function Vn(){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&&ne("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 qn(){return Vn().filter(function(e){return e.offered!==!1})}function Eo(e){return Vn().some(function(t){return t.type===e})}function Gn(){je(),pe()}function xo(){je(),ze(null),J.style.height=.8*document.documentElement.clientHeight+"px",J.value=d.innerHTML,Se(J),ce(d),Me=!0,ae("onSourceOpen",J)}function Xn(){ae("onSourceClose",J),Me=!1,Et(d,J.value),Se(d),pe(),ce(J)}function Yn(){return[".column"].concat(wt("regions")).join(", ")}function _o(e){return!!e&&e!==d&&d.contains(e)&&Ce(e,Yn())}function ze(e){if(e!==N){var t=N;t&&M(t,"ge-active-target"),N=e,e&&y(d,"ge-editing")&&C(e,"ge-active-target"),z("target-change",{canvas:d,target:e,from:t})}}function Gt(e,t){var n=Hn(e,{region:N,before:null},t);n&&n.scrollIntoView&&n.scrollIntoView({behavior:"smooth"})}function pe(){W&&!Ae(W.node)&&we(),ue&&ue.home&&!Ae(ue.home)&&de(),Rr(!0),C(d,"ge-editing"),R(d,"ge-drag-drawer",l.drag_handle==="drawer"),ci();var e=ji();Ii(e),Di(e),Ni(),Zo(),ei(),Ko(),ae("onInit"),bi(),Ei(),Nr(T),qe(d),N&&!d.contains(N)?ze(null):N&&C(N,"ge-active-target")}function je(){we(),M(d,"ge-editing ge-drag-drawer ge-dropping"),N&&M(N,"ge-active-target"),ae("onBeforeDeinit"),se(),Vt(),de(),k(d,".ge-tools-drawer").forEach(function(e){e.remove()}),dt.clear(),Ui(),ae("onDeinit"),Zt(d),k(d,"[data-ge-row-cols]").forEach(function(e){e.removeAttribute("data-ge-row-cols")}),Bo(),Li(),ki(),Rr(!1)}function Jn(){je(),et(d);var e=d.innerHTML;return pe(),e}function ko(e){je(),et(e);var t=e.outerHTML;return pe(),t}function Ao(){return _n(Jn())}function So(){Me&&Xn(),je(),N=null,Mn(),wr(),Er(),Dn(),J.remove(),Ln.abort(),Lt.delete(d),Sn=!0}function To(){var e=Oo();Yt("grid",{},po()),l.row_cols!==!1&&Yt("grid",{},pi());var t=function(r){return!l.plugins||l.plugins.indexOf(r)!==-1},n=function(r,o){return o.always===!0||t(r)};Object.keys(x.containers).forEach(function(r){t(r)&&(U[r]=x.containers[r](e))}),Object.keys(x.features).forEach(function(r){var o=x.features[r];n(r,o)&&(S[r]=o(e))}),Object.keys(x.utilities).forEach(function(r){t(r)&&(G[r]=x.utilities[r](e),(G[r].families||[]).forEach(function(o){Yt(r,G[r],o)}))}),Object.keys(S).forEach(function(r){var o=S[r].methods||{};Object.keys(o).forEach(function(a){Ge[a]=o[a]})}),(l.plugins||[]).forEach(function(r){U[r]||S[r]||G[r]||ne("plugin:"+r,'the "'+r+'" plugin is not loaded: include dist/plugins/grideditor.'+r+".js after the editor")})}function ae(e,t){[U,S,G].forEach(function(n){Object.keys(n).forEach(function(r){n[r][e]&&n[r][e](t)})})}function Oo(){return{canvas:d,settings:l,t:m,warn:F,containerId:Ho,defaultRegion:Wo,createTool:I,createMoveTool:_e,addSettingsTool:Qe,deleteNode:xe,place:Ct,createPaneControls:qo,makeLabelEditable:Go,labelIn:Xo,unwrapLabels:Yo,suspendToggles:ur,resumeToggles:dr,emit:z,payloadFor:te,operate:q,kindOf:ie,view:hn,viewTiers:function(){return Jr(T).map(function(e){return e.key})},breakpoints:w.map(function(e){return e.key}),getUtility:rr,setUtility:Qt,utilityField:Fo,bareStyle:zo,hostStyle:or,setHostStyle:No,openDialog:Cr,closeDialog:de,rowFromLayout:Ve,nodeHtml:ko,textReady:lo,attachPicker:fr,openPicker:Kn,closePicker:se,detailsOf:hr,drawerOf:Lo,toolbarItems:function(e){return A?k(A,'[data-ge-toolbar="feature"][data-ge-feature="'+e+'"]'):[]}}}function Lo(e){if(y(e,"ge-content")){var t=e.parentElement;return y(t,"ge-text-block")?L(t,".ge-tools-drawer"):null}return L(e,".ge-tools-drawer")}var ve={},Mo=".row, .column, .ge-content, .ge-element, [data-ge-container]",Ie="data-ge-preview",Xt=!1;function Yt(e,t,n){var r=n.name||n.prefix;if(ve[r]){F('the "'+e+'" plugin declares the utility "'+r+'", which the "'+ve[r].plugin+'" plugin already declared: ignored');return}ve[r]={plugin:e,family:Object.assign({},n,{name:r,values:n.values.map(String),appliesTo:n.appliesTo||t.appliesTo||["row","column"]})}}function ut(e,t){return ve[e]?ve[e].family:(ne("utility:"+e,t+"("+JSON.stringify(e)+"): no loaded plugin declares that utility"),null)}function $n(e,t){return t==="plain"&&(t="text"),e.appliesTo.indexOf(t)!==-1?!0:!!U[t]&&e.appliesTo.indexOf("container")!==-1}function Qn(e){return Object.keys(ve).map(function(t){return ve[t].family}).filter(function(t){return $n(t,e)})}function Jt(e,t,n){return e.className?e.className(t.key,n):e.prefix+(t.infix?"-"+t.infix:"")+"-"+n}function he(e,t,n){for(var r=(e.getAttribute("class")||"").split(/\s+/),o=0;o<t.values.length;o++)if(r.indexOf(Jt(t,n,t.values[o]))!==-1)return t.values[o];return null}function Zn(e,t,n){for(var r=w.indexOf(n)-1;r>=0;r--){var o=he(e,t,w[r]);if(o!==null)return{tier:w[r],value:o}}return null}function er(e,t,n){var r=he(e,t,n);if(r!==null)return r;var o=Zn(e,t,n);return o?o.value:null}function $t(e,t){return w.map(function(n){return{tier:n,value:he(e,t,n)}}).filter(function(n){return n.value!==null})}function tr(e,t,n,r){t.values.forEach(function(o){M(e,Jt(t,n,o))}),r!==null&&C(e,Jt(t,n,r)),xt(e)}function nr(e,t,n){return n===X?he(e,t,w[0]):er(e,t,Y(n))}function Po(e,t,n,r){if(n!==X){var o=Y(n);return he(e,t,o)===r?null:{writes:[{tier:o,value:r}],cleared:[]}}var a=[],u=[];return $t(e,t).forEach(function(f){f.tier!==w[0]&&(a.push({tier:f.tier,value:null}),u.push({breakpoint:f.tier.key,value:f.value}))}),he(e,t,w[0])!==r&&a.unshift({tier:w[0],value:r}),a.length?{writes:a,cleared:u}:null}function rr(e,t,n){e=fe(e);var r=ut(t,"getUtility");if(!r||!e)return null;var o=n===void 0?T:vn(n);return o===null?(F("getUtility("+JSON.stringify(n)+"): no such layout mode"),null):nr(e,r,o)}function Qt(e,t,n,r){r=typeof r=="string"?{view:r}:r||{},e=fe(e);var o=ut(t,"setUtility");if(!o||!e)return!1;var a=r.view===void 0?T:vn(r.view);if(a===null)return F("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 F("setUtility: "+JSON.stringify(n)+' is not a value of "'+t+'", which takes '+JSON.stringify(o.values)),!1;var u=ie(e);if(!$n(o,u))return F('setUtility: "'+t+'" does not apply to a '+u),!1;if(o.write)return o.write(e,n,a,r.source||"api");var f=Po(e,o,a,n);return f?q(function(){var c=te(u,e,{family:t,breakpoint:a,tiers:f.writes.map(function(p){return p.tier.key}),from:nr(e,o,a),to:n,cleared:f.cleared,source:r.source||"api"});return z("before-utility",c)?(f.writes.forEach(function(p){tr(e,o,p.tier,p.value)}),le(e),z("after-utility",c),!0):(le(e),!1)}):!1}function zo(e,t,n){var r=ut(t,"bareStyle");if(e=fe(e),!r||!e)return null;var o=e.getAttribute("class");w.forEach(function(u){tr(e,r,u,null)});var a=getComputedStyle(e).getPropertyValue(n);return o===null?e.removeAttribute("class"):e.setAttribute("class",o),a}function le(e){var t=hr(e);if(t){var n=O(t,".ge-classes");n&&(n.value=rn(e).join(" ")),Q(t,".ge-utilities").forEach(function(r){en(r)})}ar(e),qe(e)}function jo(e){return ke(e,Mo)}function qe(e){Zt(e),T!==X&&Io(e,Y(T)),gi(e),ae("onRefresh",e)}function Io(e,t){jo(e).forEach(function(n){var r=ie(n),o={};Qn(r).forEach(function(a){!a.preview||!$t(n,a).length||Object.assign(o,a.preview(er(n,a,t),n,r))}),r==="column"&&Object.assign(o,mi(n,t)),Object.keys(G).forEach(function(a){var u=G[a];u.preview&&Object.assign(o,u.preview(n,r,t.key))}),Object.keys(o).length&&Ro(n,o)})}function Ro(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(Ie,JSON.stringify(r))}function Zt(e){ke(e,"["+Ie+"]").forEach(function(t){var n=t.style,r={};try{r=JSON.parse(t.getAttribute(Ie))||{}}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(Ie),nt(t)})}function Do(e){var t=document.createElement("div"),n={};t.style.cssText=e.style.cssText;try{n=JSON.parse(e.getAttribute(Ie))||{}}catch(r){}return Object.keys(n).forEach(function(r){var o=n[r];o&&o[0]?t.style.setProperty(r,o[0],o[1]):t.style.removeProperty(r)}),t.style}function or(e,t){var n=Do(e);return t===void 0?n.cssText:{value:n.getPropertyValue(t),priority:n.getPropertyPriority(t)}}function No(e,t,n,r){if(n=n==null?"":String(n).trim(),r===void 0&&(r=or(e,t).priority),n!==""){var o=document.createElement("div").style;if(o.setProperty(t,n,r||""),o.getPropertyValue(t)==="")return!1}var a=e.hasAttribute(Ie);return a&&Zt(e),n===""?e.style.removeProperty(t):e.style.setProperty(t,n,r||""),nt(e),a&&qe(e),!0}function Uo(e){var t=ie(e),n=Qn(t).filter(function(u){return u.panel!==!1}).map(function(u){return ir(e,u)});if(Object.keys(G).forEach(function(u){var f=G[u],c=f.panel?f.panel(e,t):null;c&&n.push(c)}),!n.length)return null;var r=R(v("div",{class:"ge-utilities"}),"ge-open",Xt);On.set(r,e);var o=r.appendChild(v("a",{class:"ge-utilities-toggle"}));o.addEventListener("click",function(){Xt=!y(r,"ge-open"),br().forEach(function(u){k(u,".ge-utilities").forEach(function(f){R(f,"ge-open",Xt)})})});var a=r.appendChild(v("div",{class:"ge-utilities-body"}));return n.forEach(function(u){a.appendChild(u)}),en(r),r}function ir(e,t){var n=v("label",{class:"ge-utility","data-ge-family":t.name});n.appendChild(v("span",{class:"ge-utility-label"},t.labelKey?m(t.labelKey):t.name));var r=n.appendChild(v("select",{class:"form-select form-select-sm"}));return r.addEventListener("change",function(){Qt(e,t.name,this.value,{source:"panel"})}),n.appendChild(v("small",{class:"ge-utility-note"})),n}function Fo(e,t){var n=ut(t,"utilityField");if(!n)return null;var r=ir(e,n);return tn(r,e),dt.set(r,e),r}var dt=new Map;function ar(e){dt.forEach(function(t,n){if(!n.isConnected){dt.delete(n);return}e&&t!==e||Z(n,".ge-utilities")||tn(n,t)})}function en(e){var t=On.get(e);Q(e,".ge-utilities-toggle").forEach(function(n){n.textContent=m("utility.section",{view:m(it(T))})}),k(e,".ge-utility").forEach(function(n){tn(n,t)})}function tn(e,t){var n=ve[e.getAttribute("data-ge-family")].family,r=L(e,"select"),o=n.choices?n.choices(t,ie(t)):n.values,a,u,f="";if(r.innerHTML="",T===X){a=he(t,n,w[0]),u=m("utility.default");var c=$t(t,n).filter(function(P){return P.tier!==w[0]});c.length&&(f=m("utility.varies",{breakpoints:c.map(function(P){return P.tier.key}).join(", ")}))}else{var p=Y(T),h=Zn(t,n,p);a=he(t,n,p),u=h?m("utility.inherit",{value:lr(n,h.value),breakpoint:h.tier.key}):m("utility.default");var _=n.blank?n.blank(t,T):null;_&&a===null&&(u=_)}a!==null&&o.indexOf(a)===-1&&(o=o.concat([a])),r.appendChild(v("option",{value:""},u)),o.forEach(function(P){r.appendChild(v("option",{value:P},lr(n,P)))}),r.value=a===null?"":a;var E=L(e,".ge-utility-note");E.textContent=f,wn(E,f!=="")}function lr(e,t){return e.label?e.label(t):t}var U={},S={},G={},Ge={},sr=0;function Ho(e){return sr++,"ge-"+e+"-"+sr+"-"+Math.random().toString(36).slice(2,6)}function Wo(){var e=Ue();return e.appendChild(ye(D)),e}function Re(e){return e?e.getAttribute("data-ge-container"):null}function Ko(){k(d,"[data-ge-container]").forEach(function(e){var t=Re(e),n=U[t];if(!n){ne("container:"+t,'unknown container type "'+t+'"');return}C(e,"ge-container ge-container-"+t),n.mark(e),L(e,".ge-tools-drawer")||Vo(e,t,n)})}function Bo(){k(d,"[data-ge-container]").forEach(function(e){var t=U[Re(e)];t&&t.unmark(e),M(e,"ge-container ge-container-"+Re(e)),xt(e)})}function De(e,t){var n=v("div",{class:t});return e.insertBefore(n,e.firstChild),n}function ct(e,t){(t||[]).forEach(function(n){I(e,n.title||"",n.className||"",n.iconClass||"bi bi-wrench",n.on)})}function Vo(e,t,n){var r=De(e,"ge-tools-drawer ge-container-drawer");_e(r),Qe(r,e,l.container_classes),ct(r,l.container_tools),n.tools&&n.tools(r,e),I(r,m("tool.delete_container"),"ge-delete-container","bi bi-trash",function(){xe(t,e,m("confirm.delete_container"),function(o){ot(e,o)})}),n.addPane&&I(r,m(n.addPaneKey),"ge-add-pane","bi bi-plus-circle",function(){var o=n.addPane(e,{});re(n.paneKind,o,function(){},{parent:e,source:"tool",container:e})})}function qo(e,t,n,r,o){var a=De(e,"ge-tools-drawer ge-pane-drawer");return _e(a),Qe(a,e,l.pane_classes),ct(a,n),I(a,m("tool.delete_pane"),"ge-delete-pane","bi bi-trash",function(){xe(t,e,r,function(u){o(u)})}),a}function ur(e){e&&ke(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 dr(e){e&&ke(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 Go(e){if(!jt.has(e)){var t=Z(e,"[data-bs-toggle], [data-ge-bs-toggle]");jt.add(e),e.setAttribute("title",m("tool.rename")),e.addEventListener("dblclick",function(n){n.preventDefault(),n.stopPropagation(),ur(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"),dr(t)})}}function Xo(e){var t=L(e,".ge-pane-label");return t||(t=v("span",{class:"ge-pane-label"},e.textContent.trim()),e.innerHTML="",e.appendChild(t)),t}function Yo(e){k(e,".ge-pane-label").forEach(function(t){jt.delete(t),Ot(t)})}function cr(e,t){var n=ye(t);return re("column",n,function(){e.appendChild(n)},{parent:e,source:"tool"})}function Jo(e,t){!l.add_column.picker||!e||fr(e,function(){$o(e,t)})}function fr(e,t){var n=null,r=function(){window.clearTimeout(n),n=null};oe(e,"mouseenter mousedown",function(){n||ee||(n=window.setTimeout(function(){n=null,t()},l.add_column.delay))}),oe(e,"mouseleave mouseup",r)}function $o(e,t){se();var n=dn(t,be()),r=Z(e,".ge-tools-drawer");r&&C(r,"ge-picker-open"),ee=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:Qo(o)},V(o)?o:Te(w[0],o));R(a,"ge-size-tight",V(o)&&o>n),R(a,"ge-size-flex",!V(o)),a.addEventListener("click",function(u){u.preventDefault(),u.stopPropagation(),se(),cr(t,o)}),ee.appendChild(a)}),Bn(e)}function Qo(e){return e==="equal"?m("tool.column_equal"):e==="auto"?m("tool.column_auto"):m("tool.column_size",{size:e})}function se(){if(!ee)return!1;var e=Z(ee,".ge-tools-drawer");return e&&M(e,"ge-picker-open"),ee.remove(),ee=null,!0}function Zo(){k(d,".row").forEach(function(e){if(!L(e,".ge-tools-drawer")){var t=De(e,"ge-tools-drawer");_e(t),Qe(t,e,l.row_classes),ct(t,l.row_tools),I(t,m("tool.delete_row"),"ge-delete-row","bi bi-trash",function(){xe("row",e,m("confirm.delete_row"),function(n){ot(e,n)})}),I(t,m("tool.add_column"),"ge-add-column","bi bi-plus-circle",function(){se()||cr(e,Ze(e,be())?null:l.add_column.size)}),Jo(L(t,".ge-add-column"),e)}})}function ei(){k(d,".column").forEach(function(e){if(!L(e,".ge-tools-drawer")){var t=De(e,"ge-tools-drawer");_e(t),l.resize.tools!==!1&&(I(t,m("tool.column_narrower"),"ge-decrease-col-width","bi bi-dash-lg",function(n){Wt(e,n.shiftKey?$e(l.valid_col_sizes):ft(l.valid_col_sizes.filter(V),Ye(e),-1),"tool")}),I(t,m("tool.column_wider"),"ge-increase-col-width","bi bi-plus-lg",function(n){Wt(e,n.shiftKey?ti(e):ft(l.valid_col_sizes.filter(V),Ye(e),1),"tool")})),l.indent.tools!==!1&&(I(t,m("tool.indent_decrease"),"ge-decrease-col-offset","bi bi-text-indent-right",function(n){zn(e,n.shiftKey?$e(l.valid_col_offsets):ft(l.valid_col_offsets,Je(e),-1),"tool")}),I(t,m("tool.indent_increase"),"ge-increase-col-offset","bi bi-text-indent-left",function(n){zn(e,n.shiftKey?ni(e):ft(l.valid_col_offsets,Je(e),1),"tool")})),Qe(t,e,l.col_classes),ct(t,l.col_tools),I(t,m("tool.delete_column"),"ge-delete-column","bi bi-trash",function(){xe("column",e,m("confirm.delete_column"),function(n){Gr(e,400,n,!0)})}),I(t,m("tool.add_row"),"ge-add-row","bi bi-plus-circle",function(){var n=Ue();re("row",n,function(){e.appendChild(n)},{parent:e,source:"tool"})})}})}function be(){return T===X?w[w.length-1]:Y(T)}function Xe(e){var t=be();if(gt(e,t))return null;var n=sn(e,t);return n===null?D:n}function Ye(e){var t=Xe(e);if(V(t))return t;var n=Math.round(rt(e)/mr(e.parentElement)*D);return Math.min(Math.max(n,1),D)}function mr(e){var t=window.getComputedStyle(e);return e.clientWidth-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight)}function Je(e){return vt(e,be())||0}function ft(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 $e(e){return e.filter(V).reduce(function(t,n){return Math.min(t,n)},D)}function nn(e){return e.filter(V).reduce(function(t,n){return Math.max(t,n)},0)}function ti(e){var t=dn(e.parentElement,be(),e)-Je(e);return Math.min(nn(l.valid_col_sizes),Math.max(t,1))}function ni(e){var t=dn(e.parentElement,be(),e)-Ye(e);return Math.min(nn(l.valid_col_offsets),Math.max(t,0))}function _e(e){return l.drag_handle==="drawer"?null:I(e,m("tool.move"),"ge-move","bi bi-arrows-move")}function I(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){oe(a,u,o[u])}),a}function rn(e){return(e.getAttribute("class")||"").split(/\s+/).filter(function(t){return t!==""&&!ri(t)})}function ri(e){return e==="row"||e==="column"||/^(ge-|ui-)/.test(e)||/^col(-(sm|md|lg|xl|xxl))?(-auto)?$/.test(e)?!0:w.some(function(t){return new RegExp("^("+t.colPrefix+"|"+t.offsetPrefix+")\\d+$").test(e)})}function oi(e,t){rn(e).forEach(function(n){M(e,n)}),t.split(/\s+/).forEach(function(n){n!==""&&C(e,n)}),xt(e)}function Qe(e,t,n){var r=ii(t,n||[]);Tn.set(t,r),I(e,m("tool.settings"),"ge-settings","bi bi-gear-fill",function(){li(t,r,this)});var o=ie(t);return Object.keys(G).forEach(function(a){G[a].drawerTools&&G[a].drawerTools(e,t,o)}),Object.keys(S).forEach(function(a){S[a].drawerTools&&S[a].drawerTools(e,t,o)}),e.appendChild(r)}function ii(e,t){var n=v("div",{class:"ge-details"});n.appendChild(gr(m("panel.section_general")));var r=n.appendChild(v("div",{class:"ge-details-general"})),o=function(p){var h=v("label",{class:"ge-field"});return h.appendChild(v("span",{class:"ge-field-label"},p)),r.appendChild(h)},a=v("input",{class:"ge-id form-control form-control-sm",placeholder:m("tool.id_placeholder"),title:m("tool.id_title")});a.value=e.getAttribute("id")||"",o(m("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:m("tool.classes_placeholder"),title:m("tool.classes_title")});u.value=rn(e).join(" "),o(m("panel.classes")).appendChild(u),u.addEventListener("change",function(){oi(e,this.value),le(e)});var f=r.appendChild(v("div",{class:"btn-group btn-group-sm ge-presets",role:"group"}));t.forEach(function(p){var h=y(e,p.cssClass),_=v("a",{role:"button",class:"btn btn-sm btn-outline-secondary",title:p.title?p.title:m("tool.toggle_class",{label:p.label}),"aria-pressed":h?"true":"false"});_.innerHTML=p.label,R(_,"active",h),_.addEventListener("click",function(){R(_,"active"),_.setAttribute("aria-pressed",y(_,"active")?"true":"false"),R(e,p.cssClass,y(_,"active")),le(e)}),f.appendChild(_)}),ai(e).forEach(function(p){n.appendChild(p)});var c=Uo(e);return c&&n.appendChild(c),n}function gr(e){return v("h6",{class:"ge-section-title"},e)}function ai(e){var t=ie(e),n=vr(),r=[];return[U,S,G].forEach(function(o){Object.keys(o).forEach(function(a){var u=o[a],f=u.panelSection?u.panelSection(e,t):null;if(!(!f||!f.body)){var c=v("div",{class:"ge-panel-section","data-ge-plugin":a});if(n==="offcanvas"||n==="modal")c.appendChild(gr(m(f.labelKey))),c.appendChild(f.body);else{var p=m(f.labelKey),h=c.appendChild(v("button",{type:"button",class:"btn btn-sm btn-outline-secondary ge-panel-section-open"},p));ce(f.body),c.appendChild(f.body),h.addEventListener("click",function(){Cr(f.titleKey?m(f.titleKey,{kind:xr(e)}):p,f.body,h)})}r.push(c)}})}),r}var pr=["offcanvas","popover","modal","inline"],K={},W=null,mt=new WeakMap;function vr(){return pr.indexOf(l.settings_panel)!==-1?l.settings_panel:(ne("settings_panel",'settings_panel "'+l.settings_panel+'" is not one of '+pr.join(", ")+": using offcanvas"),"offcanvas")}function hr(e){return e&&Tn.get(e)||null}function br(){return W&&W.mode!=="inline"?[d,W.details]:[d]}function li(e,t,n){var r=vr();if(r==="inline"){wn(t);return}var o=W&&W.details===t;we(),o||si(r,e,t,n)}function si(e,t,n,r){var o=ui(e),a=new AbortController;W={mode:e,node:t,details:n,home:n.parentElement,next:n.nextElementSibling,gear:r,listening:a},O(o,".ge-settings-title").textContent=m("panel.title",{kind:xr(t)}),O(o,".ge-settings-body").appendChild(n),Se(n),C(t,"ge-settings-target");var u={signal:a.signal};if(document.addEventListener("keydown",function(c){c.key==="Escape"&&!ue&&we()},u),e==="offcanvas"){var f=window.innerWidth<576;R(o,"offcanvas-end",!f),R(o,"offcanvas-bottom",f),M(o,"hiding"),o.getBoundingClientRect(),C(o,"show")}else e==="popover"?(on(o,r),oe(window,"scroll resize",function(){on(o,r)},u),window.ResizeObserver&&(W.observer=new window.ResizeObserver(function(){on(o,r)}),W.observer.observe(n)),oe(document,"mousedown touchstart",function(c){!ue&&!o.contains(c.target)&&!r.contains(c.target)&&we()},u)):an(o,function(){W&&W.mode==="modal"&&we()})}function we(){de();var e=W;if(e){W=null;var t=K[e.mode];e.listening.abort(),e.observer&&e.observer.disconnect(),e.mode==="offcanvas"?(M(t,"show"),C(t,"hiding"),window.setTimeout(function(){M(t,"hiding")},300)):e.mode==="popover"?ce(t):ln(t),M(e.node,"ge-settings-target"),e.details.style.removeProperty("display"),nt(e.details),e.home&&Ae(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 ui(e){if(K[e])return K[e];var t=function(){return v("button",{type:"button",class:"btn-close ge-settings-close","aria-label":m("panel.close")})},n;return e==="offcanvas"?(n=B('<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>'),O(n,".offcanvas-header").appendChild(t())):e==="popover"?(n=B('<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>'),O(n,".popover-header").appendChild(t()),ce(n)):(n=B('<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>'),O(n,".modal-header").appendChild(t()),O(n,".modal-footer").appendChild(v("button",{type:"button",class:"btn btn-primary ge-settings-close"},m("panel.done")))),He(n,"click",".ge-settings-close",function(r){r.preventDefault(),we()}),K[e]=document.body.appendChild(n),n}function wr(){we(),Object.keys(K).forEach(function(e){e==="modal"?Dt(K[e]):K[e].remove()}),Object.keys(K).forEach(function(e){yr(K[e])}),K={}}function on(e,t){if(Ae(t)){Se(e);var n=t.getBoundingClientRect(),r=8,o=L(e,".popover-body");o.style.removeProperty("max-height");var a=rt(e),u=At(e),f=window.innerHeight-n.bottom-2*r,c=n.top-2*r,p=u<=f||f>=c,h=p?f:c;u>h&&(Ee(o,{"max-height":Math.max(120,h-(u-At(o)))}),u=At(e));var _=p?n.bottom+r:n.top-r-u,E=Math.max(r,Math.min(n.left+n.width/2-24,window.innerWidth-a-r));R(e,"bs-popover-bottom",p),R(e,"bs-popover-top",!p),Ee(e,{top:_+window.pageYOffset,left:E+window.pageXOffset}),Ee(L(e,".popover-arrow"),{left:Math.max(r,Math.min(n.left+n.width/2-E-8,a-24))})}}function an(e,t){var n=at(),r=mt.get(e);if(r||(r={wanted:null,busy:!1,backdrop:null,dismissed:t},mt.set(e,r)),r.dismissed=t,!n){r.backdrop||(r.backdrop=v("div",{class:"modal-backdrop fade show ge-settings-backdrop"}),r.backdrop.addEventListener("click",function(){r.dismissed()}),document.body.appendChild(r.backdrop)),C(e,"show"),e.style.display="block",e.removeAttribute("aria-hidden");return}var o=n.getOrCreateInstance(e);r.watched||(r.watched=!0,Pn(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"&&ln(e)}),e.addEventListener("hidden.bs.modal",function(){r.busy=!1,r.wanted==="open"?an(e,r.dismissed):r.dismissed()})),r.wanted="open",r.busy||(r.busy=!0,o.show())}function ln(e){var t=at(),n=mt.get(e);if(n){if(n.wanted="closed",!t){n.backdrop&&(n.backdrop.remove(),n.backdrop=null),M(e,"show"),e.style.removeProperty("display"),e.setAttribute("aria-hidden","true");return}!n.busy&&y(e,"show")&&(n.busy=!0,t.getOrCreateInstance(e).hide())}}function yr(e){var t=mt.get(e);t&&t.backdrop&&(t.backdrop.remove(),t.backdrop=null)}var $=null,ue=null;function di(){return $||($=B('<div class="modal fade ge-dialog" 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-dialog-title"></h5></div><div class="modal-body ge-dialog-body"></div><div class="modal-footer"></div></div></div></div>'),O($,".modal-header").appendChild(v("button",{type:"button",class:"btn-close ge-dialog-close","aria-label":m("panel.close")})),O($,".modal-footer").appendChild(v("button",{type:"button",class:"btn btn-primary ge-dialog-close"},m("panel.done"))),He($,"click",".ge-dialog-close",function(e){e.preventDefault(),de()}),document.body.appendChild($))}function Cr(e,t,n){de();var r=di(),o=new AbortController;ue={body:t,home:t.parentElement,next:t.nextElementSibling,opener:n||document.activeElement,listening:o},O(r,".ge-dialog-title").textContent=e,O(r,".ge-dialog-body").appendChild(t),Se(t),at()||document.addEventListener("keydown",function(a){a.key==="Escape"&&de()},{signal:o.signal}),Object.keys(K).forEach(function(a){C(K[a],"ge-under-dialog")}),an(r,function(){de()})}function de(){var e=ue;e&&(ue=null,e.listening.abort(),ln($),Object.keys(K).forEach(function(t){M(K[t],"ge-under-dialog")}),ce(e.body),e.home&&Ae(e.home)?e.next&&e.next.parentElement===e.home?e.home.insertBefore(e.body,e.next):e.home.appendChild(e.body):e.body.remove(),e.opener&&Ae(e.opener)&&e.opener.focus&&e.opener.focus())}function Er(){de(),$&&(yr($),Dt($),$=null)}function xr(e){var t=ie(e);if(U[t]&&U[t].labelKey)return m(U[t].labelKey);switch(t){case"row":return m("panel.kind_row");case"column":return m("panel.kind_column");case"text":return m("panel.kind_text");case"element":return m("panel.kind_element");case"section":return m("panel.kind_section");case"tab":return m("panel.kind_tab");case"accordion-item":return m("panel.kind_accordion_item");default:return t}}function ci(){k(d,'.column, div[class*="col-"], div.col').forEach(function(e){C(e,"column"),!(vi(e).length||_r(e.parentElement))&&ht(e,w[0],D)})}function _r(e){return y(e,"row")&&w.some(function(t){return We.some(function(n){return y(e,xn(t,n))})})}function Ze(e,t){if(!y(e,"row"))return null;for(var n=w.indexOf(t);n>=0;n--)for(var r=0;r<We.length;r++)if(y(e,xn(w[n],We[r])))return{tier:n,value:We[r]};return null}function kr(e,t){for(var n=w.indexOf(t);n>=0;n--){var r=Ne(e,w[n]);if(r!==null)return{tier:n,size:r}}return null}function gt(e,t){var n=Ze(e.parentElement,t);if(!n)return null;var r=kr(e,t);return!r||n.tier>r.tier||n.tier===r.tier&&r.size==="equal"?n:null}function fi(e){return e.value==="auto"?0:D/parseInt(e.value,10)}function mi(e,t){var n=gt(e,t);return n?{flex:"0 0 auto",width:n.value==="auto"?"auto":100/parseInt(n.value,10)+"%","max-width":"100%"}:_r(e.parentElement)&&!kr(e,t)?{flex:"0 0 auto",width:"100%","max-width":"100%"}:{}}function gi(e){ke(e,".row").forEach(function(t){var n=l.row_cols===!1?null:T===X?Ze(t,w[0])||null:Ze(t,Y(T));n?t.setAttribute("data-ge-row-cols",Ar(n.value)):t.removeAttribute("data-ge-row-cols")})}function Ar(e){return e==="auto"?m("badge.row_cols_auto"):m("badge.row_cols",{count:e})}function pi(){return{name:"row-cols",prefix:"row-cols",values:We,appliesTo:["row"],labelKey:"utility.row_cols"}}function Ne(e,t){var n=Tr(e,t.colPrefix);return n!==null?n:y(e,Te(t,"auto"))?"auto":y(e,Te(t,"equal"))?"equal":null}function pt(e,t){return Tr(e,t.offsetPrefix)}function sn(e,t){return Sr(e,t,Ne)}function vt(e,t){return Sr(e,t,pt)}function Sr(e,t,n){for(var r=w.indexOf(t);r>=0;r--){var o=n(e,w[r]);if(o!==null)return o}return null}function Tr(e,t){var n=new RegExp("(?:^|\\s)"+t+"(\\d+)(?:\\s|$)").exec(e.getAttribute("class")||"");return n?parseInt(n[1],10):null}function Or(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 ht(e,t,n){Or(e,t.colPrefix,null),En.forEach(function(r){M(e,Te(t,r))}),n!=null&&C(e,Te(t,n))}function un(e,t,n){Or(e,t.offsetPrefix,n||null)}function vi(e){return w.filter(function(t){return Ne(e,t)!==null})}function dn(e,t,n){var r=0;return Q(e,".column").forEach(function(o){if(!(n&&o===n)){var a=gt(o,t),u=a?fi(a):sn(o,t);r+=(V(u)?u:0)+(vt(o,t)||0)}}),D-r}function bt(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),Yr),t===null||!V(t)?{size:t,offset:n,refused:!1}:(t=Math.min(Math.max(t,1),D),t+n<=D?{size:t,offset:n,refused:!1}:e.leading==="offset"?{size:D-n,offset:n,refused:!1}:{size:null,offset:n,refused:!0})}function et(e){ke(e,".column").forEach(function(t){Ee(t,{width:"",height:"",left:"",top:""}),nt(t)})}function Lr(e){return"ge-"+e+"-"+eo}function cn(){return[".row",".ge-text-block",".ge-content","[data-ge-container]"].concat(wt("blocks")).join(", ")}function wt(e){return Object.keys(S).map(function(t){return S[t][e]||null}).filter(function(t){return t!==null})}function fn(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 hi(){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 yt(e,t){var n=Qr();if(e=Array.isArray(e)?e:e?[e]:[],!(!e.length||!n)){var r=l.drag_handle==="drawer",o=hi(),a=0;e.forEach(function(u){var f=t.group?{name:Lr(t.group)}:{name:Lr(t.draggable+"-"+ ++a),pull:!1,put:!1};t.group&&t.accepts&&(f.put=function(c,p,h){return p.options.group.name===f.name&&t.accepts(c.el,h)}),Pt.push(n.create(u,Object.assign({group:f,draggable:t.draggable,handle:r?".ge-tools-drawer":".ge-tools-drawer .ge-move",filter:function(c,p){return Z(c.target,o,u)?!0:!p||p.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:wi,onEnd:Ci},t.options||{})))})}}function bi(){if(!Qr()){ne("sortable_missing",m("error.sortable_missing"));return}yt(k(d,".row"),{draggable:".column",group:"column"}),yt([d].concat(k(d,".column")),{draggable:cn(),group:"block",accepts:fn});var e=wt("regions");e.length&&yt(k(d,e.join(", ")),{draggable:">"+cn(),group:"block",accepts:fn}),ae("onSortable",yt)}function wi(e){var t=e.item,n=Kt(t),r=Mr(t),o={from:n,canceled:!1};zt.set(t,o),q(function(){var a=z("before-move",te(r.kind,r.node,{parent:n.parent,source:"dragdrop",from:n}));a||(o.canceled=!0)})}function Mr(e){var t=y(e,"ge-text-block")&&L(e,".ge-content")||e;return{kind:ie(t),node:t}}function yi(e,t){var n=Q(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 Ci(e){var t=e.item,n=zt.get(t),r=n?n.from:Kt(t);if(zt.delete(t),n&&n.canceled){yi(t,r);return}var o=Kt(t);if(!(o.parent===r.parent&&o.index===r.index)){var a=Z(t,"[data-ge-container]"),u=U[Re(a)];u&&u.afterPaneMove&&u.afterPaneMove(a,t,r);var f=Mr(t);q(function(){z("after-move",te(f.kind,f.node,{parent:o.parent,source:"dragdrop",from:r,to:o,container:a||void 0}))})}}function Ei(){l.resize.enabled&&k(d,".column").forEach(function(e){if(!L(e,".ge-resize-handle")){var t=L(e,".ge-tools-drawer");t&&t.appendChild(v("span",{class:"ge-resize-size"})),xi().forEach(function(n){var r=v("span",{class:"ge-resize-handle ge-resize-"+n,"data-ge-edge":n});r.addEventListener("pointerdown",_i),e.appendChild(r)})}})}function xi(){return String(l.resize.handles).split(",").map(function(e){return e.trim()}).filter(function(e){return e==="e"||e==="w"})}function _i(e){var t=e.currentTarget,n=t.parentElement,r=t.getAttribute("data-ge-edge")==="w",o=e.pageX,a=rt(n);if(e.preventDefault(),!Ai(n))return;C(n,"ge-resizing"),e.pointerId!==void 0&&t.setPointerCapture&&t.setPointerCapture(e.pointerId);function u(p){var h=p.pageX-o;return Math.max(1,a+(r?-h:h))}function f(p){n.style.width=u(p)+"px",Si(n,u(p))}function c(p){t.removeEventListener("pointermove",f),yn(t,"pointerup pointercancel",c),M(n,"ge-resizing"),Ti(n,u(p))}t.addEventListener("pointermove",f),oe(t,"pointerup pointercancel",c)}function ki(){k(d,".ge-resize-handle").forEach(function(e){e.remove()}),k(d,".ge-resize-size").forEach(function(e){e.remove()}),et(d)}function Pr(e,t){var n=Math.round(t/mr(e.parentElement)*D),r=zr(e),o=r?Xe(r):null,a=st.get(e),u=a?a.units:Ye(e),f=r&&V(o)?u+o-$e(l.valid_col_sizes):D-Je(e);return Math.min(Math.max(n,$e(l.valid_col_sizes)),Math.max(f,$e(l.valid_col_sizes)),nn(l.valid_col_sizes))}function zr(e){return l.resize.balance!=="next"?null:Wr(e,".column")[0]||null}function mn(e,t){var n=L(e,".ge-tools-drawer"),r=n?L(n,".ge-resize-size"):null;r&&(r.textContent=t)}function jr(e){return(T===X?w[0].colPrefix:be().colPrefix)+e}function Ai(e){var t=Xe(e),n=q(function(){return z("before-resize",te("column",e,{source:"dragdrop",from:t,to:null}))});if(!n)return!1;var r={from:t,units:Ye(e)};return st.set(e,r),mn(e,jr(r.units)),!0}function Si(e,t){mn(e,jr(Pr(e,t)))}function Ti(e,t){var n=st.get(e),r=Pr(e,t);if(st.delete(e),mn(e,""),et(e),!!n&&r!==n.units){var o=Ut(e,r);o&&q(function(){Ft(e,o),Oi(e,r-n.units),le(e),z("after-resize",te("column",e,Ht({source:"dragdrop",from:n.from,to:o.size},o.cleared)))})}}function Oi(e,t){var n=zr(e);if(!(!n||!t)){var r=Xe(n);if(V(r)){var o=Ut(n,r-t);o&&(Ft(n,o),le(n))}}}function Li(){Pt.forEach(function(e){e.destroy()}),Pt=[]}function Ue(){return v("div",{class:"row"})}function Ct(e,t,n){var r=null;if(Yi.forEach(function(f){r===null&&n&&n[f]!==void 0&&(r=f)}),r===null)return e;var o=fe(n[r]);if(!o)return F(t+": "+r+" matches no element; the "+t+" is left detached"),e;var a=r==="appendTo"||r==="prependTo"?o:o.parentElement,u=function(){return re(t,e,function(){r==="appendTo"?o.appendChild(e):r==="prependTo"?o.insertBefore(e,o.firstChild):r==="insertBefore"?o.parentNode.insertBefore(e,o):Tt(e,o)},{parent:a,source:n.source||"api"})};return Ke>0?(Rt(u),e):u()}function Mi(e,t){var n=Ue();return e!==void 0&&!Array.isArray(e)&&!(e&&e.row_cols)&&(F("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=Ve(e)),(Array.isArray(e)?e:[]).forEach(function(r){n.appendChild(ye(r))}),Ct(n,"row",t)}function Pi(e,t){t=t||{};var n=fe(t.appendTo||t.prependTo||null);e===void 0&&n&&Ze(n,be())?e=null:!V(e)&&En.indexOf(e)===-1&&(F("createColumn: no column size given, using "+D),e=D);var r=ye(e,t.offset);return t.content!==void 0&&r.appendChild(Wi(t.content)),Ct(r,"column",t)}function zi(e,t){t=t||{};var n=U[e];return n?Ct(n.create(t),e,t):(F('createContainer: no such container type "'+e+'"'),null)}function Ir(e,t,n){e=fe(e),n=n||{};var r=U[Re(e)];if(!r||Re(e)!==t)return F("this is not a "+t+" container"),null;var o=r.addPane(e,n);return re(r.paneKind,o,function(){},{parent:e,source:"api",container:e})}function gn(){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 ye(e,t){var n=v("div",{class:"column"}),r=Jr(T)[0],o=bt({size:e,offset:t||0,leading:"offset"});return ht(n,r,o.size===null?e:o.size),un(n,r,o.offset),n}function Rr(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 ji(){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 Ii(e){k(d,".column > .ge-content, .column > .ge-text-block > .ge-content").forEach(function(t){if(!(y(t,"ge-rte-active")||!Q(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(c){c.nodeType===1&&c.matches(e)?(o.push({text:a},{block:c}),a=[]):a.push(c)}),o.push({text:a});t.firstChild;)t.removeChild(t.firstChild);var u=!1,f=r;o.forEach(function(c){var p;if(c.block)p=c.block;else if(Ri(c.text))u?(p=pn(n),c.text.forEach(function(h){p.appendChild(h)})):(c.text.forEach(function(h){t.appendChild(h)}),p=r,u=!0);else return;p!==f&&Tt(p,f),f=p}),u||r.remove()}})}function Ri(e){return e.some(function(t){return t.nodeType===1||t.nodeType===3&&/\S/.test(t.nodeValue)})}function Di(e){k(d,".column").forEach(function(t){var n=[];Q(t).forEach(function(r){Ce(r,".ge-tools-drawer, .ge-resize-handle")||(Ce(r,".ge-content, .ge-text-block")||r.matches(e)?n=Dr(n):n.push(r))}),Dr(n)})}function Dr(e){if(e.length){var t=Tt(pn(),e[e.length-1]);e.forEach(function(n){t.appendChild(n)})}return[]}function pn(e){var t=v("div",{class:"ge-content"});return e&&(C(t,"ge-content-type-"+e),t.setAttribute("data-ge-content-type",e)),t}function Ni(){k(d,".column > .ge-content").forEach(function(e){Vr(e,v("div",{class:"ge-text-block"}))}),k(d,".ge-text-block").forEach(function(e){if(!L(e,".ge-tools-drawer")){var t=L(e,".ge-content"),n=t?t.getAttribute("data-ge-content-type"):null;n?Eo(n)||Hi(e,n):Fi(e)}})}function Ui(){k(d,".ge-text-block").forEach(function(e){Ot(e)})}function Fi(e){var t=L(e,".ge-content"),n=De(e,"ge-tools-drawer ge-text-drawer ge-plain-drawer");C(e,"ge-plain-block"),_e(n),Object.keys(S).forEach(function(r){S[r].plainTools&&S[r].plainTools(n,t)}),I(n,m("tool.delete_plain"),"ge-delete-plain","bi bi-trash",function(){xe("plain",t,m("confirm.delete_plain"),function(r){ot(e,function(){e.remove(),r()})})})}function Hi(e,t){var n=L(e,".ge-content"),r=De(e,"ge-tools-drawer ge-text-drawer");_e(r),I(r,m("text.no_editor",{type:t}),"ge-text-info ge-text-missing","bi bi-exclamation-triangle"),I(r,m("tool.delete_text"),"ge-delete-text","bi bi-trash",function(){xe("text",n,m("confirm.delete_text"),function(o){ot(e,function(){e.remove(),o()})})})}function Wi(e){var t=qn(),n=pn(t.length?t[0].type:null);return e&&e.nodeType?n.appendChild(e):Et(n,e),n}function Nr(e){T=e,Cn.forEach(function(t){R(d,"ge-layout-"+t,t===e)}),O(Le,"button").textContent=m(it(e))}function vn(e){return Cn.indexOf(e)===-1?null:e}function Ur(e){var t=vn(e);if(t===null){F("changeView("+JSON.stringify(e)+"): no such layout mode");return}var n=T;Nr(t),t!==n&&(br().forEach(function(r){k(r,".ge-utilities").forEach(function(o){en(o)})}),ar(null),qe(d),ae("onViewChange",t),z("view-change",{canvas:d,breakpoint:t,from:n,to:t}))}function hn(){return T}function Fr(e,t,n){return function(){return Ge[e]?Ge[e].apply(null,arguments):(ne("plugin:"+t,e+" needs the "+t+" plugin: include dist/plugins/grideditor."+n+".js after the editor"),null)}}function Ki(e){if(!l.active_target){ne("active_target","setActiveTarget needs the active_target setting: without it, it does nothing");return}if(e==null){ze(null);return}var t=fe(e);if(!_o(t)){var n=typeof e=="string"?e:t?"<"+t.tagName.toLowerCase()+">":String(e);F("setActiveTarget: "+n+" is not a column or a region of the canvas");return}ze(t)}var Hr={getHtml:Jn,getPlainHtml:Ao,init:function(){Rt(pe)},reset:function(){Rt(Gn)},deinit:je,destroy:So,changeView:Ur,getView:hn,createRow:Mi,createColumn:Pi,createText:function(e,t){return Ge.createText?Ge.createText(e,t):(ne("plugin:text","createText needs a text editor plugin: include dist/plugins/grideditor.tinymce.js, or another editor's, after the editor"),null)},createElement:Fr("createElement","elements","elements"),createSection:Fr("createSection","sections","sections"),createContainer:zi,addTab:function(e,t){return Ir(e,"tabs",t)},addAccordionItem:function(e,t){return Ir(e,"accordion",t)},setLocale:to,getUtility:rr,setUtility:Qt,getActiveTarget:function(){return l.active_target?N:null},setActiveTarget:Ki};Object.keys(Hr).forEach(function(e){var t=!!(Xr[e]&&Xr[e].value);i[e]=function(){if(Sn)return ne("destroyed:"+e,m("warning.destroyed",{method:e})),e==="getHtml"?d.innerHTML:e==="getPlainHtml"?_n(d.innerHTML):t?null:i;var n=Hr[e].apply(i,arguments);return t?n:i}}),i.canvas=d,i.settings=gn(),Lt.set(d,i),To(),i.settings=gn(),ao(),pe(),x._created.forEach(function(e){e(i)})}x._created=[];x.containers={};x.features={};x.utilities={};x.texts={};x.t=kn;x._plainHtml=_n;x.Sortable=null;x.bootstrap=null;x.version="8.3.0";x.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
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
11
  (hold shift for min)`,"tool.column_wider":`Make column wider
12
12
  (hold shift for max)`,"tool.indent_decrease":`Decrease indent
13
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.section_general":"Id and 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.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.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 5 not available! Make sure you loaded its ckeditor5.umd.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: "+E.t({locale:"en"},"warning.duplicate_build")):window.GridEditor=E;})();
14
+ (hold shift for max)`,"tool.edit_source":"Edit Source Code","tool.preview":"Preview","tool.more":"More","panel.title":"{kind} settings","panel.close":"Close","panel.done":"Done","panel.id":"Id","panel.classes":"Classes","panel.section_general":"Id and 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.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.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 5 not available! Make sure you loaded its ckeditor5.umd.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: "+x.t({locale:"en"},"warning.duplicate_build")):window.GridEditor=x;})();