@themarioga/grid-editor 3.2.1 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BUILDING.md +12 -3
- package/CHANGELOG.md +45 -0
- package/README.md +26 -6
- package/UPGRADING.md +79 -0
- package/dist/grideditor.css +40 -20
- package/dist/grideditor.min.css +1 -1
- package/dist/grideditor.min.css.map +1 -1
- package/dist/jquery.grideditor.bundle.min.js +10 -0
- package/dist/jquery.grideditor.js +369 -165
- package/dist/jquery.grideditor.min.js +1 -1
- package/dist/jquery.grideditor.min.js.map +1 -1
- package/dist/locales/grideditor.es.js +2 -0
- package/dist/locales/grideditor.es.min.js +1 -1
- package/dist/locales/grideditor.es.min.js.map +1 -1
- package/dist/plugins/grideditor.accordion.js +8 -0
- package/dist/plugins/grideditor.accordion.min.js +1 -1
- package/dist/plugins/grideditor.accordion.min.js.map +1 -1
- package/dist/plugins/grideditor.elements.js +5 -5
- package/dist/plugins/grideditor.elements.min.js +1 -1
- package/dist/plugins/grideditor.elements.min.js.map +1 -1
- package/dist/plugins/grideditor.tabs.js +8 -0
- package/dist/plugins/grideditor.tabs.min.js +1 -1
- package/dist/plugins/grideditor.tabs.min.js.map +1 -1
- package/docs/events.md +6 -7
- package/docs/locale-keys.md +2 -0
- package/docs/plugins.md +21 -7
- package/example/autosave.html +1 -1
- package/example/basic.html +3 -2
- package/example/breakpoints.html +1 -1
- package/example/ckeditor.html +1 -1
- package/example/containers.html +1 -1
- package/example/elements.html +1 -1
- package/example/locale.html +1 -1
- package/example/plugins.html +1 -1
- package/example/summernote.html +1 -1
- package/example/wrap_content.html +1 -1
- package/package.json +3 -2
- package/src/js/jquery.grideditor.js +369 -165
- package/src/js/locales/grideditor.es.js +2 -0
- package/src/js/plugins/grideditor.accordion.js +8 -0
- package/src/js/plugins/grideditor.elements.js +5 -5
- package/src/js/plugins/grideditor.tabs.js +8 -0
- package/src/less/grideditor.less +43 -18
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* grid-editor 4.0.0 bundled with SortableJS.
|
|
3
|
+
*
|
|
4
|
+
* grid-editor: MIT, https://github.com/themarioga/grid-editor
|
|
5
|
+
* SortableJS: MIT, https://github.com/SortableJS/Sortable
|
|
6
|
+
*/
|
|
7
|
+
/*! Sortable 1.15.6 - MIT | git://github.com/SortableJS/Sortable.git */
|
|
8
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).Sortable=e()}(this,function(){"use strict";function e(e,t){var n,o=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),o.push.apply(o,n)),o}function I(o){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?e(Object(i),!0).forEach(function(t){var e,n;e=o,t=i[n=t],n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach(function(t){Object.defineProperty(o,t,Object.getOwnPropertyDescriptor(i,t))})}return o}function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function a(){return(a=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n,o=arguments[e];for(n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t}).apply(this,arguments)}function i(t,e){if(null==t)return{};var n,o=function(t,e){if(null==t)return{};for(var n,o={},i=Object.keys(t),r=0;r<i.length;r++)n=i[r],0<=e.indexOf(n)||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols)for(var i=Object.getOwnPropertySymbols(t),r=0;r<i.length;r++)n=i[r],0<=e.indexOf(n)||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n]);return o}function r(t){return function(t){if(Array.isArray(t))return l(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return l(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(n="Object"===n&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}function t(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var y=t(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),w=t(/Edge/i),s=t(/firefox/i),u=t(/safari/i)&&!t(/chrome/i)&&!t(/android/i),c=t(/iP(ad|od|hone)/i),n=t(/chrome/i)&&t(/android/i),d={capture:!1,passive:!1};function h(t,e,n){t.addEventListener(e,n,!y&&d)}function p(t,e,n){t.removeEventListener(e,n,!y&&d)}function f(t,e){if(e&&(">"===e[0]&&(e=e.substring(1)),t))try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){return}}function g(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function P(t,e,n,o){if(t){n=n||document;do{if(null!=e&&(">"!==e[0]||t.parentNode===n)&&f(t,e)||o&&t===n)return t}while(t!==n&&(t=g(t)))}return null}var m,v=/\s+/g;function k(t,e,n){var o;t&&e&&(t.classList?t.classList[n?"add":"remove"](e):(o=(" "+t.className+" ").replace(v," ").replace(" "+e+" "," "),t.className=(o+(n?" "+e:"")).replace(v," ")))}function R(t,e,n){var o=t&&t.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];o[e=!(e in o||-1!==e.indexOf("webkit"))?"-webkit-"+e:e]=n+("string"==typeof n?"":"px")}}function b(t,e){var n="";if("string"==typeof t)n=t;else do{var o=R(t,"transform")}while(o&&"none"!==o&&(n=o+" "+n),!e&&(t=t.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function D(t,e,n){if(t){var o=t.getElementsByTagName(e),i=0,r=o.length;if(n)for(;i<r;i++)n(o[i],i);return o}return[]}function O(){var t=document.scrollingElement;return t||document.documentElement}function X(t,e,n,o,i){if(t.getBoundingClientRect||t===window){var r,a,l,s,c,u,d=t!==window&&t.parentNode&&t!==O()?(a=(r=t.getBoundingClientRect()).top,l=r.left,s=r.bottom,c=r.right,u=r.height,r.width):(l=a=0,s=window.innerHeight,c=window.innerWidth,u=window.innerHeight,window.innerWidth);if((e||n)&&t!==window&&(i=i||t.parentNode,!y))do{if(i&&i.getBoundingClientRect&&("none"!==R(i,"transform")||n&&"static"!==R(i,"position"))){var h=i.getBoundingClientRect();a-=h.top+parseInt(R(i,"border-top-width")),l-=h.left+parseInt(R(i,"border-left-width")),s=a+r.height,c=l+r.width;break}}while(i=i.parentNode);return o&&t!==window&&(o=(e=b(i||t))&&e.a,t=e&&e.d,e&&(s=(a/=t)+(u/=t),c=(l/=o)+(d/=o))),{top:a,left:l,bottom:s,right:c,width:d,height:u}}}function Y(t,e,n){for(var o=M(t,!0),i=X(t)[e];o;){var r=X(o)[n];if(!("top"===n||"left"===n?r<=i:i<=r))return o;if(o===O())break;o=M(o,!1)}return!1}function B(t,e,n,o){for(var i=0,r=0,a=t.children;r<a.length;){if("none"!==a[r].style.display&&a[r]!==jt.ghost&&(o||a[r]!==jt.dragged)&&P(a[r],n.draggable,t,!1)){if(i===e)return a[r];i++}r++}return null}function F(t,e){for(var n=t.lastElementChild;n&&(n===jt.ghost||"none"===R(n,"display")||e&&!f(n,e));)n=n.previousElementSibling;return n||null}function j(t,e){var n=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)"TEMPLATE"===t.nodeName.toUpperCase()||t===jt.clone||e&&!f(t,e)||n++;return n}function E(t){var e=0,n=0,o=O();if(t)do{var i=b(t),r=i.a,i=i.d}while(e+=t.scrollLeft*r,n+=t.scrollTop*i,t!==o&&(t=t.parentNode));return[e,n]}function M(t,e){if(!t||!t.getBoundingClientRect)return O();var n=t,o=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=R(n);if(n.clientWidth<n.scrollWidth&&("auto"==i.overflowX||"scroll"==i.overflowX)||n.clientHeight<n.scrollHeight&&("auto"==i.overflowY||"scroll"==i.overflowY)){if(!n.getBoundingClientRect||n===document.body)return O();if(o||e)return n;o=!0}}}while(n=n.parentNode);return O()}function S(t,e){return Math.round(t.top)===Math.round(e.top)&&Math.round(t.left)===Math.round(e.left)&&Math.round(t.height)===Math.round(e.height)&&Math.round(t.width)===Math.round(e.width)}function _(e,n){return function(){var t;m||(1===(t=arguments).length?e.call(this,t[0]):e.apply(this,t),m=setTimeout(function(){m=void 0},n))}}function H(t,e,n){t.scrollLeft+=e,t.scrollTop+=n}function C(t){var e=window.Polymer,n=window.jQuery||window.Zepto;return e&&e.dom?e.dom(t).cloneNode(!0):n?n(t).clone(!0)[0]:t.cloneNode(!0)}function T(t,e){R(t,"position","absolute"),R(t,"top",e.top),R(t,"left",e.left),R(t,"width",e.width),R(t,"height",e.height)}function x(t){R(t,"position",""),R(t,"top",""),R(t,"left",""),R(t,"width",""),R(t,"height","")}function L(n,o,i){var r={};return Array.from(n.children).forEach(function(t){var e;P(t,o.draggable,n,!1)&&!t.animated&&t!==i&&(e=X(t),r.left=Math.min(null!==(t=r.left)&&void 0!==t?t:1/0,e.left),r.top=Math.min(null!==(t=r.top)&&void 0!==t?t:1/0,e.top),r.right=Math.max(null!==(t=r.right)&&void 0!==t?t:-1/0,e.right),r.bottom=Math.max(null!==(t=r.bottom)&&void 0!==t?t:-1/0,e.bottom))}),r.width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}var K="Sortable"+(new Date).getTime();function A(){var e,o=[];return{captureAnimationState:function(){o=[],this.options.animation&&[].slice.call(this.el.children).forEach(function(t){var e,n;"none"!==R(t,"display")&&t!==jt.ghost&&(o.push({target:t,rect:X(t)}),e=I({},o[o.length-1].rect),!t.thisAnimationDuration||(n=b(t,!0))&&(e.top-=n.f,e.left-=n.e),t.fromRect=e)})},addAnimationState:function(t){o.push(t)},removeAnimationState:function(t){o.splice(function(t,e){for(var n in t)if(t.hasOwnProperty(n))for(var o in e)if(e.hasOwnProperty(o)&&e[o]===t[n][o])return Number(n);return-1}(o,{target:t}),1)},animateAll:function(t){var c=this;if(!this.options.animation)return clearTimeout(e),void("function"==typeof t&&t());var u=!1,d=0;o.forEach(function(t){var e=0,n=t.target,o=n.fromRect,i=X(n),r=n.prevFromRect,a=n.prevToRect,l=t.rect,s=b(n,!0);s&&(i.top-=s.f,i.left-=s.e),n.toRect=i,n.thisAnimationDuration&&S(r,i)&&!S(o,i)&&(l.top-i.top)/(l.left-i.left)==(o.top-i.top)/(o.left-i.left)&&(t=l,s=r,r=a,a=c.options,e=Math.sqrt(Math.pow(s.top-t.top,2)+Math.pow(s.left-t.left,2))/Math.sqrt(Math.pow(s.top-r.top,2)+Math.pow(s.left-r.left,2))*a.animation),S(i,o)||(n.prevFromRect=o,n.prevToRect=i,e=e||c.options.animation,c.animate(n,l,i,e)),e&&(u=!0,d=Math.max(d,e),clearTimeout(n.animationResetTimer),n.animationResetTimer=setTimeout(function(){n.animationTime=0,n.prevFromRect=null,n.fromRect=null,n.prevToRect=null,n.thisAnimationDuration=null},e),n.thisAnimationDuration=e)}),clearTimeout(e),u?e=setTimeout(function(){"function"==typeof t&&t()},d):"function"==typeof t&&t(),o=[]},animate:function(t,e,n,o){var i,r;o&&(R(t,"transition",""),R(t,"transform",""),i=(r=b(this.el))&&r.a,r=r&&r.d,i=(e.left-n.left)/(i||1),r=(e.top-n.top)/(r||1),t.animatingX=!!i,t.animatingY=!!r,R(t,"transform","translate3d("+i+"px,"+r+"px,0)"),this.forRepaintDummy=t.offsetWidth,R(t,"transition","transform "+o+"ms"+(this.options.easing?" "+this.options.easing:"")),R(t,"transform","translate3d(0,0,0)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout(function(){R(t,"transition",""),R(t,"transform",""),t.animated=!1,t.animatingX=!1,t.animatingY=!1},o))}}}var N=[],W={initializeByDefault:!0},z={mount:function(e){for(var t in W)!W.hasOwnProperty(t)||t in e||(e[t]=W[t]);N.forEach(function(t){if(t.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),N.push(e)},pluginEvent:function(e,n,o){var t=this;this.eventCanceled=!1,o.cancel=function(){t.eventCanceled=!0};var i=e+"Global";N.forEach(function(t){n[t.pluginName]&&(n[t.pluginName][i]&&n[t.pluginName][i](I({sortable:n},o)),n.options[t.pluginName]&&n[t.pluginName][e]&&n[t.pluginName][e](I({sortable:n},o)))})},initializePlugins:function(n,o,i,t){for(var e in N.forEach(function(t){var e=t.pluginName;(n.options[e]||t.initializeByDefault)&&((t=new t(n,o,n.options)).sortable=n,t.options=n.options,n[e]=t,a(i,t.defaults))}),n.options){var r;n.options.hasOwnProperty(e)&&(void 0!==(r=this.modifyOption(n,e,n.options[e]))&&(n.options[e]=r))}},getEventProperties:function(e,n){var o={};return N.forEach(function(t){"function"==typeof t.eventProperties&&a(o,t.eventProperties.call(n[t.pluginName],e))}),o},modifyOption:function(e,n,o){var i;return N.forEach(function(t){e[t.pluginName]&&t.optionListeners&&"function"==typeof t.optionListeners[n]&&(i=t.optionListeners[n].call(e[t.pluginName],o))}),i}};function G(t){var e=t.sortable,n=t.rootEl,o=t.name,i=t.targetEl,r=t.cloneEl,a=t.toEl,l=t.fromEl,s=t.oldIndex,c=t.newIndex,u=t.oldDraggableIndex,d=t.newDraggableIndex,h=t.originalEvent,p=t.putSortable,f=t.extraEventProperties;if(e=e||n&&n[K]){var g,m=e.options,t="on"+o.charAt(0).toUpperCase()+o.substr(1);!window.CustomEvent||y||w?(g=document.createEvent("Event")).initEvent(o,!0,!0):g=new CustomEvent(o,{bubbles:!0,cancelable:!0}),g.to=a||n,g.from=l||n,g.item=i||n,g.clone=r,g.oldIndex=s,g.newIndex=c,g.oldDraggableIndex=u,g.newDraggableIndex=d,g.originalEvent=h,g.pullMode=p?p.lastPutMode:void 0;var v,b=I(I({},f),z.getEventProperties(o,e));for(v in b)g[v]=b[v];n&&n.dispatchEvent(g),m[t]&&m[t].call(e,g)}}function U(t,e){var n=(o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{}).evt,o=i(o,q);z.pluginEvent.bind(jt)(t,e,I({dragEl:Z,parentEl:$,ghostEl:Q,rootEl:J,nextEl:tt,lastDownEl:et,cloneEl:nt,cloneHidden:ot,dragStarted:mt,putSortable:ct,activeSortable:jt.active,originalEvent:n,oldIndex:it,oldDraggableIndex:at,newIndex:rt,newDraggableIndex:lt,hideGhostForTarget:Xt,unhideGhostForTarget:Yt,cloneNowHidden:function(){ot=!0},cloneNowShown:function(){ot=!1},dispatchSortableEvent:function(t){V({sortable:e,name:t,originalEvent:n})}},o))}var q=["evt"];function V(t){G(I({putSortable:ct,cloneEl:nt,targetEl:Z,rootEl:J,oldIndex:it,oldDraggableIndex:at,newIndex:rt,newDraggableIndex:lt},t))}var Z,$,Q,J,tt,et,nt,ot,it,rt,at,lt,st,ct,ut,dt,ht,pt,ft,gt,mt,vt,bt,yt,wt,Dt=!1,Et=!1,St=[],_t=!1,Ct=!1,Tt=[],xt=!1,Ot=[],Mt="undefined"!=typeof document,At=c,Nt=w||y?"cssFloat":"float",It=Mt&&!n&&!c&&"draggable"in document.createElement("div"),Pt=function(){if(Mt){if(y)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),kt=function(t,e){var n=R(t),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=B(t,0,e),r=B(t,1,e),a=i&&R(i),l=r&&R(r),s=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+X(i).width,t=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+X(r).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&a.float&&"none"!==a.float){e="left"===a.float?"left":"right";return!r||"both"!==l.clear&&l.clear!==e?"horizontal":"vertical"}return i&&("block"===a.display||"flex"===a.display||"table"===a.display||"grid"===a.display||o<=s&&"none"===n[Nt]||r&&"none"===n[Nt]&&o<s+t)?"vertical":"horizontal"},Rt=function(t){function l(r,a){return function(t,e,n,o){var i=t.options.group.name&&e.options.group.name&&t.options.group.name===e.options.group.name;if(null==r&&(a||i))return!0;if(null==r||!1===r)return!1;if(a&&"clone"===r)return r;if("function"==typeof r)return l(r(t,e,n,o),a)(t,e,n,o);e=(a?t:e).options.group.name;return!0===r||"string"==typeof r&&r===e||r.join&&-1<r.indexOf(e)}}var e={},n=t.group;n&&"object"==o(n)||(n={name:n}),e.name=n.name,e.checkPull=l(n.pull,!0),e.checkPut=l(n.put),e.revertClone=n.revertClone,t.group=e},Xt=function(){!Pt&&Q&&R(Q,"display","none")},Yt=function(){!Pt&&Q&&R(Q,"display","")};Mt&&!n&&document.addEventListener("click",function(t){if(Et)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),Et=!1},!0);function Bt(t){if(Z){t=t.touches?t.touches[0]:t;var e=(i=t.clientX,r=t.clientY,St.some(function(t){var e=t[K].options.emptyInsertThreshold;if(e&&!F(t)){var n=X(t),o=i>=n.left-e&&i<=n.right+e,e=r>=n.top-e&&r<=n.bottom+e;return o&&e?a=t:void 0}}),a);if(e){var n,o={};for(n in t)t.hasOwnProperty(n)&&(o[n]=t[n]);o.target=o.rootEl=e,o.preventDefault=void 0,o.stopPropagation=void 0,e[K]._onDragOver(o)}}var i,r,a}function Ft(t){Z&&Z.parentNode[K]._isOutsideThisEl(t.target)}function jt(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=a({},e),t[K]=this;var n,o,i={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return kt(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==jt.supportPointer&&"PointerEvent"in window&&(!u||c),emptyInsertThreshold:5};for(n in z.initializePlugins(this,t,i),i)n in e||(e[n]=i[n]);for(o in Rt(e),this)"_"===o.charAt(0)&&"function"==typeof this[o]&&(this[o]=this[o].bind(this));this.nativeDraggable=!e.forceFallback&&It,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?h(t,"pointerdown",this._onTapStart):(h(t,"mousedown",this._onTapStart),h(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(h(t,"dragover",this),h(t,"dragenter",this)),St.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),a(this,A())}function Ht(t,e,n,o,i,r,a,l){var s,c,u=t[K],d=u.options.onMove;return!window.CustomEvent||y||w?(s=document.createEvent("Event")).initEvent("move",!0,!0):s=new CustomEvent("move",{bubbles:!0,cancelable:!0}),s.to=e,s.from=t,s.dragged=n,s.draggedRect=o,s.related=i||e,s.relatedRect=r||X(e),s.willInsertAfter=l,s.originalEvent=a,t.dispatchEvent(s),c=d?d.call(u,s,a):c}function Lt(t){t.draggable=!1}function Kt(){xt=!1}function Wt(t){return setTimeout(t,0)}function zt(t){return clearTimeout(t)}jt.prototype={constructor:jt,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(vt=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,Z):this.options.direction},_onTapStart:function(e){if(e.cancelable){var n=this,o=this.el,t=this.options,i=t.preventOnFilter,r=e.type,a=e.touches&&e.touches[0]||e.pointerType&&"touch"===e.pointerType&&e,l=(a||e).target,s=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||l,c=t.filter;if(!function(t){Ot.length=0;var e=t.getElementsByTagName("input"),n=e.length;for(;n--;){var o=e[n];o.checked&&Ot.push(o)}}(o),!Z&&!(/mousedown|pointerdown/.test(r)&&0!==e.button||t.disabled)&&!s.isContentEditable&&(this.nativeDraggable||!u||!l||"SELECT"!==l.tagName.toUpperCase())&&!((l=P(l,t.draggable,o,!1))&&l.animated||et===l)){if(it=j(l),at=j(l,t.draggable),"function"==typeof c){if(c.call(this,e,l,this))return V({sortable:n,rootEl:s,name:"filter",targetEl:l,toEl:o,fromEl:o}),U("filter",n,{evt:e}),void(i&&e.preventDefault())}else if(c=c&&c.split(",").some(function(t){if(t=P(s,t.trim(),o,!1))return V({sortable:n,rootEl:t,name:"filter",targetEl:l,fromEl:o,toEl:o}),U("filter",n,{evt:e}),!0}))return void(i&&e.preventDefault());t.handle&&!P(s,t.handle,o,!1)||this._prepareDragStart(e,a,l)}}},_prepareDragStart:function(t,e,n){var o,i=this,r=i.el,a=i.options,l=r.ownerDocument;n&&!Z&&n.parentNode===r&&(o=X(n),J=r,$=(Z=n).parentNode,tt=Z.nextSibling,et=n,st=a.group,ut={target:jt.dragged=Z,clientX:(e||t).clientX,clientY:(e||t).clientY},ft=ut.clientX-o.left,gt=ut.clientY-o.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,Z.style["will-change"]="all",o=function(){U("delayEnded",i,{evt:t}),jt.eventCanceled?i._onDrop():(i._disableDelayedDragEvents(),!s&&i.nativeDraggable&&(Z.draggable=!0),i._triggerDragStart(t,e),V({sortable:i,name:"choose",originalEvent:t}),k(Z,a.chosenClass,!0))},a.ignore.split(",").forEach(function(t){D(Z,t.trim(),Lt)}),h(l,"dragover",Bt),h(l,"mousemove",Bt),h(l,"touchmove",Bt),a.supportPointer?(h(l,"pointerup",i._onDrop),this.nativeDraggable||h(l,"pointercancel",i._onDrop)):(h(l,"mouseup",i._onDrop),h(l,"touchend",i._onDrop),h(l,"touchcancel",i._onDrop)),s&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Z.draggable=!0),U("delayStart",this,{evt:t}),!a.delay||a.delayOnTouchOnly&&!e||this.nativeDraggable&&(w||y)?o():jt.eventCanceled?this._onDrop():(a.supportPointer?(h(l,"pointerup",i._disableDelayedDrag),h(l,"pointercancel",i._disableDelayedDrag)):(h(l,"mouseup",i._disableDelayedDrag),h(l,"touchend",i._disableDelayedDrag),h(l,"touchcancel",i._disableDelayedDrag)),h(l,"mousemove",i._delayedDragTouchMoveHandler),h(l,"touchmove",i._delayedDragTouchMoveHandler),a.supportPointer&&h(l,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(o,a.delay)))},_delayedDragTouchMoveHandler:function(t){t=t.touches?t.touches[0]:t;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){Z&&Lt(Z),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;p(t,"mouseup",this._disableDelayedDrag),p(t,"touchend",this._disableDelayedDrag),p(t,"touchcancel",this._disableDelayedDrag),p(t,"pointerup",this._disableDelayedDrag),p(t,"pointercancel",this._disableDelayedDrag),p(t,"mousemove",this._delayedDragTouchMoveHandler),p(t,"touchmove",this._delayedDragTouchMoveHandler),p(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?h(document,"pointermove",this._onTouchMove):h(document,e?"touchmove":"mousemove",this._onTouchMove):(h(Z,"dragend",this),h(J,"dragstart",this._onDragStart));try{document.selection?Wt(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(t,e){var n;Dt=!1,J&&Z?(U("dragStarted",this,{evt:e}),this.nativeDraggable&&h(document,"dragover",Ft),n=this.options,t||k(Z,n.dragClass,!1),k(Z,n.ghostClass,!0),jt.active=this,t&&this._appendGhost(),V({sortable:this,name:"start",originalEvent:e})):this._nulling()},_emulateDragOver:function(){if(dt){this._lastX=dt.clientX,this._lastY=dt.clientY,Xt();for(var t=document.elementFromPoint(dt.clientX,dt.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(dt.clientX,dt.clientY))!==e;)e=t;if(Z.parentNode[K]._isOutsideThisEl(t),e)do{if(e[K])if(e[K]._onDragOver({clientX:dt.clientX,clientY:dt.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}while(e=g(t=e));Yt()}},_onTouchMove:function(t){if(ut){var e=this.options,n=e.fallbackTolerance,o=e.fallbackOffset,i=t.touches?t.touches[0]:t,r=Q&&b(Q,!0),a=Q&&r&&r.a,l=Q&&r&&r.d,e=At&&wt&&E(wt),a=(i.clientX-ut.clientX+o.x)/(a||1)+(e?e[0]-Tt[0]:0)/(a||1),l=(i.clientY-ut.clientY+o.y)/(l||1)+(e?e[1]-Tt[1]:0)/(l||1);if(!jt.active&&!Dt){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<n)return;this._onDragStart(t,!0)}Q&&(r?(r.e+=a-(ht||0),r.f+=l-(pt||0)):r={a:1,b:0,c:0,d:1,e:a,f:l},r="matrix(".concat(r.a,",").concat(r.b,",").concat(r.c,",").concat(r.d,",").concat(r.e,",").concat(r.f,")"),R(Q,"webkitTransform",r),R(Q,"mozTransform",r),R(Q,"msTransform",r),R(Q,"transform",r),ht=a,pt=l,dt=i),t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!Q){var t=this.options.fallbackOnBody?document.body:J,e=X(Z,!0,At,!0,t),n=this.options;if(At){for(wt=t;"static"===R(wt,"position")&&"none"===R(wt,"transform")&&wt!==document;)wt=wt.parentNode;wt!==document.body&&wt!==document.documentElement?(wt===document&&(wt=O()),e.top+=wt.scrollTop,e.left+=wt.scrollLeft):wt=O(),Tt=E(wt)}k(Q=Z.cloneNode(!0),n.ghostClass,!1),k(Q,n.fallbackClass,!0),k(Q,n.dragClass,!0),R(Q,"transition",""),R(Q,"transform",""),R(Q,"box-sizing","border-box"),R(Q,"margin",0),R(Q,"top",e.top),R(Q,"left",e.left),R(Q,"width",e.width),R(Q,"height",e.height),R(Q,"opacity","0.8"),R(Q,"position",At?"absolute":"fixed"),R(Q,"zIndex","100000"),R(Q,"pointerEvents","none"),jt.ghost=Q,t.appendChild(Q),R(Q,"transform-origin",ft/parseInt(Q.style.width)*100+"% "+gt/parseInt(Q.style.height)*100+"%")}},_onDragStart:function(t,e){var n=this,o=t.dataTransfer,i=n.options;U("dragStart",this,{evt:t}),jt.eventCanceled?this._onDrop():(U("setupClone",this),jt.eventCanceled||((nt=C(Z)).removeAttribute("id"),nt.draggable=!1,nt.style["will-change"]="",this._hideClone(),k(nt,this.options.chosenClass,!1),jt.clone=nt),n.cloneId=Wt(function(){U("clone",n),jt.eventCanceled||(n.options.removeCloneOnHide||J.insertBefore(nt,Z),n._hideClone(),V({sortable:n,name:"clone"}))}),e||k(Z,i.dragClass,!0),e?(Et=!0,n._loopId=setInterval(n._emulateDragOver,50)):(p(document,"mouseup",n._onDrop),p(document,"touchend",n._onDrop),p(document,"touchcancel",n._onDrop),o&&(o.effectAllowed="move",i.setData&&i.setData.call(n,o,Z)),h(document,"drop",n),R(Z,"transform","translateZ(0)")),Dt=!0,n._dragStartId=Wt(n._dragStarted.bind(n,e,t)),h(document,"selectstart",n),mt=!0,window.getSelection().removeAllRanges(),u&&R(document.body,"user-select","none"))},_onDragOver:function(n){var o,i,r,t,e,a=this.el,l=n.target,s=this.options,c=s.group,u=jt.active,d=st===c,h=s.sort,p=ct||u,f=this,g=!1;if(!xt){if(void 0!==n.preventDefault&&n.cancelable&&n.preventDefault(),l=P(l,s.draggable,a,!0),O("dragOver"),jt.eventCanceled)return g;if(Z.contains(n.target)||l.animated&&l.animatingX&&l.animatingY||f._ignoreWhileAnimating===l)return A(!1);if(Et=!1,u&&!s.disabled&&(d?h||(i=$!==J):ct===this||(this.lastPutMode=st.checkPull(this,u,Z,n))&&c.checkPut(this,u,Z,n))){if(r="vertical"===this._getDirection(n,l),o=X(Z),O("dragOverValid"),jt.eventCanceled)return g;if(i)return $=J,M(),this._hideClone(),O("revert"),jt.eventCanceled||(tt?J.insertBefore(Z,tt):J.appendChild(Z)),A(!0);var m=F(a,s.draggable);if(m&&(S=n,c=r,x=X(F((E=this).el,E.options.draggable)),E=L(E.el,E.options,Q),!(c?S.clientX>E.right+10||S.clientY>x.bottom&&S.clientX>x.left:S.clientY>E.bottom+10||S.clientX>x.right&&S.clientY>x.top)||m.animated)){if(m&&(t=n,e=r,C=X(B((_=this).el,0,_.options,!0)),_=L(_.el,_.options,Q),e?t.clientX<_.left-10||t.clientY<C.top&&t.clientX<C.right:t.clientY<_.top-10||t.clientY<C.bottom&&t.clientX<C.left)){var v=B(a,0,s,!0);if(v===Z)return A(!1);if(D=X(l=v),!1!==Ht(J,a,Z,o,l,D,n,!1))return M(),a.insertBefore(Z,v),$=a,N(),A(!0)}else if(l.parentNode===a){var b,y,w,D=X(l),E=Z.parentNode!==a,S=(S=Z.animated&&Z.toRect||o,x=l.animated&&l.toRect||D,_=(e=r)?S.left:S.top,t=e?S.right:S.bottom,C=e?S.width:S.height,v=e?x.left:x.top,S=e?x.right:x.bottom,x=e?x.width:x.height,!(_===v||t===S||_+C/2===v+x/2)),_=r?"top":"left",C=Y(l,"top","top")||Y(Z,"top","top"),v=C?C.scrollTop:void 0;if(vt!==l&&(y=D[_],_t=!1,Ct=!S&&s.invertSwap||E),0!==(b=function(t,e,n,o,i,r,a,l){var s=o?t.clientY:t.clientX,c=o?n.height:n.width,t=o?n.top:n.left,o=o?n.bottom:n.right,n=!1;if(!a)if(l&&yt<c*i){if(_t=!_t&&(1===bt?t+c*r/2<s:s<o-c*r/2)?!0:_t)n=!0;else if(1===bt?s<t+yt:o-yt<s)return-bt}else if(t+c*(1-i)/2<s&&s<o-c*(1-i)/2)return function(t){return j(Z)<j(t)?1:-1}(e);if((n=n||a)&&(s<t+c*r/2||o-c*r/2<s))return t+c/2<s?1:-1;return 0}(n,l,D,r,S?1:s.swapThreshold,null==s.invertedSwapThreshold?s.swapThreshold:s.invertedSwapThreshold,Ct,vt===l)))for(var T=j(Z);(w=$.children[T-=b])&&("none"===R(w,"display")||w===Q););if(0===b||w===l)return A(!1);bt=b;var x=(vt=l).nextElementSibling,E=!1,S=Ht(J,a,Z,o,l,D,n,E=1===b);if(!1!==S)return 1!==S&&-1!==S||(E=1===S),xt=!0,setTimeout(Kt,30),M(),E&&!x?a.appendChild(Z):l.parentNode.insertBefore(Z,E?x:l),C&&H(C,0,v-C.scrollTop),$=Z.parentNode,void 0===y||Ct||(yt=Math.abs(y-X(l)[_])),N(),A(!0)}}else{if(m===Z)return A(!1);if((l=m&&a===n.target?m:l)&&(D=X(l)),!1!==Ht(J,a,Z,o,l,D,n,!!l))return M(),m&&m.nextSibling?a.insertBefore(Z,m.nextSibling):a.appendChild(Z),$=a,N(),A(!0)}if(a.contains(Z))return A(!1)}return!1}function O(t,e){U(t,f,I({evt:n,isOwner:d,axis:r?"vertical":"horizontal",revert:i,dragRect:o,targetRect:D,canSort:h,fromSortable:p,target:l,completed:A,onMove:function(t,e){return Ht(J,a,Z,o,t,X(t),n,e)},changed:N},e))}function M(){O("dragOverAnimationCapture"),f.captureAnimationState(),f!==p&&p.captureAnimationState()}function A(t){return O("dragOverCompleted",{insertion:t}),t&&(d?u._hideClone():u._showClone(f),f!==p&&(k(Z,(ct||u).options.ghostClass,!1),k(Z,s.ghostClass,!0)),ct!==f&&f!==jt.active?ct=f:f===jt.active&&ct&&(ct=null),p===f&&(f._ignoreWhileAnimating=l),f.animateAll(function(){O("dragOverAnimationComplete"),f._ignoreWhileAnimating=null}),f!==p&&(p.animateAll(),p._ignoreWhileAnimating=null)),(l===Z&&!Z.animated||l===a&&!l.animated)&&(vt=null),s.dragoverBubble||n.rootEl||l===document||(Z.parentNode[K]._isOutsideThisEl(n.target),t||Bt(n)),!s.dragoverBubble&&n.stopPropagation&&n.stopPropagation(),g=!0}function N(){rt=j(Z),lt=j(Z,s.draggable),V({sortable:f,name:"change",toEl:a,newIndex:rt,newDraggableIndex:lt,originalEvent:n})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){p(document,"mousemove",this._onTouchMove),p(document,"touchmove",this._onTouchMove),p(document,"pointermove",this._onTouchMove),p(document,"dragover",Bt),p(document,"mousemove",Bt),p(document,"touchmove",Bt)},_offUpEvents:function(){var t=this.el.ownerDocument;p(t,"mouseup",this._onDrop),p(t,"touchend",this._onDrop),p(t,"pointerup",this._onDrop),p(t,"pointercancel",this._onDrop),p(t,"touchcancel",this._onDrop),p(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;rt=j(Z),lt=j(Z,n.draggable),U("drop",this,{evt:t}),$=Z&&Z.parentNode,rt=j(Z),lt=j(Z,n.draggable),jt.eventCanceled||(_t=Ct=Dt=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),zt(this.cloneId),zt(this._dragStartId),this.nativeDraggable&&(p(document,"drop",this),p(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),u&&R(document.body,"user-select",""),R(Z,"transform",""),t&&(mt&&(t.cancelable&&t.preventDefault(),n.dropBubble||t.stopPropagation()),Q&&Q.parentNode&&Q.parentNode.removeChild(Q),(J===$||ct&&"clone"!==ct.lastPutMode)&&nt&&nt.parentNode&&nt.parentNode.removeChild(nt),Z&&(this.nativeDraggable&&p(Z,"dragend",this),Lt(Z),Z.style["will-change"]="",mt&&!Dt&&k(Z,(ct||this).options.ghostClass,!1),k(Z,this.options.chosenClass,!1),V({sortable:this,name:"unchoose",toEl:$,newIndex:null,newDraggableIndex:null,originalEvent:t}),J!==$?(0<=rt&&(V({rootEl:$,name:"add",toEl:$,fromEl:J,originalEvent:t}),V({sortable:this,name:"remove",toEl:$,originalEvent:t}),V({rootEl:$,name:"sort",toEl:$,fromEl:J,originalEvent:t}),V({sortable:this,name:"sort",toEl:$,originalEvent:t})),ct&&ct.save()):rt!==it&&0<=rt&&(V({sortable:this,name:"update",toEl:$,originalEvent:t}),V({sortable:this,name:"sort",toEl:$,originalEvent:t})),jt.active&&(null!=rt&&-1!==rt||(rt=it,lt=at),V({sortable:this,name:"end",toEl:$,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){U("nulling",this),J=Z=$=Q=tt=nt=et=ot=ut=dt=mt=rt=lt=it=at=vt=bt=ct=st=jt.dragged=jt.ghost=jt.clone=jt.active=null,Ot.forEach(function(t){t.checked=!0}),Ot.length=ht=pt=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":Z&&(this._onDragOver(t),function(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move");t.cancelable&&t.preventDefault()}(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,e=[],n=this.el.children,o=0,i=n.length,r=this.options;o<i;o++)P(t=n[o],r.draggable,this.el,!1)&&e.push(t.getAttribute(r.dataIdAttr)||function(t){var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,o=0;for(;n--;)o+=e.charCodeAt(n);return o.toString(36)}(t));return e},sort:function(t,e){var n={},o=this.el;this.toArray().forEach(function(t,e){e=o.children[e];P(e,this.options.draggable,o,!1)&&(n[t]=e)},this),e&&this.captureAnimationState(),t.forEach(function(t){n[t]&&(o.removeChild(n[t]),o.appendChild(n[t]))}),e&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,e){return P(t,e||this.options.draggable,this.el,!1)},option:function(t,e){var n=this.options;if(void 0===e)return n[t];var o=z.modifyOption(this,t,e);n[t]=void 0!==o?o:e,"group"===t&&Rt(n)},destroy:function(){U("destroy",this);var t=this.el;t[K]=null,p(t,"mousedown",this._onTapStart),p(t,"touchstart",this._onTapStart),p(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(p(t,"dragover",this),p(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(t){t.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),St.splice(St.indexOf(this.el),1),this.el=t=null},_hideClone:function(){ot||(U("hideClone",this),jt.eventCanceled||(R(nt,"display","none"),this.options.removeCloneOnHide&&nt.parentNode&&nt.parentNode.removeChild(nt),ot=!0))},_showClone:function(t){"clone"===t.lastPutMode?ot&&(U("showClone",this),jt.eventCanceled||(Z.parentNode!=J||this.options.group.revertClone?tt?J.insertBefore(nt,tt):J.appendChild(nt):J.insertBefore(nt,Z),this.options.group.revertClone&&this.animate(Z,nt),R(nt,"display",""),ot=!1)):this._hideClone()}},Mt&&h(document,"touchmove",function(t){(jt.active||Dt)&&t.cancelable&&t.preventDefault()}),jt.utils={on:h,off:p,css:R,find:D,is:function(t,e){return!!P(t,e,t,!1)},extend:function(t,e){if(t&&e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t},throttle:_,closest:P,toggleClass:k,clone:C,index:j,nextTick:Wt,cancelNextTick:zt,detectDirection:kt,getChild:B,expando:K},jt.get=function(t){return t[K]},jt.mount=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];(e=e[0].constructor===Array?e[0]:e).forEach(function(t){if(!t.prototype||!t.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(t));t.utils&&(jt.utils=I(I({},jt.utils),t.utils)),z.mount(t)})},jt.create=function(t,e){return new jt(t,e)};var Gt,Ut,qt,Vt,Zt,$t,Qt=[],Jt=!(jt.version="1.15.6");function te(){Qt.forEach(function(t){clearInterval(t.pid)}),Qt=[]}function ee(){clearInterval($t)}var ne,oe=_(function(n,t,e,o){if(t.scroll){var i,r=(n.touches?n.touches[0]:n).clientX,a=(n.touches?n.touches[0]:n).clientY,l=t.scrollSensitivity,s=t.scrollSpeed,c=O(),u=!1;Ut!==e&&(Ut=e,te(),Gt=t.scroll,i=t.scrollFn,!0===Gt&&(Gt=M(e,!0)));var d=0,h=Gt;do{var p=h,f=X(p),g=f.top,m=f.bottom,v=f.left,b=f.right,y=f.width,w=f.height,D=void 0,E=void 0,S=p.scrollWidth,_=p.scrollHeight,C=R(p),T=p.scrollLeft,f=p.scrollTop,E=p===c?(D=y<S&&("auto"===C.overflowX||"scroll"===C.overflowX||"visible"===C.overflowX),w<_&&("auto"===C.overflowY||"scroll"===C.overflowY||"visible"===C.overflowY)):(D=y<S&&("auto"===C.overflowX||"scroll"===C.overflowX),w<_&&("auto"===C.overflowY||"scroll"===C.overflowY)),T=D&&(Math.abs(b-r)<=l&&T+y<S)-(Math.abs(v-r)<=l&&!!T),f=E&&(Math.abs(m-a)<=l&&f+w<_)-(Math.abs(g-a)<=l&&!!f);if(!Qt[d])for(var x=0;x<=d;x++)Qt[x]||(Qt[x]={});Qt[d].vx==T&&Qt[d].vy==f&&Qt[d].el===p||(Qt[d].el=p,Qt[d].vx=T,Qt[d].vy=f,clearInterval(Qt[d].pid),0==T&&0==f||(u=!0,Qt[d].pid=setInterval(function(){o&&0===this.layer&&jt.active._onTouchMove(Zt);var t=Qt[this.layer].vy?Qt[this.layer].vy*s:0,e=Qt[this.layer].vx?Qt[this.layer].vx*s:0;"function"==typeof i&&"continue"!==i.call(jt.dragged.parentNode[K],e,t,n,Zt,Qt[this.layer].el)||H(Qt[this.layer].el,e,t)}.bind({layer:d}),24))),d++}while(t.bubbleScroll&&h!==c&&(h=M(h,!1)));Jt=u}},30),n=function(t){var e=t.originalEvent,n=t.putSortable,o=t.dragEl,i=t.activeSortable,r=t.dispatchSortableEvent,a=t.hideGhostForTarget,t=t.unhideGhostForTarget;e&&(i=n||i,a(),e=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e,e=document.elementFromPoint(e.clientX,e.clientY),t(),i&&!i.el.contains(e)&&(r("spill"),this.onSpill({dragEl:o,putSortable:n})))};function ie(){}function re(){}ie.prototype={startIndex:null,dragStart:function(t){t=t.oldDraggableIndex;this.startIndex=t},onSpill:function(t){var e=t.dragEl,n=t.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();t=B(this.sortable.el,this.startIndex,this.options);t?this.sortable.el.insertBefore(e,t):this.sortable.el.appendChild(e),this.sortable.animateAll(),n&&n.animateAll()},drop:n},a(ie,{pluginName:"revertOnSpill"}),re.prototype={onSpill:function(t){var e=t.dragEl,t=t.putSortable||this.sortable;t.captureAnimationState(),e.parentNode&&e.parentNode.removeChild(e),t.animateAll()},drop:n},a(re,{pluginName:"removeOnSpill"});var ae,le,se,ce,ue,de=[],he=[],pe=!1,fe=!1,ge=!1;function me(n,o){he.forEach(function(t,e){e=o.children[t.sortableIndex+(n?Number(e):0)];e?o.insertBefore(t,e):o.appendChild(t)})}function ve(){de.forEach(function(t){t!==se&&t.parentNode&&t.parentNode.removeChild(t)})}return jt.mount(new function(){function t(){for(var t in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===t.charAt(0)&&"function"==typeof this[t]&&(this[t]=this[t].bind(this))}return t.prototype={dragStarted:function(t){t=t.originalEvent;this.sortable.nativeDraggable?h(document,"dragover",this._handleAutoScroll):this.options.supportPointer?h(document,"pointermove",this._handleFallbackAutoScroll):t.touches?h(document,"touchmove",this._handleFallbackAutoScroll):h(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){t=t.originalEvent;this.options.dragOverBubble||t.rootEl||this._handleAutoScroll(t)},drop:function(){this.sortable.nativeDraggable?p(document,"dragover",this._handleAutoScroll):(p(document,"pointermove",this._handleFallbackAutoScroll),p(document,"touchmove",this._handleFallbackAutoScroll),p(document,"mousemove",this._handleFallbackAutoScroll)),ee(),te(),clearTimeout(m),m=void 0},nulling:function(){Zt=Ut=Gt=Jt=$t=qt=Vt=null,Qt.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(e,n){var o,i=this,r=(e.touches?e.touches[0]:e).clientX,a=(e.touches?e.touches[0]:e).clientY,t=document.elementFromPoint(r,a);Zt=e,n||this.options.forceAutoScrollFallback||w||y||u?(oe(e,this.options,t,n),o=M(t,!0),!Jt||$t&&r===qt&&a===Vt||($t&&ee(),$t=setInterval(function(){var t=M(document.elementFromPoint(r,a),!0);t!==o&&(o=t,te()),oe(e,i.options,t,n)},10),qt=r,Vt=a)):this.options.bubbleScroll&&M(t,!0)!==O()?oe(e,this.options,M(t,!1),!1):te()}},a(t,{pluginName:"scroll",initializeByDefault:!0})}),jt.mount(re,ie),jt.mount(new function(){function t(){this.defaults={swapClass:"sortable-swap-highlight"}}return t.prototype={dragStart:function(t){t=t.dragEl;ne=t},dragOverValid:function(t){var e=t.completed,n=t.target,o=t.onMove,i=t.activeSortable,r=t.changed,a=t.cancel;i.options.swap&&(t=this.sortable.el,i=this.options,n&&n!==t&&(t=ne,ne=!1!==o(n)?(k(n,i.swapClass,!0),n):null,t&&t!==ne&&k(t,i.swapClass,!1)),r(),e(!0),a())},drop:function(t){var e,n,o=t.activeSortable,i=t.putSortable,r=t.dragEl,a=i||this.sortable,l=this.options;ne&&k(ne,l.swapClass,!1),ne&&(l.swap||i&&i.options.swap)&&r!==ne&&(a.captureAnimationState(),a!==o&&o.captureAnimationState(),n=ne,t=(e=r).parentNode,l=n.parentNode,t&&l&&!t.isEqualNode(n)&&!l.isEqualNode(e)&&(i=j(e),r=j(n),t.isEqualNode(l)&&i<r&&r++,t.insertBefore(n,t.children[i]),l.insertBefore(e,l.children[r])),a.animateAll(),a!==o&&o.animateAll())},nulling:function(){ne=null}},a(t,{pluginName:"swap",eventProperties:function(){return{swapItem:ne}}})}),jt.mount(new function(){function t(o){for(var t in this)"_"===t.charAt(0)&&"function"==typeof this[t]&&(this[t]=this[t].bind(this));o.options.avoidImplicitDeselect||(o.options.supportPointer?h(document,"pointerup",this._deselectMultiDrag):(h(document,"mouseup",this._deselectMultiDrag),h(document,"touchend",this._deselectMultiDrag))),h(document,"keydown",this._checkKeyDown),h(document,"keyup",this._checkKeyUp),this.defaults={selectedClass:"sortable-selected",multiDragKey:null,avoidImplicitDeselect:!1,setData:function(t,e){var n="";de.length&&le===o?de.forEach(function(t,e){n+=(e?", ":"")+t.textContent}):n=e.textContent,t.setData("Text",n)}}}return t.prototype={multiDragKeyDown:!1,isMultiDrag:!1,delayStartGlobal:function(t){t=t.dragEl;se=t},delayEnded:function(){this.isMultiDrag=~de.indexOf(se)},setupClone:function(t){var e=t.sortable,t=t.cancel;if(this.isMultiDrag){for(var n=0;n<de.length;n++)he.push(C(de[n])),he[n].sortableIndex=de[n].sortableIndex,he[n].draggable=!1,he[n].style["will-change"]="",k(he[n],this.options.selectedClass,!1),de[n]===se&&k(he[n],this.options.chosenClass,!1);e._hideClone(),t()}},clone:function(t){var e=t.sortable,n=t.rootEl,o=t.dispatchSortableEvent,t=t.cancel;this.isMultiDrag&&(this.options.removeCloneOnHide||de.length&&le===e&&(me(!0,n),o("clone"),t()))},showClone:function(t){var e=t.cloneNowShown,n=t.rootEl,t=t.cancel;this.isMultiDrag&&(me(!1,n),he.forEach(function(t){R(t,"display","")}),e(),ue=!1,t())},hideClone:function(t){var e=this,n=(t.sortable,t.cloneNowHidden),t=t.cancel;this.isMultiDrag&&(he.forEach(function(t){R(t,"display","none"),e.options.removeCloneOnHide&&t.parentNode&&t.parentNode.removeChild(t)}),n(),ue=!0,t())},dragStartGlobal:function(t){t.sortable;!this.isMultiDrag&&le&&le.multiDrag._deselectMultiDrag(),de.forEach(function(t){t.sortableIndex=j(t)}),de=de.sort(function(t,e){return t.sortableIndex-e.sortableIndex}),ge=!0},dragStarted:function(t){var e,n=this,t=t.sortable;this.isMultiDrag&&(this.options.sort&&(t.captureAnimationState(),this.options.animation&&(de.forEach(function(t){t!==se&&R(t,"position","absolute")}),e=X(se,!1,!0,!0),de.forEach(function(t){t!==se&&T(t,e)}),pe=fe=!0)),t.animateAll(function(){pe=fe=!1,n.options.animation&&de.forEach(function(t){x(t)}),n.options.sort&&ve()}))},dragOver:function(t){var e=t.target,n=t.completed,t=t.cancel;fe&&~de.indexOf(e)&&(n(!1),t())},revert:function(t){var n,o,e=t.fromSortable,i=t.rootEl,r=t.sortable,a=t.dragRect;1<de.length&&(de.forEach(function(t){r.addAnimationState({target:t,rect:fe?X(t):a}),x(t),t.fromRect=a,e.removeAnimationState(t)}),fe=!1,n=!this.options.removeCloneOnHide,o=i,de.forEach(function(t,e){e=o.children[t.sortableIndex+(n?Number(e):0)];e?o.insertBefore(t,e):o.appendChild(t)}))},dragOverCompleted:function(t){var e,n=t.sortable,o=t.isOwner,i=t.insertion,r=t.activeSortable,a=t.parentEl,l=t.putSortable,t=this.options;i&&(o&&r._hideClone(),pe=!1,t.animation&&1<de.length&&(fe||!o&&!r.options.sort&&!l)&&(e=X(se,!1,!0,!0),de.forEach(function(t){t!==se&&(T(t,e),a.appendChild(t))}),fe=!0),o||(fe||ve(),1<de.length?(o=ue,r._showClone(n),r.options.animation&&!ue&&o&&he.forEach(function(t){r.addAnimationState({target:t,rect:ce}),t.fromRect=ce,t.thisAnimationDuration=null})):r._showClone(n)))},dragOverAnimationCapture:function(t){var e=t.dragRect,n=t.isOwner,t=t.activeSortable;de.forEach(function(t){t.thisAnimationDuration=null}),t.options.animation&&!n&&t.multiDrag.isMultiDrag&&(ce=a({},e),e=b(se,!0),ce.top-=e.f,ce.left-=e.e)},dragOverAnimationComplete:function(){fe&&(fe=!1,ve())},drop:function(t){var o,i,r,a,n,e,l,s=t.originalEvent,c=t.rootEl,u=t.parentEl,d=t.sortable,h=t.dispatchSortableEvent,p=t.oldIndex,t=t.putSortable,f=t||this.sortable;s&&(o=this.options,i=u.children,ge||(o.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),k(se,o.selectedClass,!~de.indexOf(se)),~de.indexOf(se)?(de.splice(de.indexOf(se),1),ae=null,G({sortable:d,rootEl:c,name:"deselect",targetEl:se,originalEvent:s})):(de.push(se),G({sortable:d,rootEl:c,name:"select",targetEl:se,originalEvent:s}),s.shiftKey&&ae&&d.el.contains(ae)?(r=j(ae),a=j(se),~r&&~a&&r!==a&&function(){for(var e,t=r<a?(e=r,a):(e=a,r+1),n=o.filter;e<t;e++)~de.indexOf(i[e])||P(i[e],o.draggable,u,!1)&&(n&&("function"==typeof n?n.call(d,s,i[e],d):n.split(",").some(function(t){return P(i[e],t.trim(),u,!1)}))||(k(i[e],o.selectedClass,!0),de.push(i[e]),G({sortable:d,rootEl:c,name:"select",targetEl:i[e],originalEvent:s})))}()):ae=se,le=f)),ge&&this.isMultiDrag&&(fe=!1,(u[K].options.sort||u!==c)&&1<de.length&&(n=X(se),e=j(se,":not(."+this.options.selectedClass+")"),!pe&&o.animation&&(se.thisAnimationDuration=null),f.captureAnimationState(),pe||(o.animation&&(se.fromRect=n,de.forEach(function(t){var e;t.thisAnimationDuration=null,t!==se&&(e=fe?X(t):n,t.fromRect=e,f.addAnimationState({target:t,rect:e}))})),ve(),de.forEach(function(t){i[e]?u.insertBefore(t,i[e]):u.appendChild(t),e++}),p===j(se)&&(l=!1,de.forEach(function(t){t.sortableIndex!==j(t)&&(l=!0)}),l&&(h("update"),h("sort")))),de.forEach(function(t){x(t)}),f.animateAll()),le=f),(c===u||t&&"clone"!==t.lastPutMode)&&he.forEach(function(t){t.parentNode&&t.parentNode.removeChild(t)}))},nullingGlobal:function(){this.isMultiDrag=ge=!1,he.length=0},destroyGlobal:function(){this._deselectMultiDrag(),p(document,"pointerup",this._deselectMultiDrag),p(document,"mouseup",this._deselectMultiDrag),p(document,"touchend",this._deselectMultiDrag),p(document,"keydown",this._checkKeyDown),p(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(t){if(!(void 0!==ge&&ge||le!==this.sortable||t&&P(t.target,this.options.draggable,this.sortable.el,!1)||t&&0!==t.button))for(;de.length;){var e=de[0];k(e,this.options.selectedClass,!1),de.shift(),G({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:e,originalEvent:t})}},_checkKeyDown:function(t){t.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp:function(t){t.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},a(t,{pluginName:"multiDrag",utils:{select:function(t){var e=t.parentNode[K];e&&e.options.multiDrag&&!~de.indexOf(t)&&(le&&le!==e&&(le.multiDrag._deselectMultiDrag(),le=e),k(t,e.options.selectedClass,!0),de.push(t))},deselect:function(t){var e=t.parentNode[K],n=de.indexOf(t);e&&e.options.multiDrag&&~n&&(k(t,e.options.selectedClass,!1),de.splice(n,1))}},eventProperties:function(){var n=this,o=[],i=[];return de.forEach(function(t){var e;o.push({multiDragElement:t,index:t.sortableIndex}),e=fe&&t!==se?-1:fe?j(t,":not(."+n.options.selectedClass+")"):j(t),i.push({multiDragElement:t,index:e})}),{items:r(de),clones:[].concat(he),oldIndicies:o,newIndicies:i}},optionListeners:{multiDragKey:function(t){return"ctrl"===(t=t.toLowerCase())?t="Control":1<t.length&&(t=t.charAt(0).toUpperCase()+t.substr(1)),t}}})}),jt});
|
|
9
|
+
(nt=>{var ot={getHtml:{value:!0,noInstance:function(e){return e.html()}},init:{},deinit:{},reset:{},destroy:{},remove:{},changeView:{},getView:{value:!0},createRow:{value:!0},createColumn:{value:!0},createElement:{value:!0},createContainer:{value:!0},addTab:{value:!0},addAccordionItem:{value:!0},setLocale:{}},at=["appendTo","prependTo","insertAfter","insertBefore"],it=[{key:"xs",colPrefix:"col-",offsetPrefix:"offset-",min:0,preview:400,labelKey:"view.xs"},{key:"sm",colPrefix:"col-sm-",offsetPrefix:"offset-sm-",min:576,preview:576,labelKey:"view.sm"},{key:"md",colPrefix:"col-md-",offsetPrefix:"offset-md-",min:768,preview:768,labelKey:"view.md"},{key:"lg",colPrefix:"col-lg-",offsetPrefix:"offset-lg-",min:992,preview:992,labelKey:"view.lg"},{key:"xl",colPrefix:"col-xl-",offsetPrefix:"offset-xl-",min:1200,preview:1200,labelKey:"view.xl"},{key:"xxl",colPrefix:"col-xxl-",offsetPrefix:"offset-xxl-",min:1400,preview:null,labelKey:"view.xxl"}],rt="all",t="view.all",lt=[rt].concat(it.map(function(e){return e.key})),st=["lg","sm","xs"],ct=12;function dt(e){for(var t=0;t<it.length;t++)if(it[t].key===e)return it[t];return null}function ut(e){return e===rt?it.slice():(e=dt(e))?[e]:[]}function ft(e){e=dt(e);return e?e.labelKey:t}var gt={add_column:{size:12,picker:!0,delay:600},elements:{enabled:"auto",selector:"[data-ge-element]",auto:!1},resize:{enabled:!0,handles:"e",balance:"next"},drag:{delay:0,touch_delay:100,threshold:3,animation:150,scroll:!0}},mt={sortable_options:"drag",resizable_options:"resize"},n={},pt=0;function ht(e,t,n){var o=nt.fn.gridEditor.locales,a=o[e.locale]||{},e=(e.locale_strings||{})[t];return void 0===(e=void 0===(e=void 0===e?a[t]:e)?o.en[t]:e)&&(r("locale:"+t,'no string for "'+t+'" in any locale, showing the key'),e=t),e.replace(/\{(\w+)\}/g,function(e,t){return n&&void 0!==n[t]?n[t]:e})}function vt(e){window.console&&window.console.warn&&window.console.warn("grid-editor: "+e)}function r(e,t){n[e]||(n[e]=!0,vt(t))}nt.fn.gridEditor=function(tt){var e=this;if("string"!=typeof tt)return e.each(function(K,e){e=nt(e);var o,a,O,B,i,r,c=nt.extend({new_row_layouts:[[12],[6,6],[4,4,4],[3,3,3,3],[2,2,2,2,2,2],[2,8,2],[4,8],[8,4]],row_classes:[],col_classes:[],col_tools:[],row_tools:[],drag_handle:"tool",toolbar_drag:"auto",element_tools:[],element_classes:[],container_classes:[],pane_classes:[],container_tools:[],tab_tools:[],accordion_tools:[],plugins:null,elements:gt.elements,custom_filter:"",content_types:["tinymce"],valid_col_sizes:[1,2,3,4,5,6,7,8,9,10,11,12],valid_col_offsets:[0,1,2,3,4,5,6,7,8,9,10,11],add_column:gt.add_column,layout_modes:lt.slice(),default_view:rt,resize:gt.resize,source_textarea:"",locale:"en",locale_strings:{},callbacks:{},confirm_delete:!0,drag:gt.drag},tt),l=(nt.each(gt,function(e,t){c[e]=nt.extend({},t,c[e])}),nt.each(mt,function(e,t){tt&&void 0!==tt[e]&&vt(nt.fn.gridEditor.t(c,"warning.setting_removed",{setting:e,replacement:t}))}),c.default_view),s=null,d=null,u=null,L={},N=[],V=++pt;function f(e,t){L[e]||(L[e]=!0,vt(t))}function g(e,t){return ht(c,e,t)}var t,n,m=e.addClass("ge-canvas"),p=0,F=[];function h(e,t,n){return nt.extend({kind:e,node:t,parent:t.parent(),canvas:m,breakpoint:l,source:"api"},n||{})}function v(e,t){var n=[e],o=e.replace(/^(before|after)-add-.+$/,"$1-add"),a=(o!==e&&n.push(o),!1);return n.forEach(function(e){e=nt.Event("grideditor:"+e);m.trigger(e,[t]),e.isDefaultPrevented()&&(a=!0)}),n.forEach(function(e){e=c.callbacks[e.replace(/-/g,"_")];"function"==typeof e&&!1===e(t)&&(a=!0)}),!a}function b(e){p++;try{return e()}finally{if(0===--p)for(;F.length;)F.shift()()}}function X(e){0===p?e():F.push(e)}function w(t,n,o,a){e=t;var e,i=nt.fn.gridEditor.containers[e]?"container":e;return b(function(){var e=h(t,n,a);return v("before-add-"+i,e)?(o(),_(),v("after-add-"+i,e),n):null})}function W(e,t){var n,o;c.confirm_delete?window.bootstrap&&window.bootstrap.Modal?(s||((s=nt('<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>').appendTo("body")).find(".modal-title").text(g("confirm.title")),s.find(".btn-close").attr("aria-label",g("confirm.cancel")),s.find(".ge-confirm-cancel").text(g("confirm.cancel")),s.find(".ge-confirm-ok").text(g("confirm.ok"))),o=!1,(n=s).find(".ge-confirm-message").text(e),n.find(".ge-confirm-ok").off("click").on("click",function(){o=!0,window.bootstrap.Modal.getInstance(n[0]).hide()}),n.off("hidden.bs.modal").on("hidden.bs.modal",function(){o&&t()}),n.off("shown.bs.modal").on("shown.bs.modal",function(){n.find(".ge-confirm-ok").trigger("focus")}),window.bootstrap.Modal.getOrCreateInstance(n[0]).show()):window.confirm(e)&&t():t()}function Y(){var e;s&&(window.bootstrap&&window.bootstrap.Modal&&(e=window.bootstrap.Modal.getInstance(s[0]))&&e.dispose(),s.remove(),s=null)}function y(t,n,o,a){b(function(){var e=h(t,n,{source:"tool"});v("before-delete",e)&&W(o,function(){b(function(){a(function(){n.remove(),b(function(){_(),v("after-delete",e)})})})})})}function q(n,t){var e=ut(l),o=e.map(function(e){return De({size:t,offset:ke(n,e)||0})});return o.some(function(e){return e.refused})||e.every(function(e,t){return _e(n,e)===o[t].size})?null:{tiers:e,sizes:o,size:o[0].size}}function Q(n,o){o.tiers.forEach(function(e,t){Me(n,e,o.sizes[t].size)}),Re(n)}function $(t,e,n){var o=M(t),a=q(t,e);a&&b(function(){var e=h("column",t,{source:n,from:o,to:a.size});return!!v("before-resize",e)&&(Q(t,a),v("after-resize",e),!0)})}function U(o,a,t){var n=ut(l),i=A(o);a=Math.min(Math.max(a,0),11),n.every(function(e){return(xe(o,e)||0)===a})||b(function(){var e=h("column",o,{source:t,from:i,to:a});return!!v("before-indent",e)&&(n.forEach(function(e){var t=Ce(o,e),n=De({size:t,offset:a,leading:"offset"});Ae(o,e,n.offset),null!==n.size&&n.size!==t&&Me(o,e,n.size)}),v("after-indent",e),!0)})}function J(e){var t=e.parent();return{parent:t,index:t.children().not(".ge-tools-drawer").index(e)}}function G(n){var o=null;return nt.each(k,function(e,t){!o&&t.kindOf&&(o=t.kindOf(n))}),o||(n.attr("data-ge-container")?n.attr("data-ge-container"):n.hasClass("ge-tab")?"tab":n.hasClass("ge-accordion-item")?"accordion-item":n.hasClass("row")?"row":n.hasClass("column")?"column":n.hasClass("ge-element")?"element":n.hasClass("ge-content")?"content":"node")}function H(){o=nt('<div class="ge-mainControls" />').insertBefore(r),a=nt('<div class="ge-wrapper ge-top" />').appendTo(o),O=nt('<div class="ge-addRowGroup btn-group" />').appendTo(a),B=nt('<div class="ge-addContainerGroup btn-group" />'),nt.each(c.new_row_layouts,function(e,n){var t=nt('<a class="btn btn-sm btn-primary" />').attr("title",g("row.add",{layout:n.join("-")})).attr("data-ge-toolbar","row").attr("data-ge-layout",n.join(",")).on("click",function(){var t=S();n.forEach(function(e){j(e).appendTo(t)}),w("row",t,function(){t.appendTo(m)},{parent:m,source:"tool"})&&t[0].scrollIntoView&&t[0].scrollIntoView({behavior:"smooth"})}).appendTo(O),o=(t.append('<i class="bi bi-plus"></i>'),n.join(" - "),'<div class="row ge-row-icon">');n.forEach(function(e){o+='<div class="column col-'+e+'"/>'}),o+="</div>",t.append(o)}),B.appendTo(a),nt.each(C,function(o,a){nt('<a class="btn btn-sm btn-primary ge-add-container" />').attr("title",g(a.labelKey)).attr("data-ge-toolbar","container").attr("data-ge-container-type",o).append('<i class="bi bi-plus"></i>').append(nt("<span />").text(g(a.labelKey))).on("click",function(){var e=S(),t=j(ct).appendTo(e),n=a.create({});t.find("> .ge-content").replaceWith(n),w(o,n,function(){e.appendTo(m)},{parent:m,source:"tool"})}).appendTo(B)}),i=nt('<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>').on("click","a",function(){Ue(nt(this).attr("data-ge-view"))}).appendTo(a),c.layout_modes.forEach(function(e){nt('<a class="dropdown-item" />').attr("data-ge-view",e).attr("title",g(ft(e))).text(g(ft(e))).appendTo(i.find(".dropdown-menu"))}),i.find("button").text(g(ft(l)));var e=nt('<div class="btn-group pull-right"/>').appendTo(a),t=nt('<button type="button" class="btn btn-sm btn-primary gm-edit-mode"><i class="bi bi-code-slash"></i></button>').attr("title",g("tool.edit_source")).on("click",function(){(t.hasClass("active")?(m.empty().html(r.val()).show(),_(),r):(x(),r.height(.8*nt(window).height()).val(m.html()).show(),m)).hide(),t.toggleClass("active btn-danger")}).appendTo(e),n=nt('<button type="button" class="btn btn-sm btn-primary gm-preview"><i class="bi bi-eye-fill"></i></button>').attr("title",g("tool.preview")).on("mouseenter",function(){m.removeClass("ge-editing")}).on("click",function(){n.toggleClass("active btn-danger").trigger("mouseleave")}).on("mouseleave",function(){n.hasClass("active")||m.addClass("ge-editing")}).appendTo(e);e=o.find("[data-ge-toolbar]").removeClass("ge-palette-button").off("pointerdown.ge-palette"),("auto"!==c.toolbar_drag?c.toolbar_drag:"drawer"===c.drag_handle)&&e.addClass("ge-palette-button").on("pointerdown.ge-palette",Z)}function Z(e){var r=nt(e.currentTarget),n=e.pageX,o=e.pageY,l=null;function s(e){if(!l){if(t=e,!(Math.abs(t.pageX-n)+Math.abs(t.pageY-o)>c.drag.threshold))return;l=r.clone().addClass("ge-toolbar-helper").appendTo("body"),m.addClass("ge-dropping")}l.css({left:e.pageX-14,top:e.pageY-14});var t=e.pageX;(t=ee(t,e.pageY))?(u=u||nt('<div class="ge-drop-marker" />'),t.before?u.insertBefore(t.before):u.appendTo(t.region)):te()}e.button||nt(document).on("pointermove.ge-toolbar",s).on("pointerup.ge-toolbar pointercancel.ge-toolbar",function e(t){var n,o,a,i;nt(document).off("pointermove.ge-toolbar",s).off("pointerup.ge-toolbar pointercancel.ge-toolbar",e),l&&(l.remove(),m.removeClass("ge-dropping"),te(),r.one("click",function(e){e.preventDefault(),e.stopImmediatePropagation()}),t=ee(t.pageX,t.pageY))&&(n=t,o="container"===(t=r).attr("data-ge-toolbar"),a=t.attr("data-ge-container-type"),i=t=o?C[a].create({}):(e=>{var t=S();return(e||"").split(",").forEach(function(e){""!==e&&j(parseInt(e,10)).appendTo(t)}),t})(t.attr("data-ge-layout")),o&&!n.region.is(".column")&&(i=S(),j(ct).appendTo(i).find("> .ge-content").replaceWith(t)),w(o?a:"row",t,function(){n.before?i.insertBefore(n.before):i.appendTo(n.region)},{parent:n.region,source:"dragdrop"}))})}function ee(e,t){var n,e=e-window.scrollX,o=t-window.scrollY,t=document.elementFromPoint(e,o);return!t||!(e=nt(t).closest(".column, .ge-canvas")).length||e[0]!==m[0]&&!m[0].contains(e[0])?null:(n=null,e.children(".row, .ge-content, [data-ge-container]").each(function(){var e;n||(e=this.getBoundingClientRect(),o<e.top+e.height/2&&(n=nt(this)))}),{region:e,before:n})}function te(){u&&u.remove()}function ne(e){var t=nt(window);t.scrollTop()>o.offset().top&&t.scrollTop()<m.offset().top+m.height()?a.hasClass("ge-top")&&a.css({left:a.offset().left,width:a.outerWidth()}).removeClass("ge-top").addClass("ge-fixed"):a.hasClass("ge-fixed")&&a.css({left:"",width:""}).removeClass("ge-fixed").addClass("ge-top")}function oe(e){var t;nt(this).hasClass("ge-rte-active")||nt(this).is(":visible")&&(t=Ge(nt(this).data("ge-content-type")))&&(nt(this).addClass("ge-rte-active",!0),t.init(c,nt(this)))}function ae(){x(),_()}function _(){Ye(!0),m.addClass("ge-editing"),m.toggleClass("ge-drag-drawer","drawer"===c.drag_handle),m.find('.column, div[class*="col-"]').each(function(){var t,e=nt(this).addClass("column");t=e,it.filter(function(e){return null!==_e(t,e)}).length||Me(e,it[0],ct)}),m.find(".column").each(function(){var e=nt(this),t=nt();e.children().each(function(){var e=nt(this);e.is(".ge-tools-drawer, .ge-resize-handle")||(t=e.is(".row, .ge-content, [data-ge-container]")?qe(t):t.add(e))}),qe(t)}),m.find(".row").each(function(){var t,a,i,r,e,n=nt(this);n.find("> .ge-tools-drawer").length||(D(t=nt('<div class="ge-tools-drawer" />').prependTo(n)),I(t,n,c.row_classes),c.row_tools.forEach(function(e){R(t,e.title||"",e.className||"",e.iconClass||"bi bi-wrench",e.on)}),R(t,g("tool.delete_row"),"ge-delete-row","bi bi-trash",function(){y("row",n,g("confirm.delete_row"),function(e){n.slideUp(e)})}),R(t,g("tool.add_column"),"ge-add-column","bi bi-plus-circle",function(){T()||ve(n,c.add_column.size)}),a=t.find("> .ge-add-column"),i=n,c.add_column.picker&&(r=null,e=function(){window.clearTimeout(r),r=null},a.on("mouseenter mousedown",function(){r||d||(r=window.setTimeout(function(){var e,n,o;r=null,e=a,n=i,T(),o=Pe(n,E()),e.closest(".ge-tools-drawer").addClass("ge-picker-open"),d=nt('<div class="ge-size-picker" />').appendTo(e),c.valid_col_sizes.forEach(function(t){nt('<a class="ge-size" />').attr("data-ge-size",t).attr("title",g("tool.column_size",{size:t})).toggleClass("ge-size-tight",o<t).text(t).on("click",function(e){e.preventDefault(),e.stopPropagation(),T(),ve(n,t)}).appendTo(d)}),e.one("mouseleave",function(){window.setTimeout(function(){d&&!d.is(":hover")&&T()},400)})},c.add_column.delay))}),a.on("mouseleave",e),a.on("mouseup",e)))}),m.find(".column").each(function(){var t,n=nt(this);n.find("> .ge-tools-drawer").length||(D(t=nt('<div class="ge-tools-drawer" />').prependTo(n)),R(t,g("tool.column_narrower"),"ge-decrease-col-width","bi bi-dash-lg",function(e){$(n,e.shiftKey?P(c.valid_col_sizes):be(c.valid_col_sizes,M(n),-1),"tool")}),R(t,g("tool.column_wider"),"ge-increase-col-width","bi bi-plus-lg",function(e){$(n,e.shiftKey?(e=>(e=Pe(e.parent(),E(),e)-A(e),Math.min(we(c.valid_col_sizes),Math.max(e,1))))(n):be(c.valid_col_sizes,M(n),1),"tool")}),R(t,g("tool.indent_decrease"),"ge-decrease-col-offset","bi bi-text-indent-right",function(e){U(n,e.shiftKey?P(c.valid_col_offsets):be(c.valid_col_offsets,A(n),-1),"tool")}),R(t,g("tool.indent_increase"),"ge-increase-col-offset","bi bi-text-indent-left",function(e){U(n,e.shiftKey?(e=>(e=Pe(e.parent(),E(),e)-M(e),Math.min(we(c.valid_col_offsets),Math.max(e,0))))(n):be(c.valid_col_offsets,A(n),1),"tool")}),I(t,n,c.col_classes),c.col_tools.forEach(function(e){R(t,e.title||"",e.className||"",e.iconClass||"bi bi-wrench",e.on)}),R(t,g("tool.delete_column"),"ge-delete-column","bi bi-trash",function(){y("column",n,g("confirm.delete_column"),function(e){n.animate({opacity:"hide",width:"hide",height:"hide"},400,e)})}),R(t,g("tool.add_row"),"ge-add-row","bi bi-plus-circle",function(){var e=S();w("row",e,function(){n.append(e)},{parent:n,source:"tool"})}))}),m.find("[data-ge-container]").each(function(){var t,e,n,o,a=nt(this),i=z(a),r=C[i];r?(a.addClass("ge-container ge-container-"+i),r.mark(a),a.find("> .ge-tools-drawer").length||(t=a,e=i,n=r,D(o=nt('<div class="ge-tools-drawer ge-container-drawer" />').prependTo(t)),I(o,t,c.container_classes),n.addPane&&R(o,g(n.addPaneKey),"ge-add-pane","bi bi-plus-circle",function(){var e=n.addPane(t,{});w(n.paneKind,e,function(){},{parent:t,source:"tool",container:t})}),c.container_tools.forEach(function(e){R(o,e.title||"",e.className||"",e.iconClass||"bi bi-wrench",e.on)}),n.tools&&n.tools(o,t),R(o,g("tool.delete_container"),"ge-delete-container","bi bi-trash",function(){y(e,t,g("confirm.delete_container"),function(e){t.slideUp(e)})}))):f("container:"+i,'unknown container type "'+i+'"')}),re("onInit"),window.Sortable?(Se(m.find(".row"),{draggable:".column",group:"column"}),Se(m.add(m.find(".column")),{draggable:".row, .ge-content, [data-ge-container]",group:"block"}),re("onSortable",Se)):f("sortable_missing",g("error.sortable_missing")),c.resize.enabled&&m.find(".column").each(function(){var n=nt(this);n.find("> .ge-resize-handle").length||(nt('<span class="ge-resize-size" />').appendTo(n.find("> .ge-tools-drawer")),nt.each(String(c.resize.handles).split(",").map(function(e){return e.trim()}).filter(function(e){return"e"===e||"w"===e}),function(e,t){nt('<span class="ge-resize-handle" />').addClass("ge-resize-"+t).attr("data-ge-edge",t).on("pointerdown",Oe).appendTo(n)}))}),$e(l)}function x(){m.removeClass("ge-editing ge-drag-drawer ge-dropping");m.find(".ge-content").each(function(){var e=nt(this),t=Ge(e.data("ge-content-type"));t&&t.deinit(c,e),e.removeClass("ge-rte-active")});T(),te(),m.find(".ge-tools-drawer").remove(),re("onDeinit"),m.find("[data-ge-container]").each(function(){var e=nt(this),t=C[z(e)];t&&t.unmark(e),e.removeClass("ge-container ge-container-"+z(e)),e.attr("class")||e.removeAttr("class")}),nt.each(N,function(e,t){t.destroy()}),N=[],m.find(".ge-resize-handle").remove(),m.find(".ge-resize-size").remove(),Re(m),Ye(!1)}function ie(){x(),Y(),o.remove(),r.remove(),nt(window).off("scroll",ne),m.off("click",".ge-content",oe),m.off("ge-rte-ready",".ge-content"),m.removeData("grideditor")}function re(n,o){nt.each(C,function(e,t){t[n]&&t[n](o)}),nt.each(k,function(e,t){t[n]&&t[n](o)})}c.source_textarea&&(0<(t=nt(c.source_textarea).val()).length&&0==nt("<div>"+t+"</div>").find(".row").addBack(".row").length&&(n=S(),(n=j(12).appendTo(n)).find(".ge-content").html(t),t=n.html()),e.html(t)),e.children().length&&!e.find("div.row").length&&(n=e.children(),nt('<div class="row"><div class="col-lg-12"/></div>').appendTo(e).find(".col-lg-12").append(n));var C={},k={},le={},se=0;function ce(e){return"ge-"+e+"-"+ ++se+"-"+Math.random().toString(36).slice(2,6)}function de(){var e=S();return j(ct).appendTo(e),e}function z(e){return e.attr("data-ge-container")}function ue(e,t,n,o,a){var i=nt('<div class="ge-tools-drawer ge-pane-drawer" />').prependTo(e);return D(i),I(i,e,c.pane_classes),n.forEach(function(e){R(i,e.title||"",e.className||"",e.iconClass||"bi bi-wrench",e.on)}),R(i,g("tool.delete_pane"),"ge-delete-pane","bi bi-trash",function(){y(t,e,o,function(e){a(e)})}),i}function fe(e){e.find("[data-bs-toggle], [data-bs-dismiss]").addBack("[data-bs-toggle], [data-bs-dismiss]").each(function(){var n=nt(this);["toggle","dismiss"].forEach(function(e){var t=n.attr("data-bs-"+e);void 0!==t&&n.attr("data-ge-bs-"+e,t).removeAttr("data-bs-"+e)})})}function ge(e){e.find("[data-ge-bs-toggle], [data-ge-bs-dismiss]").addBack("[data-ge-bs-toggle], [data-ge-bs-dismiss]").each(function(){var n=nt(this);["toggle","dismiss"].forEach(function(e){var t=n.attr("data-ge-bs-"+e);void 0!==t&&n.attr("data-bs-"+e,t).removeAttr("data-ge-bs-"+e)})})}function me(t){var n;t.data("ge-editable")||(n=t.closest("[data-bs-toggle], [data-ge-bs-toggle]"),t.data("ge-editable",!0).attr("title",g("tool.rename")).on("dblclick",function(e){e.preventDefault(),e.stopPropagation(),fe(n),t.attr("contenteditable","true").trigger("focus"),window.getSelection().selectAllChildren(t[0])}).on("keydown",function(e){"true"===t.attr("contenteditable")&&"Enter"===e.key&&(e.preventDefault(),t.trigger("blur"))}).on("blur",function(){t.removeAttr("contenteditable"),ge(n)}))}function pe(e){var t=e.find("> .ge-pane-label");return t.length||(t=nt('<span class="ge-pane-label" />').text(e.text().trim()),e.empty().append(t)),t}function he(e){e.find(".ge-pane-label").each(function(){nt(this).removeData("ge-editable").contents().unwrap()})}function ve(e,t){var n=j(t);w("column",n,function(){e.append(n)},{parent:e,source:"tool"})}function T(){return d&&(d.closest(".ge-tools-drawer").removeClass("ge-picker-open"),d.remove(),d=null,1)}function E(){return l===rt?it[it.length-1]:dt(l)}function M(e){e=Ce(e,E());return null===e?ct:e}function A(e){return ke(e,E())||0}function be(e,n,t){var o=e.indexOf(n);return-1===o?e.reduce(function(e,t){return Math.abs(t-n)<Math.abs(e-n)?t:e},e[0]):e[Math.min(Math.max(o+t,0),e.length-1)]}function P(e){return e.reduce(function(e,t){return Math.min(e,t)},ct)}function we(e){return e.reduce(function(e,t){return Math.max(e,t)},0)}function D(e){"drawer"!==c.drag_handle&&R(e,g("tool.move"),"ge-move","bi bi-arrows-move")}function R(e,t,n,o,a){var i=nt('<a title="'+t+'" class="'+n+'"><i class="'+o+'"></i></a>').appendTo(e);"function"==typeof a&&i.on("click",a),"object"==typeof a&&nt.each(a,function(e,t){i.on(e,t)})}function ye(e){return(e.attr("class")||"").split(/\s+/).filter(function(e){return""!==e&&!(t=>"row"===t||"column"===t||/^(ge-|ui-)/.test(t)||it.some(function(e){return new RegExp("^("+e.colPrefix+"|"+e.offsetPrefix+")\\d+$").test(t)}))(e)})}function I(e,t,n){o=t,t=n||[],n=nt('<div class="ge-details" />'),nt('<input class="ge-id" />').attr("placeholder",g("tool.id_placeholder")).val(o.attr("id")).attr("title",g("tool.id_title")).appendTo(n).on("change",function(){""===this.value?o.removeAttr("id"):o.attr("id",this.value)}),nt('<input class="ge-classes" />').attr("placeholder",g("tool.classes_placeholder")).attr("title",g("tool.classes_title")).val(ye(o).join(" ")).appendTo(n).on("change",function(){var t,e;t=o,e=this.value,ye(t).forEach(function(e){t.removeClass(e)}),e.split(/\s+/).forEach(function(e){""!==e&&t.addClass(e)}),t.attr("class")||t.removeAttr("class")}),a=nt('<div class="btn-group" />').appendTo(n),t.forEach(function(e){var t=nt('<a class="btn btn-sm btn-default" />').html(e.label).attr("title",e.title||g("tool.toggle_class",{label:e.label})).toggleClass("active btn-primary",o.hasClass(e.cssClass)).on("click",function(){t.toggleClass("active btn-primary"),o.toggleClass(e.cssClass,t.hasClass("active"))}).appendTo(a)});var o,a,i=n;return R(e,g("tool.settings"),"ge-settings","bi bi-gear-fill",function(){i.toggle()}),i.appendTo(e)}function _e(e,t){return Te(e,t.colPrefix)}function xe(e,t){return Te(e,t.offsetPrefix)}function Ce(e,t){return ze(e,t,_e)}function ke(e,t){return ze(e,t,xe)}function ze(e,t,n){for(var o=it.indexOf(t);0<=o;o--){var a=n(e,it[o]);if(null!==a)return a}return null}function Te(e,t){t=new RegExp("(?:^|\\s)"+t+"(\\d+)(?:\\s|$)").exec(e.attr("class")||"");return t?parseInt(t[1],10):null}function Ee(e,t,n){var o=(e.attr("class")||"").split(/\s+/).filter(function(e){return""!==e&&!new RegExp("^"+t+"\\d+$").test(e)});null!==n&&o.push(t+n),e.attr("class",o.join(" "))}function Me(e,t,n){Ee(e,t.colPrefix,n)}function Ae(e,t,n){Ee(e,t.offsetPrefix,n||null)}function Pe(e,t,n){var o=0;return e.children(".column").each(function(){var e=nt(this);n&&e[0]===n[0]||(o+=(Ce(e,t)||0)+(ke(e,t)||0))}),ct-o}function De(e){var t=null==e.size?null:e.size,n=null==e.offset?0:e.offset,n=Math.min(Math.max(n,0),11);return null===t?{size:null,offset:n,refused:!1}:(t=Math.min(Math.max(t,1),ct))+n<=ct?{size:t,offset:n,refused:!1}:"offset"===e.leading?{size:ct-n,offset:n,refused:!1}:{size:null,offset:n,refused:!0}}function Re(e){e.find(".column").addBack(".column").each(function(){var e=nt(this);e.css({width:"",height:"",left:"",top:""}),e.attr("style")||e.removeAttr("style")})}function Ie(e){return"ge-"+e+"-"+V}function Se(e,t){var o,a,i;e.length&&window.Sortable&&(o="drawer"===c.drag_handle,a="drawer"===c.drag_handle?".ge-tools-drawer > a, .ge-details, input, textarea, button, select, option":"input, textarea, button, select, option",i=0,e.each(function(){var n=this,e=t.group?{name:Ie(t.group)}:{name:Ie(t.draggable+"-"+ ++i),pull:!1,put:!1};N.push(window.Sortable.create(n,nt.extend({group:e,draggable:t.draggable,handle:o?".ge-tools-drawer":".ge-tools-drawer .ge-move",filter:function(e,t){return!!nt(e.target).closest(a,n).length||!t||t.parentNode!==n},preventOnFilter:!1,forceFallback:!0,fallbackOnBody:!0,ghostClass:"ge-drag-placeholder",chosenClass:"ge-drag-chosen",dragClass:"ge-drag-helper",fallbackClass:"ge-drag-helper",animation:c.drag.animation,delay:c.drag.delay||c.drag.touch_delay,delayOnTouchOnly:!c.drag.delay,touchStartThreshold:c.drag.threshold,scroll:c.drag.scroll,onStart:je,onEnd:Ke},t.options||{})))}))}function je(e){var t=nt(e.item),n=J(t);t.data("ge-move-from",n),t.removeData("ge-move-canceled"),b(function(){v("before-move",h(G(t),t,{parent:n.parent,source:"dragdrop",from:n}))||t.data("ge-move-canceled",!0)})}function Ke(e){var t,n,o,a,i=nt(e.item),r=i.data("ge-move-from")||J(i);i.removeData("ge-move-from"),i.data("ge-move-canceled")?(i.removeData("ge-move-canceled"),e=i,!(n=(t=r).parent.children().not(".ge-tools-drawer").not(e)).length||t.index>=n.length?e.appendTo(t.parent):e.insertBefore(n.eq(t.index))):(o=J(i)).parent[0]===r.parent[0]&&o.index===r.index||(a=i.closest("[data-ge-container]"),(e=C[z(a)])&&e.afterPaneMove&&e.afterPaneMove(a,i,r),b(function(){v("after-move",h(G(i),i,{parent:o.parent,source:"dragdrop",from:r,to:o,container:a.length?a:void 0}))}))}function Oe(e){var t,n,i=nt(e.currentTarget),r=i.parent(),o="w"===i.attr("data-ge-edge"),a=e.pageX,l=r.outerWidth();function s(e){e=e.pageX-a;return Math.max(1,l+(o?-e:e))}function c(e){var t;r.css("width",s(e)+"px"),t=r,e=s(e),Ne(t,Ve(Be(t,e)))}e.preventDefault(),n=M(t=r),b(function(){return v("before-resize",h("column",t,{source:"dragdrop",from:n,to:null}))})&&(t.data("ge-resize-from",n),Ne(t,Ve(n)),1)&&(r.addClass("ge-resizing"),void 0!==e.pointerId&&i[0].setPointerCapture&&i[0].setPointerCapture(e.pointerId),i.on("pointermove",c).on("pointerup pointercancel",function e(t){var n,o,a;i.off("pointermove",c).off("pointerup pointercancel",e),r.removeClass("ge-resizing"),n=r,t=s(t),a=n.data("ge-resize-from"),t=Be(n,t),n.removeData("ge-resize-from"),Ne(n,""),Re(n),void 0!==a&&t!==a&&(o=q(n,t))&&b(function(){Q(n,o);var e=n,t=o.size-a;(e=Le(e))&&(t=t&&q(e,M(e)-t))&&Q(e,t),v("after-resize",h("column",n,{source:"dragdrop",from:a,to:o.size}))})}))}function Be(e,t){var n=e.parent(),o=window.getComputedStyle(n[0]),n=n[0].clientWidth-parseFloat(o.paddingLeft)-parseFloat(o.paddingRight),o=Math.round(t/n*ct),t=Le(e),n=t?M(e)+M(t)-P(c.valid_col_sizes):ct-A(e);return Math.min(Math.max(o,P(c.valid_col_sizes)),Math.max(n,P(c.valid_col_sizes)),we(c.valid_col_sizes))}function Le(e){return"next"===c.resize.balance&&(e=e.nextAll(".column").first()).length?e:null}function Ne(e,t){e.find("> .ge-tools-drawer > .ge-resize-size").text(t)}function Ve(e){return(l===rt?it[0]:E()).colPrefix+e}function S(){return nt('<div class="row" />')}function Fe(e,t,n){var o,a,i=null;return at.forEach(function(e){null===i&&n&&void 0!==n[e]&&(i=e)}),null===i?e:(a=nt(n[i]),o="appendTo"===i||"prependTo"===i?a:a.parent(),a=function(){return w(t,e,function(){e[i](n[i])},{parent:o,source:"api"})},0<p?(X(a),e):a())}function Xe(e,t,n){e=nt(e),n=n||{};var o=C[z(e)];return o&&z(e)===t?(n=o.addPane(e,n),w(o.paneKind,n,function(){},{parent:e,source:"api",container:e})):(vt("this is not a "+t+" container"),null)}function We(){var n={};return nt.each(c,function(e,t){n[e]=Array.isArray(t)?t.slice():t}),Object.freeze(n)}function j(n,o){var e=Ge(c.content_types[0]),a=nt('<div class="column"/>').append(Qe().html(e?e.initialContent:""));return ut(l).forEach(function(e){var t=De({size:n,offset:o||0,leading:"offset"});Me(a,e,null===t.size?n:t.size),Ae(a,e,t.offset)}),a}function Ye(n){c.custom_filter.length&&nt.each(c.custom_filter,function(e,t){(t="string"==typeof t?window[t]:t)(m,n)})}function qe(e){var t;return e.length&&(t=Qe().insertAfter(e.last()),e.appendTo(t)),nt()}function Qe(){return nt("<div/>").addClass("ge-content ge-content-type-"+c.content_types[0]).attr("data-ge-content-type",c.content_types[0])}function $e(t){l=t,lt.forEach(function(e){m.toggleClass("ge-layout-"+e,e===t)}),i.find("button").text(g(ft(t)))}function Ue(e){var t="number"==typeof(t=e)?(f("changeView-index","changeView("+t+"): layout modes are identified by breakpoint key now, so pass one of "+JSON.stringify(lt)+". Numeric indexes still work, but they mean what they meant in 2.x ("+st.join(", ")+") and will be dropped."),st[t]||null):-1===lt.indexOf(t)?null:t;null===t?vt("changeView("+JSON.stringify(e)+"): no such layout mode"):$e(t)}function Je(){return l}function Ge(e){return nt.fn.gridEditor.RTEs[e]}var He,Ze={getHtml:function(){x(),Re(m);var e=m.html();return _(),e},init:function(){X(_)},reset:function(){X(ae)},deinit:x,destroy:ie,remove:function(){f("remove","remove() is deprecated and will be removed in a later release. Use destroy(), which does the same thing."),ie()},changeView:Ue,getView:Je,createRow:function(e,t){var n=S();return void 0===e||Array.isArray(e)||(vt("createRow: the layout is an array of column sizes, as in [8, 4]. Making an empty row instead."),e=[]),(e||[]).forEach(function(e){j(e).appendTo(n)}),Fe(n,"row",t)},createColumn:function(e,t){return t=t||{},"number"!=typeof e&&(vt("createColumn: no column size given, using 12"),e=ct),e=j(e,t.offset),void 0!==t.content&&e.find(".ge-content").html(t.content),Fe(e,"column",t)},createElement:function(e,t){return le.createElement?le.createElement(e,t):(f("plugin:elements","createElement needs the elements plugin: include dist/plugins/grideditor.elements.js after the editor"),null)},createContainer:function(e,t){t=t||{};var n=C[e];return n?Fe(n.create(t),e,t):(vt('createContainer: no such container type "'+e+'"'),null)},addTab:function(e,t){return Xe(e,"tabs",t)},addAccordionItem:function(e,t){return Xe(e,"accordion",t)},setLocale:function(e){c.locale=e,Ze.settings=We(),Y(),o.remove(),H(),ae()},canvas:m,settings:We()};function et(e){return!c.plugins||-1!==c.plugins.indexOf(e)}nt.each(ot,function(e,t){t.unimplemented&&(Ze[e]=function(){return f(e,e+" is registered but not implemented in this build yet"),null})}),e.data("grideditor",Ze),He={canvas:m,settings:c,t:g,warn:vt,containerId:ce,defaultRegion:de,createTool:R,createMoveTool:D,addSettingsTool:I,deleteNode:y,place:Fe,createPaneControls:ue,makeLabelEditable:me,labelIn:pe,unwrapLabels:he,suspendToggles:fe,resumeToggles:ge,emit:v,payloadFor:h,operate:b},nt.each(nt.fn.gridEditor.containers,function(e,t){et(e)&&(C[e]=t(He))}),nt.each(nt.fn.gridEditor.features,function(e,t){et(e)&&(k[e]=t(He))}),nt.each(k,function(e,t){nt.each(t.methods||{},function(e,t){le[e]=t})}),(c.plugins||[]).forEach(function(e){C[e]||k[e]||f("plugin:"+e,'the "'+e+'" plugin is not loaded: include dist/plugins/grideditor.'+e+".js after the editor")}),r=nt('<textarea class="ge-html-output"/>').insertBefore(m),H(),nt(window).on("scroll",ne),m.on("click",".ge-content",oe),m.on("click",".ge-popup-trigger, [data-ge-popup-target]",function(e){m.hasClass("ge-editing")&&e.preventDefault()}),m.on("ge-rte-ready",".ge-content",function(){re("onContentReady",nt(this))}),_()}),e;var t,n,o=tt,a=Array.prototype.slice.call(arguments,1),i=ot[o];if(i){if(i.value)return(t=e.first()).length?(n=t.data("grideditor"))?n[o].apply(n,a):i.noInstance?i.noInstance(t):null:null;e.each(function(){var e=nt(this).data("grideditor");e&&e[o].apply(e,a)})}else r("method:"+o,'unknown method "'+o+'"');return e},nt.fn.gridEditor.RTEs={},nt.fn.gridEditor.containers={},nt.fn.gridEditor.features={},nt.fn.gridEditor.t=ht,nt.fn.gridEditor.locales={en:{"tool.move":"Move","tool.settings":"Settings","tool.add_row":"Add row","tool.add_column":"Add column\n(hold to choose the width)","tool.column_size":"{size} of 12","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\n(hold shift for min)","tool.column_wider":"Make column wider\n(hold shift for max)","tool.indent_decrease":"Decrease indent\n(hold shift for none)","tool.indent_increase":"Increase indent\n(hold shift for max)","tool.edit_source":"Edit Source Code","tool.preview":"Preview","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}","confirm.title":"Confirm","confirm.ok":"Delete","confirm.cancel":"Cancel","confirm.delete_row":"Delete row?","confirm.delete_column":"Delete column?","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","error.sortable_missing":"SortableJS not available! Make sure you loaded the Sortable js file; dragging is off without it.","warning.setting_removed":"The {setting} setting was removed in 4.0. Use {replacement} instead.","error.tinymce_missing":"tinyMCE not available! Make sure you loaded the tinyMCE js file.","error.ckeditor_missing":"CKEditor not available! Make sure you loaded the ckeditor and jquery adapter js files.","error.summernote_missing":"Summernote not available! Make sure you loaded the Summernote js file."}}})(jQuery),(i=>{i.fn.gridEditor.RTEs.ckeditor={init:function(a,e){window.CKEDITOR||console.error(i.fn.gridEditor.t(a,"error.ckeditor_missing"));var t=this;e.each(function(){var e,n,o=i(this);o.hasClass("active")||(o.html()==t.initialContent&&o.html(" "),o.addClass("active").attr("contenteditable","true"),e=i.extend({},a.ckeditor&&a.ckeditor.config?a.ckeditor.config:{},{on:{instanceReady:function(e){var t;try{t=a.ckeditor.config.on.instanceReady}catch(e){}t&&t.call(this,e),o.trigger("ge-rte-ready"),n.focus()}}}),n=CKEDITOR.inline(o.get(0),e))})},deinit:function(e,t){t.filter(".active").each(function(){var e=i(this);i.each(CKEDITOR.instances,function(e,t){t.destroy()}),e.removeClass("active cke_focus").removeAttr("id").removeAttr("style").removeAttr("spellcheck").removeAttr("contenteditable")})},initialContent:"<p>Lorem initius... </p>"}})(jQuery),(a=>{a.fn.gridEditor.RTEs.summernote={init:function(n,e){jQuery().summernote||console.error(a.fn.gridEditor.t(n,"error.summernote_missing"));var o=this;e.each(function(){var e,t=a(this);t.hasClass("active")||(t.html()==o.initialContent&&t.html(""),t.addClass("active"),e=a.extend(!0,{},n.summernote&&n.summernote.config?n.summernote.config:{},{tabsize:2,airMode:!0,callbacks:{onInit:function(){var e;try{e=n.summernote.config.callbacks.onInit}catch(e){}e&&e.call(this),t.trigger("ge-rte-ready"),t.summernote("focus")}}}),t.summernote(e))})},deinit:function(e,t){t.filter(".active").each(function(){var e=a(this);e.summernote("destroy"),e.removeClass("active").removeAttr("id").removeAttr("style").removeAttr("spellcheck")})},initialContent:"<p>Lorem ipsum dolores</p>"}})(jQuery),(a=>{function i(e){e.removeClass("active").removeClass("ge-rte-active").removeAttr("id").removeAttr("style").removeAttr("spellcheck").removeAttr("contenteditable").removeAttr("data-mce-style")}a.fn.gridEditor.RTEs.tinymce={init:function(e,t){var n,o;window.tinymce?(n=this,o=e.tinymce&&e.tinymce.config?e.tinymce.config:{},t.each(function(){var e,t=a(this);t.hasClass("active")||(t.html()==n.initialContent&&t.html(""),t.addClass("active"),delete(e=a.extend({promotion:!1},o,{target:this,inline:!0,init_instance_callback:function(e){t.data("ge-tinymce-pending-remove")?(t.removeData("ge-tinymce-pending-remove"),e.remove(),i(t)):(t.data("ge-tinymce",e),t.trigger("ge-rte-ready"),window.requestAnimationFrame(function(){!e.removed&&e.ui&&e.ui.show&&e.ui.show()}),e.on("focus",function(){window.requestAnimationFrame(function(){!e.removed&&e.ui&&e.ui.show&&e.ui.show()})}),e.focus(),o.init_instance_callback&&o.init_instance_callback.call(this,e),o.oninit&&o.oninit.call(this,e))}})).selector,window.tinymce.init(e))})):console.error(a.fn.gridEditor.t(e,"error.tinymce_missing"))},deinit:function(e,t){t.filter(".active").each(function(){var e=a(this),t=e.data("ge-tinymce");t?(e.removeData("ge-tinymce"),t.remove()):e.data("ge-tinymce-pending-remove",!0),i(e)})},initialContent:"<p>Lorem ipsum dolores</p>"}})(jQuery);
|
|
10
|
+
//# sourceMappingURL=jquery.grideditor.min.js.map
|