@themarioga/grid-editor 9.0.0-beta.2 → 9.0.0-beta.3
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 +14 -0
- package/README.md +52 -0
- package/dist/grideditor.bundle.min.js +2 -2
- package/dist/grideditor.d.ts +38 -0
- package/dist/grideditor.esm.js +33 -2
- package/dist/grideditor.js +33 -2
- package/dist/grideditor.min.js +1 -1
- package/dist/grideditor.min.js.map +3 -3
- package/dist/locales/grideditor.es.esm.js +2 -0
- 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 +2 -2
- package/dist/plugins/grideditor.history.esm.js +360 -0
- package/dist/plugins/grideditor.history.js +365 -0
- package/dist/plugins/grideditor.history.min.js +1 -0
- package/dist/plugins/grideditor.history.min.js.map +7 -0
- package/docs/events.md +3 -0
- package/docs/locale-keys.md +11 -0
- package/docs/plugins.md +8 -1
- package/example/clipboard.html +22 -0
- package/example/history.html +94 -0
- package/example/index.html +8 -0
- package/package.json +1 -1
- package/src/js/grideditor.js +30 -1
- package/src/js/locales/grideditor.es.js +2 -0
- package/src/js/plugins/grideditor.history.js +367 -0
- package/types/grideditor.d.ts +38 -0
package/dist/grideditor.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(()=>{function _(a,d){return a?Array.prototype.slice.call(a.querySelectorAll(d)):[]}function A(a,d){return a?a.querySelector(d):null}function se(a,d){if(!a)return[];var p=_(a,d);return a.nodeType===1&&a.matches(d)&&p.unshift(a),p}function X(a,d){return a?Array.prototype.filter.call(a.children,function(p){return!d||p.matches(d)}):[]}function P(a,d){return X(a,d)[0]||null}function Y(a,d,p){var s=a&&a.nodeType===1?a.closest(d):null;return s&&p&&s!==p&&!p.contains(s)?null:s}function Te(a,d){return!!a&&a.nodeType===1&&a.matches(d)}function Oe(a){return!!a&&document.documentElement.contains(a)}function To(a,d){for(var p=[],s=a.nextElementSibling;s;s=s.nextElementSibling)(!d||s.matches(d))&&p.push(s);return p}function Oo(a,d){for(var p=[],s=a.parentElement;s&&s!==d;s=s.parentElement)p.push(s);return p}function Ka(a){var d=document.createElement("template");return d.innerHTML=a,Array.prototype.slice.call(d.content.childNodes)}function G(a){for(var d=Ka(a.trim()),p=0;p<d.length;p++)if(d[p].nodeType===1)return d[p];return null}function v(a,d,p){var s=document.createElement(a);return Object.keys(d||{}).forEach(function(f){var E=d[f];E!=null&&E!==!1&&s.setAttribute(f,E)}),p!=null&&(s.textContent=p),s}function mt(a,d){return a.innerHTML=d==null?"":String(d),a}function C(a,d){return Je(d).forEach(function(p){a.classList.add(p)}),a}function k(a,d){return Je(d).forEach(function(p){a.classList.remove(p)}),a}function R(a,d,p){return Je(d).forEach(function(s){p===void 0?a.classList.toggle(s):a.classList.toggle(s,!!p)}),a}function b(a,d){return!!a&&a.nodeType===1&&a.classList.contains(d)}function Je(a){return String(a||"").split(/\s+/).filter(Boolean)}function gt(a){return a.getAttribute("class")||a.removeAttribute("class"),a}function pt(a){return a.getAttribute("style")||a.removeAttribute("style"),a}function Ut(a,d){return Object.keys(d).forEach(function(p){var s=d[p];s==null?a.removeAttribute(p):a.setAttribute(p,s)}),a}function Le(a,d){return Object.keys(d).forEach(function(p){var s=d[p];typeof s=="number"&&!Ba[p]&&(s=s+"px"),a.style.setProperty(p,s==null?"":String(s))}),a}var Ba={opacity:!0,"z-index":!0,"flex-grow":!0,"flex-shrink":!0,order:!0},ft={};function Va(a){var d=a.nodeName;if(!ft[d]){var p=document.body.appendChild(document.createElement(d));ft[d]=getComputedStyle(p).display,p.remove(),ft[d]==="none"&&(ft[d]="block")}return ft[d]}function Me(a){return a.style.removeProperty("display"),getComputedStyle(a).display==="none"&&(a.style.display=Va(a)),a}function de(a){return a.style.display="none",a}function Gn(a,d){return d===void 0&&(d=!vt(a)),d?Me(a):de(a)}function vt(a){return!!(a.offsetWidth||a.offsetHeight||a.getClientRects().length)}function ht(a){return a.getBoundingClientRect().width}function Kt(a){return a.getBoundingClientRect().height}function Lo(a){var d=getComputedStyle(a);return a.clientHeight-parseFloat(d.paddingTop)-parseFloat(d.paddingBottom)}function Bt(a){var d=a.getBoundingClientRect();return{top:d.top+window.pageYOffset,left:d.left+window.pageXOffset}}function Vt(a,d){return d.parentNode.insertBefore(a,d.nextSibling),a}function Gt(a){for(var d=a.parentNode;a.firstChild;)d.insertBefore(a.firstChild,a);a.remove()}function Mo(a,d){return a.parentNode.insertBefore(d,a),d.appendChild(a),d}function $e(a,d,p,s,f){var E=function(w){var D=Y(w.target,p,a);if(D&&a.contains(D))return s.call(D,w)};return Je(d).forEach(function(w){a.addEventListener(w,E,f)}),E}function ue(a,d,p,s){return Je(d).forEach(function(f){a.addEventListener(f,p,s)}),p}function qn(a,d,p,s){Je(d).forEach(function(f){a.removeEventListener(f,p,s)})}var Ga=400;function Po(a,d,p,s){p=p===void 0?Ga:p;var f=function(){de(a),s&&s()};if(!vt(a)||!a.animate||p<=0){window.setTimeout(f,0);return}var E=a.animate(d(getComputedStyle(a)),{duration:p,easing:"ease-in-out"}),w=!1,D=function(){w||(w=!0,f())};E.onfinish=D,E.oncancel=D}function bt(a,d,p){typeof d=="function"&&(p=d,d=void 0),a.style.overflow="hidden",Po(a,function(s){return[{height:s.height,paddingTop:s.paddingTop,paddingBottom:s.paddingBottom,marginTop:s.marginTop,marginBottom:s.marginBottom},{height:"0px",paddingTop:"0px",paddingBottom:"0px",marginTop:"0px",marginBottom:"0px"}]},d,function(){a.style.removeProperty("overflow"),p&&p()})}function zo(a,d,p,s){a.style.overflow="hidden",Po(a,function(f){var E={opacity:f.opacity,height:f.height},w={opacity:0,height:"0px"};return s&&(E.width=f.width,w.width="0px"),[E,w]},d,function(){a.style.removeProperty("overflow"),p&&p()})}var jo={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},addPane:{value:!0},setLocale:{},getUtility:{value:!0},setUtility:{value:!0},getActiveTarget:{value:!0},setActiveTarget:{},getSelected:{value:!0},setSelected:{}},Xa=["appendTo","prependTo","insertAfter","insertBefore"],Ya=["data-bs-target","data-bs-parent","href","aria-controls","aria-labelledby","aria-describedby","for","data-ge-popup-id","data-ge-popup-target"],Ja=/^ge-([a-z][a-z-]*?)-\d+-[a-z0-9]+$/,y=[{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"}],Z="all",$a="view.all",Xn=[Z].concat(y.map(function(a){return a.key})),W=12,Ro=11,Yn=["equal","auto"],Qe=["1","2","3","4","5","6","auto"];function Jn(a,d){return"row-cols"+(a.infix?"-"+a.infix:"")+"-"+d}function $(a){return typeof a=="number"}function He(a,d){return d==="equal"?a.infix?"col-"+a.infix:"col":a.colPrefix+d}function ee(a){for(var d=0;d<y.length;d++)if(y[d].key===a)return y[d];return null}function No(a){if(a===Z)return[y[0]];var d=ee(a);return d?[d]:[]}function wt(a){var d=ee(a);return d?d.labelKey:$a}var Pe={add_column:{size:12,picker:!0,delay:600},elements:{enabled:"auto",selector:"[data-ge-element]",auto:!1,types:[]},resize:{enabled:!0,tools:!0,handles:"e",balance:"next"},indent:{tools:!0},sidebar:{empty:null},drag:{delay:0,touch_delay:100,threshold:3,animation:150,scroll:!0}},Io={},Qa=0,Xt=new WeakMap,qt=null,Za=".ge-mainControls, .ge-settings-panel, .ge-sidebar-toggle, .ge-dialog, .ge-confirm, .ge-size-picker, .modal, .modal-backdrop";function Qn(a,d,p){var s=S.locales,f=s[a.locale]||{},E=a.locale_strings||{},w=E[d];return w===void 0&&(w=f[d]),w===void 0&&(w=s.en[d]),w===void 0&&(tl("locale:"+d,'no string for "'+d+'" in any locale, showing the key'),w=d),w.replace(/\{(\w+)\}/g,function(D,ce){return p&&p[ce]!==void 0?p[ce]:D})}function el(a,d){var p=S.locales;return(a.locale_strings||{})[d]!==void 0||(p[a.locale]||{})[d]!==void 0||p.en[d]!==void 0}function U(a){window.console&&window.console.warn&&window.console.warn("grid-editor: "+a)}function tl(a,d){Io[a]||(Io[a]=!0,U(d))}function nl(a,d){return Qn({locale:"en"},a,d)}function rl(a){if(typeof a=="string"){var d=document.querySelector(a);if(!d)throw new TypeError("grid-editor: no element matches "+JSON.stringify(a));return d}if(a&&a.nodeType===1)return a;throw new TypeError("grid-editor: the target is an element or a selector, not "+(a===null?"null":typeof a))}function oe(a){return typeof a=="string"?document.querySelector(a):a&&a.nodeType===1?a:null}function Do(){return S.Sortable||window.Sortable||null}function yt(){var a=S.bootstrap||window.bootstrap;return a&&a.Modal?a.Modal:null}function $n(a){var d=document.implementation.createHTMLDocument("").body;d.innerHTML=a;var p=[];return _(d,"*").forEach(function(s){var f=!1;Array.prototype.slice.call(s.attributes).forEach(function(D){D.name.indexOf("data-ge-")===0&&(s.removeAttribute(D.name),f=!0)});var E=(s.getAttribute("class")||"").split(/\s+/).filter(Boolean),w=E.filter(function(D){return D!=="column"&&D.indexOf("ge-")!==0});w.length!==E.length&&(f=!0),w.length?s.setAttribute("class",w.join(" ")):s.removeAttribute("class"),f&&s.tagName==="DIV"&&!s.attributes.length&&p.push(s)}),p.forEach(function(s){Gt(s)}),d.innerHTML}function S(a,d){var p=rl(a),s=Xt.get(p);if(s)return Fo.has(p)||(Fo.add(p),U(nl("warning.already_editing"))),s;if(!(this instanceof S))return new S(p,d);ol(this,p,d||{})}var Fo=new WeakSet;S.create=function(a,d){return new S(a,d)};S.get=function(a){var d=oe(a);return d&&Xt.get(d)||null};function ol(a,d,p){var s=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",drawer_overflow:"menu",toolbar_groups:!1,active_target:!1,element_tools:[],element_classes:[],container_classes:[],pane_classes:[],container_tools:[],tab_tools:[],accordion_tools:[],plugins:null,row_cols:!0,utilities:{},elements:Pe.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:Pe.add_column,layout_modes:Xn.slice(),default_view:Z,resize:Pe.resize,indent:Pe.indent,source_textarea:"",edit_source:!0,locale:"en",locale_strings:{},callbacks:{},confirm_delete:!0,settings_panel:"offcanvas",sidebar:Pe.sidebar,drag:Pe.drag},p);if(Object.keys(Pe).forEach(function(e){s[e]=Object.assign({},Pe[e],s[e])}),s.settings_panel==="sidebar"){if(p&&p.active_target===!1)throw new TypeError('grid-editor: settings_panel "sidebar" needs active_target; leave it out or set it to true');s.active_target=!0}var f,E,w,D,ce,We,te,z=s.default_view,j=null,ne=null,ye=!1,Ue=null,H=null,Ct=null,Yt=function(){},Jt=function(){},fe=[],Et={},$t=null,Zn={},xt=[],er=++Qa,_t=!1,q=null,Ke=null,tr=null;s.settings_panel==="sidebar"&&(qt?(K("sidebar",'settings_panel "sidebar" is in use by another editor on the page, which has one sidebar: using offcanvas'),s.settings_panel="offcanvas"):qt=a);var Be=new WeakMap,Qt=new WeakMap,kt=new WeakMap,nr=new WeakMap,Zt=new WeakSet,en=new AbortController;f=C(d,"ge-canvas");function K(e,t){Zn[e]||(Zn[e]=!0,U(t))}function m(e,t){return Qn(s,e,t)}function Ho(e){s.locale=e,a.settings=Hn(),or(),Jr(),so(),fn(),cn(),yr()}var Ze=0,tn=[];function re(e,t,n){return Object.assign({kind:e,node:t,parent:t.parentElement,canvas:f,breakpoint:Bn(),source:"api"},n||{})}function N(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(i){var l=new CustomEvent("grideditor:"+i,{detail:t,bubbles:!0,cancelable:!0});f.dispatchEvent(l)||(o=!0)}),n.forEach(function(i){var l=s.callbacks[i.replace(/-/g,"_")];typeof l=="function"&&l(t)===!1&&(o=!0)}),!o}function Q(e){Ze++;try{return e()}finally{if(Ze--,Ze===0)for(;tn.length;)tn.shift()()}}function nn(e){if(Ze===0){e();return}tn.push(e)}function ie(e,t,n,r){var o=Wo(e);return Q(function(){var i=re(e,t,r);return N("before-add-"+o,i)?(n(),ge(),N("after-add-"+o,i),t):null})}function Wo(e){return S.containers[e]?"container":e}function Uo(e,t){if(!s.confirm_delete){t();return}rr(e,{danger:!0},function(n){n&&t()})}function rr(e,t,n){t=t||{};var r=yt();if(!r){n(window.confirm(e));return}var o=Ko(),i=!1,l=A(o,".ge-confirm-ok");ze&&ze(null);var c=function(u){ze===c&&(ze=null,n(u))};ze=c,A(o,".modal-title").textContent=t.title||m("confirm.title"),A(o,".ge-confirm-cancel").textContent=t.cancel||m("confirm.cancel"),l.textContent=t.ok||m("confirm.ok"),R(l,"btn-danger",!!t.danger),R(l,"btn-primary",!t.danger),A(o,".ge-confirm-message").textContent=e,l.onclick=function(){i=!0,r.getInstance(o).hide()},Ce.hidden=function(){c(i)},Ce.shown=function(){l.focus()},r.getOrCreateInstance(o).show()}var Ce={hidden:null,shown:null},ze=null;function Ko(){if(j)return j;j=G('<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(j),A(j,".modal-title").textContent=m("confirm.title"),A(j,".btn-close").setAttribute("aria-label",m("confirm.cancel")),A(j,".ge-confirm-cancel").textContent=m("confirm.cancel"),A(j,".ge-confirm-ok").textContent=m("confirm.ok"),ir(j);var e=j;return j.addEventListener("hidden.bs.modal",function(){e===j&&Ce.hidden&&Ce.hidden()}),j.addEventListener("shown.bs.modal",function(){e===j&&Ce.shown&&Ce.shown()}),j}function or(){j&&(Ce.hidden=null,Ce.shown=null,rn(j),j=null,ze&&ze(null))}function rn(e){var t=yt(),n=t?t.getInstance(e):null,r=!1,o=function(){r||(r=!0,n&&n.dispose(),e.remove())};if(!n||!on.get(e)&&!b(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 on=new WeakMap;function ir(e){ue(e,"show.bs.modal hide.bs.modal",function(){on.set(e,!0)}),ue(e,"shown.bs.modal hidden.bs.modal",function(){on.set(e,!1)})}function je(e,t,n,r){Q(function(){var o=re(e,t,{source:"tool"});N("before-delete",o)&&Uo(n,function(){Q(function(){r(function(){t.remove(),Q(function(){ge(),N("after-delete",o)})})})})})}function an(e,t,n){if(n=n||z,n!==Z){var r=ee(n),o=It({size:t,offset:Rt(e,r)||0});return o.refused||qe(e,r)===o.size?null:{writes:[{tier:r,size:o.size}],cleared:null,size:o.size}}var i=y.some(function(g){return It({size:t,offset:Rt(e,g)||0}).refused});if(i)return null;var l=y[0],c=[],u=[];return y.slice(1).forEach(function(g){var h=qe(e,g);h!==null&&(c.push({tier:g,size:null}),u.push({breakpoint:g.key,value:h}))}),qe(e,l)!==t&&c.unshift({tier:l,size:t}),c.length?{writes:c,cleared:u,size:t}:null}function ln(e,t){t.writes.forEach(function(n){Nt(e,n.tier,n.size)}),Xe(e)}function sn(e,t){return t&&(e.cleared=t),e}function dn(e,t,n,r){r=r||z;var o=ot(e),i=an(e,t,r);return i?Q(function(){var l=re("column",e,sn({source:n,breakpoint:r,from:o,to:i.size},i.cleared));return N("before-resize",l)?(ln(e,i),pe(e),N("after-resize",l),!0):(pe(e),!1)}):!1}function ar(e,t,n){var r=z===Z,o=r?y[0]:ee(z),i=at(e);t=Math.min(Math.max(t,0),Ro);var l=r?y.slice(1).filter(function(c){return jt(e,c)!==null}):[];return(jt(e,o)||0)===t&&!l.length?!1:Q(function(){var c=re("column",e,sn({source:n,from:i,to:t},r?l.map(function(u){return{breakpoint:u.key,value:jt(e,u)}}):null));return N("before-indent",c)?(jn(e,o,t),l.forEach(function(u){jn(e,u,0)}),(r?y:[o]).forEach(function(u){var g=zn(e,u);if($(g)){var h=It({size:g,offset:t,leading:"offset"});h.size!==g&&Nt(e,u,h.size)}}),pe(e),N("after-indent",c),!0):!1})}function un(e){var t=e.parentElement;return{parent:t,index:X(t).filter(function(n){return!b(n,"ge-tools-drawer")}).indexOf(e)}}function me(e){var t=null;if(Object.keys(L).forEach(function(r){var o=L[r];!t&&o.kindOf&&(t=o.kindOf(e))}),t)return t;if(e.getAttribute("data-ge-container"))return e.getAttribute("data-ge-container");var n=null;return Object.keys(O).forEach(function(r){var o=O[r];!n&&o.paneClass&&b(e,o.paneClass)&&(n=o.paneKind)}),n||(b(e,"ge-tab")?"tab":b(e,"ge-accordion-item")?"accordion-item":b(e,"row")?"row":b(e,"column")?"column":b(e,"ge-element")?"element":(b(e,"ge-text-block")&&(e=P(e,".ge-content")||e),b(e,"ge-content")?e.getAttribute("data-ge-content-type")?"text":"plain":"node"))}if(s.source_textarea){var et=oe(s.source_textarea).value,lr=v("div");lr.innerHTML=et,et.length>0&&!lr.querySelector(".row")&&(et='<div class="row"><div class="col-lg-12">'+et+"</div></div>"),mt(d,et)}if(d.children.length&&!d.querySelector("div.row")){var Bo=X(d),sr=G('<div class="row"><div class="col-lg-12"></div></div>');d.appendChild(sr),Bo.forEach(function(e){sr.firstChild.appendChild(e)})}function Vo(){te=v("textarea",{class:"ge-html-output"}),f.parentNode.insertBefore(te,f),cn(),Yi();var e={signal:en.signal};window.addEventListener("scroll",gr,e),$e(f,"click",".ge-content",di,e),$e(f,"click",".ge-popup-trigger, [data-ge-popup-target]",function(o){b(f,"ge-editing")&&o.preventDefault()},e);var t=he()==="sidebar";if(s.active_target||t){var n=null;f.addEventListener("pointerdown",function(o){n={x:o.clientX,y:o.clientY}},e),f.addEventListener("click",function(o){var i=n;n=null,b(f,"ge-editing")&&(i&&Math.abs(o.clientX-i.x)+Math.abs(o.clientY-i.y)>s.drag.threshold||(s.active_target&&r(o),t&&f.contains(o.target)&&be(io(o.target))))},e),document.addEventListener("keydown",function(o){if(!(o.key!=="Escape"||V||le)&&!(j&&b(j,"show"))){var i=document.activeElement;i&&(Te(i,"input, textarea, select")||i.isContentEditable)||(q&&ut()?be(null):H&&Re(null))}},e)}t&&(f.addEventListener("focusin",function(o){var i=ut()?io(o.target):null;i&&be(i)},e),document.addEventListener("click",function(o){var i=o.target;!q||!ut()||!i||i.nodeType!==1||!Oe(i)||f.contains(i)||Y(i,Za)||f.querySelector(".ge-rte-active")||be(null)},e),window.addEventListener("resize",Zr,e));function r(o){var i=Y(o.target,Cr());if(i&&i===H&&(o.target===i||o.target===P(i,".ge-tools-drawer"))){Re(null);return}Re(i&&i!==f&&f.contains(i)?i:null)}}function Go(e){!Te(e,".ge-content")||!f.contains(e)||(ae("onContentReady",e),rt(e))}function cn(){E=v("div",{class:"ge-mainControls"}),te.parentNode.insertBefore(E,te),w=E.appendChild(v("div",{class:"ge-wrapper ge-top"}));var e=s.toolbar_overflow!=="wrap",t=w;e&&(C(w,"ge-toolbar-menu"),t=w.appendChild(v("div",{class:"ge-toolbar-start"}))),fe=[],D=t.appendChild(v("div",{class:"ge-addRowGroup btn-group"})),ce=v("div",{class:"ge-addContainerGroup btn-group ms-1"}),s.new_row_layouts.forEach(function(u){var g=!Array.isArray(u),h=v("a",{class:"btn btn-sm btn-light",title:g?m("row.add_row_cols",{columns:u.columns,counts:li(u.row_cols)}):m("row.add",{layout:u.join("-")}),"data-ge-toolbar":"row","data-ge-layout":g?JSON.stringify(u):u.join(",")});h.addEventListener("click",function(){if(H){hn(h,"tool");return}var I=tt(u),Wt=ie("row",I,function(){f.appendChild(I)},{parent:f,source:"tool"});Wt&&I.scrollIntoView&&I.scrollIntoView({behavior:"smooth"})}),D.appendChild(h),fe.push({button:h,home:D,group:"rows"}),h.appendChild(G('<i class="bi bi-plus"></i>'));var x=g?si(u):u,T='<div class="row ge-row-icon">';x.forEach(function(I){T+='<div class="column '+He(y[0],I)+'"></div>'}),T+="</div>",h.appendChild(G(T))}),t.appendChild(ce),Object.keys(O).forEach(function(u){var g=O[u],h=ur(v("a",{class:"btn btn-sm btn-light ge-add-container"}),m(g.labelKey),g.iconClass);Ut(h,{"data-ge-toolbar":"container","data-ge-container-type":u}),h.addEventListener("click",function(){if(H){hn(h,"tool");return}var x=Ye(),T=x.appendChild(Se(W)),I=T.appendChild(g.create({}));ie(u,I,function(){f.appendChild(x)},{parent:f,source:"tool"})}),ce.appendChild(h),fe.push({button:h,home:ce,group:dr(g.group)||"content"})});var n=[];Et={},Object.keys(L).forEach(function(u){Et[u]=$o(L[u]),Et[u].forEach(function(g,h){var x=ei(u,g,h);g.align==="end"?n.push(x):(ce.appendChild(x),fe.push({button:x,home:ce,group:dr(g.group)||u}))})}),We=G('<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>'),$e(We,"click","a",function(){ko(this.getAttribute("data-ge-view"))}),w.appendChild(We),s.layout_modes.forEach(function(u){A(We,".dropdown-menu").appendChild(v("a",{class:"dropdown-item","data-ge-view":u,title:m(wt(u))},m(wt(u))))}),A(We,"button").textContent=m(wt(z));var r=w.appendChild(v("div",{class:"btn-group pull-right"}));if(s.edit_source){var o=G('<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",ye),o.addEventListener("click",function(){ye?vn():fi(),R(o,"active btn-danger",ye)}),r.appendChild(o)}var i=G('<button type="button" class="btn btn-sm btn-primary gm-preview"><i class="bi bi-eye-fill"></i></button>'),l=function(){b(i,"active")||C(f,"ge-editing")};if(i.setAttribute("title",m("tool.preview")),i.addEventListener("mouseenter",function(){k(f,"ge-editing")}),i.addEventListener("click",function(){R(i,"active btn-danger"),l()}),i.addEventListener("mouseleave",l),r.appendChild(i),n.length){var c=w.appendChild(v("div",{class:"pull-right ge-toolbar-end"}));n.forEach(function(u){c.appendChild(u)})}s.toolbar_groups&&Xo(t),e&&Zo(t),ni()}var qo=[{name:"rows",labelKey:"group.rows"},{name:"content",labelKey:"group.content"},{name:"elements",labelKey:"group.elements"}];function dr(e){return typeof e=="string"&&e.trim()!==""?e:null}function Xo(e){var t=qo.map(function(i){return i.name});if(fe.forEach(function(i){t.indexOf(i.group)<0&&t.push(i.group)}),t=t.filter(function(i){return fe.some(function(l){return l.group===i})}),t.length<2)return;var n=v("div",{class:"ge-toolbar-groups btn-group",role:"tablist","aria-label":m("group.select")});e.insertBefore(n,e.firstChild);var r=E.appendChild(v("div",{class:"ge-toolbar-stash",hidden:"hidden"}));t.forEach(function(i){var l=n.appendChild(v("button",{type:"button",class:"btn btn-sm btn-outline-secondary",role:"tab","data-ge-group":i},Yo(i)));l.addEventListener("click",function(){o(i)})}),o(t.indexOf($t)>=0?$t:t[0]);function o(i){$t=i,fe.forEach(function(l){(l.group===i?l.home:r).appendChild(l.button)}),X(n).forEach(function(l){var c=l.getAttribute("data-ge-group")===i;R(l,"active",c),l.setAttribute("aria-selected",c?"true":"false")}),Jt()}}function Yo(e){var t="group."+e;if(el(s,t))return m(t);var n=fe.filter(function(r){return r.group===e})[0];return n.button.getAttribute("title")||e}function Jo(){return fe.filter(function(e){return!Y(e.button,".ge-toolbar-stash")})}function $o(e){var t=typeof e.toolbar=="function"?e.toolbar():e.toolbar;return Array.isArray(t)?t:[]}function Qo(){if(!(!E||_t)){var e=!!A(E,".gm-preview.active");fn(),cn(),e&&C(A(E,".gm-preview"),"active btn-danger"),gr()}}function fn(){Ct&&Ct.abort(),Ct=null,Yt=function(){},Jt=function(){},E.remove()}function Zo(e){var t=G('<div class="ge-toolbar-more"><button type="button" class="btn btn-sm btn-light"><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=A(t,"button"),r=A(t,".ge-toolbar-overflow"),o=_(r,".btn-group");function i(T){return T===D?o[0]:o[1]}n.setAttribute("title",m("tool.more")),n.setAttribute("aria-haspopup","true"),n.setAttribute("aria-expanded","false");var l=Ct=new AbortController,c={signal:l.signal};if(n.addEventListener("click",function(){h(!b(t,"ge-open"))}),r.addEventListener("click",function(T){Y(T.target,"[data-ge-toolbar]")&&h(!1)}),document.addEventListener("pointerdown",function(T){t.contains(T.target)||h(!1)},c),document.addEventListener("keydown",function(T){T.key==="Escape"&&h(!1)},c),Yt=function(){h(!1)},Jt=x,x(),window.ResizeObserver){var u=!1,g=new window.ResizeObserver(function(){u||(u=!0,window.requestAnimationFrame(function(){u=!1,l.signal.aborted||x()}))});g.observe(w),g.observe(e),l.signal.addEventListener("abort",function(){g.disconnect()})}function h(T){T=T&&b(t,"ge-needed"),R(t,"ge-open",T),n.setAttribute("aria-expanded",T?"true":"false")}function x(){var T=Jo();if(T.forEach(function(So){So.home.appendChild(So.button)}),k(t,"ge-needed"),e.scrollWidth<=e.clientWidth){h(!1);return}C(t,"ge-needed");for(var I=T.length-1;I>=0&&e.scrollWidth>e.clientWidth;I--){var Wt=i(T[I].home);Wt.insertBefore(T[I].button,Wt.firstChild)}}}function ur(e,t,n){return e.setAttribute("title",t),n?(e.appendChild(v("i",{class:n})),e):(e.appendChild(G('<i class="bi bi-plus"></i>')),e.appendChild(v("span",{},t)),e)}function ei(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),i=t.align==="end"?"btn-primary":"btn-light",l=ur(v("a",{class:"btn btn-sm "+i+" ge-add-container ge-add-feature"}),o,r);return C(l,t.className||""),(typeof t.hidden=="function"?t.hidden():t.hidden)&&de(l),Ut(l,{"data-ge-toolbar":"feature","data-ge-feature":e,"data-ge-item":n}),l.addEventListener("click",function(){if(H){hn(l,t.source||"tool");return}var c=t.create();if(c){var u=t.inColumn?mn(c):c,g=ie(t.kind,c,function(){f.appendChild(u)},{parent:f,source:t.source||"tool"});g&&t.inColumn&&u.scrollIntoView&&u.scrollIntoView({behavior:"smooth"})}}),l}function ti(){return s.toolbar_drag==="auto"?s.drag_handle==="drawer":!!s.toolbar_drag}function ni(){var e=_(E,"[data-ge-toolbar]");e.forEach(function(t){k(t,"ge-palette-button"),t.removeEventListener("pointerdown",cr)}),ti()&&e.forEach(function(t){C(t,"ge-palette-button"),t.addEventListener("pointerdown",cr)})}function cr(e){var t=e.currentTarget,n=e.pageX,r=e.pageY,o=null;if(e.button)return;function i(u){return Math.abs(u.pageX-n)+Math.abs(u.pageY-r)>s.drag.threshold}function l(u){if(!o){if(!i(u))return;o=C(t.cloneNode(!0),"ge-toolbar-helper"),document.body.appendChild(o),Yt(),C(f,"ge-dropping")}Le(o,{left:u.pageX-14,top:u.pageY-14}),oi(u.pageX,u.pageY)}function c(u){if(document.removeEventListener("pointermove",l),qn(document,"pointerup pointercancel",c),!!o){o.remove(),k(f,"ge-dropping"),gn();var g=function(x){x.target!==t&&!t.contains(x.target)||(x.preventDefault(),x.stopImmediatePropagation())};window.addEventListener("click",g,{capture:!0,once:!0}),window.setTimeout(function(){window.removeEventListener("click",g,{capture:!0})},0);var h=fr(u.pageX,u.pageY);h&&mr(t,h)}}document.addEventListener("pointermove",l),ue(document,"pointerup pointercancel",c)}function fr(e,t){var n=e-window.scrollX,r=t-window.scrollY,o=document.elementFromPoint(n,r);if(!o)return null;var i=Y(o,[".column",".ge-canvas"].concat(Dt("regions")).join(", "));if(!i||i!==f&&!f.contains(i))return null;var l=null;return X(i,Nn()).forEach(function(c){if(!l){var u=c.getBoundingClientRect();r<u.top+u.height/2&&(l=c)}}),{region:i,before:l}}function ri(e,t,n){var r=(Et[e.getAttribute("data-ge-feature")]||[])[parseInt(e.getAttribute("data-ge-item"),10)];if(!r)return null;var o=r.create();if(!o)return null;var i=o;if(r.inColumn)Te(t.region,".column")||(i=mn(o));else if(!In(t.region,o)){var l=t.region===f?[]:Oo(t.region,f).reverse().concat([t.region]),c=l[0]||null;t={region:f,before:c?c.nextElementSibling:null}}return ie(r.kind,o,function(){t.before?t.before.parentNode.insertBefore(i,t.before):t.region.appendChild(i)},{parent:t.region,source:r.source||n||"dragdrop"})}function mn(e){var t=Ye();return t.appendChild(Se(W)).appendChild(e),t}function oi(e,t){var n=fr(e,t);if(!n)return gn();Ue||(Ue=v("div",{class:"ge-drop-marker"})),n.before?n.before.parentNode.insertBefore(Ue,n.before):n.region.appendChild(Ue)}function gn(){Ue&&Ue.remove()}function mr(e,t,n){if(e.getAttribute("data-ge-toolbar")==="feature")return ri(e,t,n);var r=e.getAttribute("data-ge-toolbar")==="container",o=e.getAttribute("data-ge-container-type"),i=r?O[o].create({}):ai(e.getAttribute("data-ge-layout")),l=i;return r&&!Te(t.region,".column")&&(l=mn(i)),ie(r?o:"row",i,function(){t.before?t.before.parentNode.insertBefore(l,t.before):t.region.appendChild(l)},{parent:t.region,source:n||"dragdrop"})}function ii(){for(var e=[],t=1;t<=W;t++)e.push(String(t));return{name:"col",values:e.concat(Yn),appliesTo:["column"],labelKey:"utility.col_width",className:function(n,r){return He(ee(n),pn(r))},choices:function(){return s.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,i){return dn(n,r===null?null:pn(r),i,o)},blank:function(n,r){var o=r===Z?null:zt(n,ee(r));return o?m("utility.col_from_row",{count:fo(o.value)}):null}}}function pn(e){return/^\d+$/.test(String(e))?parseInt(e,10):e}function ai(e){return/^\s*\{/.test(e||"")?tt(JSON.parse(e)):tt((e||"").split(",").filter(function(t){return t!==""}).map(pn))}function tt(e){var t=Ye();if(Array.isArray(e))return e.forEach(function(r){t.appendChild(Se(r))}),t;Object.keys(e.row_cols||{}).forEach(function(r){var o=e.row_cols[r],i=ee(r);i&&Qe.indexOf(String(o))!==-1&&C(t,Jn(i,o))});for(var n=0;n<(e.columns||0);n++)t.appendChild(Se(null));return t}function li(e){return y.filter(function(t){return e&&e[t.key]!==void 0}).map(function(t){return(t.infix?t.key+": ":"")+e[t.key]}).join(", ")}function si(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 gr(){var e=window.pageYOffset;e>Bt(E).top&&e<Bt(f).top+Lo(f)?b(w,"ge-top")&&(Le(w,{left:Bt(w).left,width:ht(w)}),k(w,"ge-top"),C(w,"ge-fixed")):b(w,"ge-fixed")&&(Le(w,{left:"",width:""}),k(w,"ge-fixed"),C(w,"ge-top"))}function di(){var e=this;if(!e.getAttribute("data-ge-content-type")&&!ve()&&vt(e)){var t=wr();t.length&&(t.length===1?pr(e,t[0]):ui(e,t))}}function pr(e,t){return t.available&&!t.available()?(t.missingKey&&console.error(m(t.missingKey)),!1):Q(function(){var n=re("plain",e,{source:"tool",from:"plain",to:t.type});if(!N("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 b(r,"ge-text-block")&&(k(r,"ge-plain-block"),X(r,".ge-tools-drawer").forEach(function(o){o.remove()})),N("after-convert",n),t.edit(e),!0})}function ui(e,t){var n=b(e.parentElement,"ge-text-block")?e.parentElement:null;n&&vr(P(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(){pr(e,r)}}}),"ge-text-picker ge-convert-picker",n)}function vr(e,t,n,r){if(ve(),!!e){var o=Y(e,".ge-tools-drawer");o&&C(o,"ge-picker-open"),ne=e.appendChild(C(v("div",{class:"ge-size-picker"}),n||"")),t.forEach(function(i){var l=Ut(v("a",{class:"ge-size ge-size-flex"}),i.attributes||{});l.setAttribute("title",i.title||i.label),l.textContent=i.label,l.addEventListener("click",function(c){c.preventDefault(),c.stopPropagation(),ve(),i.choose()}),ne.appendChild(l)}),hr(r||e)}}function hr(e){e.addEventListener("mouseleave",function(){window.setTimeout(function(){ne&&!ne.matches(":hover")&&ve()},400)},{once:!0})}function br(){var e={},t=[];return Object.keys(L).forEach(function(n){var r=L[n];r.textTypes&&(r.textTypes()||[]).forEach(function(o){if(e[o.type]){e[o.type]!==n&&K("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 wr(){return br().filter(function(e){return e.offered!==!1})}function ci(e){return br().some(function(t){return t.type===e})}function yr(){Ne(),ge()}function fi(){Ne(),Re(null),be(null),te.style.height=.8*document.documentElement.clientHeight+"px",te.value=f.innerHTML,Me(te),de(f),ye=!0,ae("onSourceOpen",te)}function vn(){ae("onSourceClose",te),ye=!1,mt(f,te.value),Me(f),ge(),de(te)}function Cr(){return[".column"].concat(Dt("regions")).join(", ")}function mi(e){return!!e&&e!==f&&f.contains(e)&&Te(e,Cr())}function Re(e){if(e!==H){var t=H;t&&k(t,"ge-active-target"),H=e,e&&b(f,"ge-editing")&&C(e,"ge-active-target"),N("target-change",{canvas:f,target:e,from:t})}}function hn(e,t){var n=mr(e,{region:H,before:null},t);n&&n.scrollIntoView&&n.scrollIntoView({behavior:"smooth"})}function ge(){V&&!Oe(V.node)&&ke(),q&&!f.contains(q)&&be(null),le&&le.home&&!Oe(le.home)&&we(),Wn(!0),C(f,"ge-editing"),R(f,"ge-drag-drawer",s.drag_handle==="drawer"),da();var e=za();ja(e),Na(e),Ia(),Vi(),Gi(),Ri(),ae("onInit"),va(),ya(),_o(z),rt(f),H&&!f.contains(H)?Re(null):H&&C(H,"ge-active-target"),ia()}function Ne(){ke(),aa(),k(f,"ge-editing ge-drag-drawer ge-dropping"),H&&k(H,"ge-active-target"),ae("onBeforeDeinit"),ve(),gn(),we(),Er(f),Tt.clear(),xo(f),ae("onDeinit"),St(f),xr(f),Ni(),Ta(),xa(),Wn(!1,f)}function Er(e){_(e,".ge-tools-drawer").forEach(function(t){t.remove()})}function xr(e){_(e,"[data-ge-row-cols]").forEach(function(t){t.removeAttribute("data-ge-row-cols")})}function gi(){var e=[];return[O,L,B].forEach(function(t){Object.keys(t).forEach(function(n){var r=t[n],o=r.unmark||r.onDeinit||r.onBeforeDeinit;o&&!r.cleanMarkup&&e.push(n)})}),e}function pi(){for(var e=f.cloneNode(!0),t=new Map,n=new Map,r=document.createTreeWalker(f,NodeFilter.SHOW_ELEMENT),o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT),i=r.currentNode,l=o.currentNode;i&&l;)t.set(l,i),n.set(i,l),i=r.nextNode(),l=o.nextNode();return{root:e,liveOf:function(c){return t.get(c)||null},copyOf:function(c){return n.get(c)||null}}}function _r(){if(ye)return nt();var e=gi();if(e.length)return e.forEach(function(o){K("snapshot:"+o,'the "'+o+'" plugin has no cleanMarkup, so the canvas leaves editing to be read: open texts and settings panels close')}),nt();var t=pi(),n=t.root;[n].concat(_(n,".ge-active-target, .ge-settings-target")).forEach(function(o){k(o,"ge-active-target ge-settings-target"),gt(o)}),_(n,".ge-drop-marker").forEach(function(o){o.remove()}),Er(n),xo(n);var r=null;return[O,L,B].forEach(function(o){Object.keys(o).forEach(function(i){var l=o[i];r||!l.cleanMarkup||l.cleanMarkup(n,t.liveOf)===!1&&(r=i)})}),r?(K("snapshot-refused:"+r,'the "'+r+'" plugin cannot take its marking off a copy right now, so the canvas leaves editing to be read'),nt()):(St(n),xr(n),_(n,"[data-ge-container]").forEach(Dr),xt.forEach(function(o){var i=t.copyOf(o.el);i&&_(i,"[draggable]").forEach(function(l){l.removeAttribute("draggable")})}),bo(n),Wn(!1,n),Xe(n),n.innerHTML)}function nt(e){if(e&&e.keepEditing)return _r();Ne(),Xe(f);var t=f.innerHTML;return ge(),t}function vi(e){Ne(),Xe(e);var t=e.outerHTML;return ge(),t}function hi(e){return $n(nt(e))}function bi(e){ye&&(vn(),E&&_(E,".gm-edit-mode").forEach(function(t){k(t,"active btn-danger")})),Ne(),mt(f,e),ge()}function wi(){ae("onDestroy"),ye&&vn(),Ne(),H=null,q=null,qt===a&&(qt=null),or(),Jr(),so(),fn(),te.remove(),en.abort(),Xt.delete(f),_t=!0}function yi(){var e=tr=Ci();wn("grid",{},ii()),s.row_cols!==!1&&wn("grid",{},ma());var t=function(r){return!s.plugins||s.plugins.indexOf(r)!==-1},n=function(r,o){return o.always===!0||t(r)};Object.keys(S.containers).forEach(function(r){t(r)&&(O[r]=S.containers[r](e))}),Object.keys(S.features).forEach(function(r){var o=S.features[r];n(r,o)&&(L[r]=o(e))}),Object.keys(S.utilities).forEach(function(r){t(r)&&(B[r]=S.utilities[r](e),(B[r].families||[]).forEach(function(o){wn(r,B[r],o)}))}),Object.keys(L).forEach(function(r){var o=L[r].methods||{};Object.keys(o).forEach(function(i){Ie[i]=o[i]})}),(s.plugins||[]).forEach(function(r){O[r]||L[r]||B[r]||K("plugin:"+r,'the "'+r+'" plugin is not loaded: include dist/plugins/grideditor.'+r+".js after the editor")})}function ae(e,t){[O,L,B].forEach(function(n){Object.keys(n).forEach(function(r){n[r][e]&&n[r][e](t)})})}function Ci(){return{canvas:f,settings:s,t:m,warn:U,containerId:Ir,freshNode:zi,defaultRegion:ji,createTool:F,createMoveTool:Fe,addSettingsTool:st,deleteNode:je,place:Ht,createPaneControls:Di,makeLabelEditable:Fi,labelIn:Hi,unwrapLabels:Wi,suspendToggles:Fr,resumeToggles:Hr,emit:N,payloadFor:re,operate:Q,kindOf:me,view:Bn,viewTiers:function(){return No(z).map(function(e){return e.key})},breakpoints:y.map(function(e){return e.key}),getUtility:Mr,setUtility:En,utilityField:Pi,bareStyle:ki,hostStyle:Pr,setHostStyle:Li,openDialog:lo,closeDialog:we,rowFromLayout:tt,nodeHtml:vi,snapshotHtml:_r,setHtml:bi,confirm:rr,textReady:Go,attachPicker:Ur,openPicker:vr,closePicker:ve,detailsOf:Tn,drawerOf:Ei,refreshToolbar:Qo,toolbarItems:function(e){return E?_(E,'[data-ge-toolbar="feature"][data-ge-feature="'+e+'"]'):[]},getSelected:function(){return he()==="sidebar"?q:null},getActiveTarget:function(){return s.active_target?H:null},panelOpen:function(){return V||le||j&&b(j,"show")?!0:he()==="inline"&&_(f,".ge-tools-drawer > .ge-details").some(vt)},contains:function(e){return!e||e.nodeType!==1?!1:f.contains(e)||E&&E.contains(e)||J&&J.contains(e)||j&&j.contains(e)?!0:Object.keys(M).some(function(t){return M[t].contains(e)})}}}function Ei(e){if(b(e,"ge-content")){var t=e.parentElement;return b(t,"ge-text-block")?P(t,".ge-tools-drawer"):null}return P(e,".ge-tools-drawer")}var Ee={},xi=".row, .column, .ge-content, .ge-element, [data-ge-container]",Ve="data-ge-preview",bn=!1;function wn(e,t,n){var r=n.name||n.prefix;if(Ee[r]){U('the "'+e+'" plugin declares the utility "'+r+'", which the "'+Ee[r].plugin+'" plugin already declared: ignored');return}Ee[r]={plugin:e,family:Object.assign({},n,{name:r,values:n.values.map(String),appliesTo:n.appliesTo||t.appliesTo||["row","column"]})}}function At(e,t){return Ee[e]?Ee[e].family:(K("utility:"+e,t+"("+JSON.stringify(e)+"): no loaded plugin declares that utility"),null)}function kr(e,t){return t==="plain"&&(t="text"),e.appliesTo.indexOf(t)!==-1?!0:!!O[t]&&e.appliesTo.indexOf("container")!==-1}function Ar(e){return Object.keys(Ee).map(function(t){return Ee[t].family}).filter(function(t){return kr(t,e)})}function yn(e,t,n){return e.className?e.className(t.key,n):e.prefix+(t.infix?"-"+t.infix:"")+"-"+n}function xe(e,t,n){for(var r=(e.getAttribute("class")||"").split(/\s+/),o=0;o<t.values.length;o++)if(r.indexOf(yn(t,n,t.values[o]))!==-1)return t.values[o];return null}function Sr(e,t,n){for(var r=y.indexOf(n)-1;r>=0;r--){var o=xe(e,t,y[r]);if(o!==null)return{tier:y[r],value:o}}return null}function Tr(e,t,n){var r=xe(e,t,n);if(r!==null)return r;var o=Sr(e,t,n);return o?o.value:null}function Cn(e,t){return y.map(function(n){return{tier:n,value:xe(e,t,n)}}).filter(function(n){return n.value!==null})}function Or(e,t,n,r){t.values.forEach(function(o){k(e,yn(t,n,o))}),r!==null&&C(e,yn(t,n,r)),gt(e)}function Lr(e,t,n){return n===Z?xe(e,t,y[0]):Tr(e,t,ee(n))}function _i(e,t,n,r){if(n!==Z){var o=ee(n);return xe(e,t,o)===r?null:{writes:[{tier:o,value:r}],cleared:[]}}var i=[],l=[];return Cn(e,t).forEach(function(c){c.tier!==y[0]&&(i.push({tier:c.tier,value:null}),l.push({breakpoint:c.tier.key,value:c.value}))}),xe(e,t,y[0])!==r&&i.unshift({tier:y[0],value:r}),i.length?{writes:i,cleared:l}:null}function Mr(e,t,n){e=oe(e);var r=At(t,"getUtility");if(!r||!e)return null;var o=n===void 0?z:Kn(n);return o===null?(U("getUtility("+JSON.stringify(n)+"): no such layout mode"),null):Lr(e,r,o)}function En(e,t,n,r){r=typeof r=="string"?{view:r}:r||{},e=oe(e);var o=At(t,"setUtility");if(!o||!e)return!1;var i=r.view===void 0?z:Kn(r.view);if(i===null)return U("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 U("setUtility: "+JSON.stringify(n)+' is not a value of "'+t+'", which takes '+JSON.stringify(o.values)),!1;var l=me(e);if(!kr(o,l))return U('setUtility: "'+t+'" does not apply to a '+l),!1;if(o.write)return o.write(e,n,i,r.source||"api");var c=_i(e,o,i,n);return c?Q(function(){var u=re(l,e,{family:t,breakpoint:i,tiers:c.writes.map(function(g){return g.tier.key}),from:Lr(e,o,i),to:n,cleared:c.cleared,source:r.source||"api"});return N("before-utility",u)?(c.writes.forEach(function(g){Or(e,o,g.tier,g.value)}),pe(e),N("after-utility",u),!0):(pe(e),!1)}):!1}function ki(e,t,n){var r=At(t,"bareStyle");if(e=oe(e),!r||!e)return null;var o=e.getAttribute("class");y.forEach(function(l){Or(e,r,l,null)});var i=getComputedStyle(e).getPropertyValue(n);return o===null?e.removeAttribute("class"):e.setAttribute("class",o),i}function pe(e){var t=Tn(e);if(t){var n=A(t,".ge-classes");n&&(n.value=Sn(e).join(" ")),X(t,".ge-utilities").forEach(function(r){xn(r)})}jr(e),rt(e)}function Ai(e){return se(e,xi)}function rt(e){St(e),z!==Z&&Si(e,ee(z)),fa(e),ae("onRefresh",e)}function Si(e,t){Ai(e).forEach(function(n){var r=me(n),o={};Ar(r).forEach(function(i){!i.preview||!Cn(n,i).length||Object.assign(o,i.preview(Tr(n,i,t),n,r))}),r==="column"&&Object.assign(o,ca(n,t)),Object.keys(B).forEach(function(i){var l=B[i];l.preview&&Object.assign(o,l.preview(n,r,t.key))}),Object.keys(o).length&&Ti(n,o)})}function Ti(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(Ve,JSON.stringify(r))}function St(e){se(e,"["+Ve+"]").forEach(function(t){var n=t.style,r={};try{r=JSON.parse(t.getAttribute(Ve))||{}}catch(o){}Object.keys(r).forEach(function(o){var i=r[o];i&&i[0]?n.setProperty(o,i[0],i[1]):n.removeProperty(o)}),t.removeAttribute(Ve),pt(t)})}function Oi(e){var t=document.createElement("div"),n={};t.style.cssText=e.style.cssText;try{n=JSON.parse(e.getAttribute(Ve))||{}}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 Pr(e,t){var n=Oi(e);return t===void 0?n.cssText:{value:n.getPropertyValue(t),priority:n.getPropertyPriority(t)}}function Li(e,t,n,r){if(n=n==null?"":String(n).trim(),r===void 0&&(r=Pr(e,t).priority),n!==""){var o=document.createElement("div").style;if(o.setProperty(t,n,r||""),o.getPropertyValue(t)==="")return!1}var i=e.hasAttribute(Ve);return i&&St(e),n===""?e.style.removeProperty(t):e.style.setProperty(t,n,r||""),pt(e),i&&rt(e),!0}function Mi(e){var t=me(e),n=Ar(t).filter(function(l){return l.panel!==!1}).map(function(l){return zr(e,l)});if(Object.keys(B).forEach(function(l){var c=B[l],u=c.panel?c.panel(e,t):null;u&&n.push(u)}),!n.length)return null;var r=R(v("div",{class:"ge-utilities"}),"ge-open",bn);nr.set(r,e);var o=r.appendChild(v("a",{class:"ge-utilities-toggle"}));o.addEventListener("click",function(){bn=!b(r,"ge-open"),qr().forEach(function(l){_(l,".ge-utilities").forEach(function(c){R(c,"ge-open",bn)})})});var i=r.appendChild(v("div",{class:"ge-utilities-body"}));return n.forEach(function(l){i.appendChild(l)}),xn(r),r}function zr(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(){En(e,t.name,this.value,{source:"panel"})}),n.appendChild(v("small",{class:"ge-utility-note"})),n}function Pi(e,t){var n=At(t,"utilityField");if(!n)return null;var r=zr(e,n);return _n(r,e),Tt.set(r,e),r}var Tt=new Map;function jr(e){Tt.forEach(function(t,n){if(!n.isConnected){Tt.delete(n);return}e&&t!==e||Y(n,".ge-utilities")||_n(n,t)})}function xn(e){var t=nr.get(e);X(e,".ge-utilities-toggle").forEach(function(n){n.textContent=m("utility.section",{view:m(wt(z))})}),_(e,".ge-utility").forEach(function(n){_n(n,t)})}function _n(e,t){var n=Ee[e.getAttribute("data-ge-family")].family,r=P(e,"select"),o=n.choices?n.choices(t,me(t)):n.values,i,l,c="";if(r.innerHTML="",z===Z){i=xe(t,n,y[0]),l=m("utility.default");var u=Cn(t,n).filter(function(I){return I.tier!==y[0]});u.length&&(c=m("utility.varies",{breakpoints:u.map(function(I){return I.tier.key}).join(", ")}))}else{var g=ee(z),h=Sr(t,n,g);i=xe(t,n,g),l=h?m("utility.inherit",{value:Rr(n,h.value),breakpoint:h.tier.key}):m("utility.default");var x=n.blank?n.blank(t,z):null;x&&i===null&&(l=x)}i!==null&&o.indexOf(i)===-1&&(o=o.concat([i])),r.appendChild(v("option",{value:""},l)),o.forEach(function(I){r.appendChild(v("option",{value:I},Rr(n,I)))}),r.value=i===null?"":i;var T=P(e,".ge-utility-note");T.textContent=c,Gn(T,c!=="")}function Rr(e,t){return e.label?e.label(t):t}var O={},L={},B={},Ie={},Nr=0;function Ir(e){return Nr++,"ge-"+e+"-"+Nr+"-"+Math.random().toString(36).slice(2,6)}function zi(e){var t=G(e),n={},r=function(o){return!!document.getElementById(o)||Object.keys(n).some(function(i){return n[i]===o})};return se(t,"[id]").forEach(function(o){var i=o.id;if(document.getElementById(i)){var l=Ja.exec(i),c;if(l)do c=Ir(l[1]);while(r(c));else{for(var u=2;r(i+"-"+u);)u++;c=i+"-"+u}n[i]=c,o.id=c}}),Object.keys(n).length&&se(t,"*").forEach(function(o){Ya.forEach(function(i){var l=o.getAttribute(i);if(l!==null&&!(i==="href"&&l.charAt(0)!=="#")){var c=l.split(/(\s+)/).map(function(u){return n[u]?n[u]:u.charAt(0)==="#"&&n[u.slice(1)]?"#"+n[u.slice(1)]:u}).join("");c!==l&&o.setAttribute(i,c)}})}),t}function ji(){var e=Ye();return e.appendChild(Se(W)),e}function De(e){return e?e.getAttribute("data-ge-container"):null}function Ri(){_(f,"[data-ge-container]").forEach(function(e){var t=De(e),n=O[t];if(!n){K("container:"+t,'unknown container type "'+t+'"');return}C(e,"ge-container ge-container-"+t),n.mark(e),P(e,".ge-tools-drawer")||Ii(e,t,n)})}function Ni(){_(f,"[data-ge-container]").forEach(function(e){var t=O[De(e)];t&&t.unmark(e),Dr(e)})}function Dr(e){k(e,"ge-container ge-container-"+De(e)),gt(e)}function Ge(e,t){var n=v("div",{class:t});return e.insertBefore(n,e.firstChild),n}function Ot(e,t){(t||[]).forEach(function(n){F(e,n.title||"",n.className||"",n.iconClass||"bi bi-wrench",n.on)})}function Ii(e,t,n){var r=Ge(e,"ge-tools-drawer ge-container-drawer");Fe(r),st(r,e,s.container_classes),Ot(r,s.container_tools),n.tools&&n.tools(r,e),F(r,m("tool.delete_container"),"ge-delete-container","bi bi-trash",function(){je(t,e,m("confirm.delete_container"),function(o){bt(e,o)})}),n.addPane&&F(r,m(n.addPaneKey),"ge-add-pane","bi bi-plus-circle",function(){var o=n.addPane(e,{});o&&ie(n.paneKind,o,function(){},{parent:e,source:"tool",container:e})})}function Di(e,t,n,r,o){var i=Ge(e,"ge-tools-drawer ge-pane-drawer");return Fe(i),st(i,e,s.pane_classes),Ot(i,n),F(i,m("tool.delete_pane"),"ge-delete-pane","bi bi-trash",function(){je(t,e,r,function(l){o(l)})}),i}var Lt=["toggle","dismiss","slide","slide-to","ride"];function Fr(e){e&&se(e,Lt.map(function(t){return"[data-bs-"+t+"]"}).join(", ")).forEach(function(t){Lt.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 Hr(e){e&&se(e,Lt.map(function(t){return"[data-ge-bs-"+t+"]"}).join(", ")).forEach(function(t){Lt.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 Fi(e){if(!Zt.has(e)){var t=Y(e,"[data-bs-toggle], [data-ge-bs-toggle]");Zt.add(e),e.setAttribute("title",m("tool.rename")),e.addEventListener("dblclick",function(n){n.preventDefault(),n.stopPropagation(),Fr(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"),Hr(t)})}}function Hi(e){var t=P(e,".ge-pane-label");return t||(t=v("span",{class:"ge-pane-label"},e.textContent.trim()),e.innerHTML="",e.appendChild(t)),t}function Wi(e){_(e,".ge-pane-label").forEach(function(t){Zt.delete(t),Gt(t)})}function Wr(e,t){var n=Se(t);return ie("column",n,function(){e.appendChild(n)},{parent:e,source:"tool"})}function Ui(e,t){!s.add_column.picker||!e||Ur(e,function(){Ki(e,t)})}function Ur(e,t){var n=null,r=function(){window.clearTimeout(n),n=null};ue(e,"mouseenter mousedown",function(){n||ne||(n=window.setTimeout(function(){n=null,t()},s.add_column.delay))}),ue(e,"mouseleave mouseup",r)}function Ki(e,t){ve();var n=Rn(t,_e()),r=Y(e,".ge-tools-drawer");r&&C(r,"ge-picker-open"),ne=e.appendChild(v("div",{class:"ge-size-picker"})),s.valid_col_sizes.forEach(function(o){var i=v("a",{class:"ge-size","data-ge-size":o,title:Bi(o)},$(o)?o:He(y[0],o));R(i,"ge-size-tight",$(o)&&o>n),R(i,"ge-size-flex",!$(o)),i.addEventListener("click",function(l){l.preventDefault(),l.stopPropagation(),ve(),Wr(t,o)}),ne.appendChild(i)}),hr(e)}function Bi(e){return e==="equal"?m("tool.column_equal"):e==="auto"?m("tool.column_auto"):m("tool.column_size",{size:e})}function ve(){if(!ne)return!1;var e=Y(ne,".ge-tools-drawer");return e&&k(e,"ge-picker-open"),ne.remove(),ne=null,!0}function Vi(){_(f,".row").forEach(function(e){if(!P(e,".ge-tools-drawer")){var t=Ge(e,"ge-tools-drawer");Fe(t),st(t,e,s.row_classes),Ot(t,s.row_tools),F(t,m("tool.delete_row"),"ge-delete-row","bi bi-trash",function(){je("row",e,m("confirm.delete_row"),function(n){bt(e,n)})}),F(t,m("tool.add_column"),"ge-add-column","bi bi-plus-circle",function(){ve()||Wr(e,ct(e,_e())?null:s.add_column.size)}),Ui(P(t,".ge-add-column"),e)}})}function Gi(){_(f,".column").forEach(function(e){if(!P(e,".ge-tools-drawer")){var t=Ge(e,"ge-tools-drawer");Fe(t),s.resize.tools!==!1&&(F(t,m("tool.column_narrower"),"ge-decrease-col-width","bi bi-dash-lg",function(n){dn(e,n.shiftKey?lt(s.valid_col_sizes):Mt(s.valid_col_sizes.filter($),it(e),-1),"tool")}),F(t,m("tool.column_wider"),"ge-increase-col-width","bi bi-plus-lg",function(n){dn(e,n.shiftKey?qi(e):Mt(s.valid_col_sizes.filter($),it(e),1),"tool")})),s.indent.tools!==!1&&(F(t,m("tool.indent_decrease"),"ge-decrease-col-offset","bi bi-text-indent-right",function(n){ar(e,n.shiftKey?lt(s.valid_col_offsets):Mt(s.valid_col_offsets,at(e),-1),"tool")}),F(t,m("tool.indent_increase"),"ge-increase-col-offset","bi bi-text-indent-left",function(n){ar(e,n.shiftKey?Xi(e):Mt(s.valid_col_offsets,at(e),1),"tool")})),st(t,e,s.col_classes),Ot(t,s.col_tools),F(t,m("tool.delete_column"),"ge-delete-column","bi bi-trash",function(){je("column",e,m("confirm.delete_column"),function(n){zo(e,400,n,!0)})}),F(t,m("tool.add_row"),"ge-add-row","bi bi-plus-circle",function(){var n=Ye();ie("row",n,function(){e.appendChild(n)},{parent:e,source:"tool"})})}})}function _e(){return z===Z?y[y.length-1]:ee(z)}function ot(e){var t=_e();if(zt(e,t))return null;var n=zn(e,t);return n===null?W:n}function it(e){var t=ot(e);if($(t))return t;var n=Math.round(ht(e)/Kr(e.parentElement)*W);return Math.min(Math.max(n,1),W)}function Kr(e){var t=window.getComputedStyle(e);return e.clientWidth-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight)}function at(e){return Rt(e,_e())||0}function Mt(e,t,n){var r=e.indexOf(t);return r===-1?e.reduce(function(o,i){return Math.abs(i-t)<Math.abs(o-t)?i:o},e[0]):e[Math.min(Math.max(r+n,0),e.length-1)]}function lt(e){return e.filter($).reduce(function(t,n){return Math.min(t,n)},W)}function kn(e){return e.filter($).reduce(function(t,n){return Math.max(t,n)},0)}function qi(e){var t=Rn(e.parentElement,_e(),e)-at(e);return Math.min(kn(s.valid_col_sizes),Math.max(t,1))}function Xi(e){var t=Rn(e.parentElement,_e(),e)-it(e);return Math.min(kn(s.valid_col_offsets),Math.max(t,0))}function Fe(e){return s.drag_handle==="drawer"?null:F(e,m("tool.move"),"ge-move","bi bi-arrows-move")}var An=".ge-tools-drawer:not(.ge-text-drawer):not(.ge-pane-drawer):not(.ge-code-inline)";function Yi(){if(s.drawer_overflow==="wrap"||!window.ResizeObserver||!window.MutationObserver)return;var e=new Set,t=null;function n(l){e.add(l),t===null&&(t=window.requestAnimationFrame(r))}function r(){t=null;var l=Array.from(e);e.clear(),l.forEach(function(c){if(!c.isConnected){o.unobserve(c);return}Ji(c)})}var o=new window.ResizeObserver(function(l){l.forEach(function(c){n(c.target)})}),i=new window.MutationObserver(function(l){l.forEach(function(c){var u=c.target;if(c.type==="attributes"){var g=u.parentNode;g&&g.nodeType===1&&g.matches(An)&&n(g);return}if(u.nodeType===1&&u.matches(An)){n(u);return}c.addedNodes.forEach(function(h){h.nodeType===1&&se(h,An).forEach(function(x){C(x,"ge-drawer-fit"),o.observe(x),n(x)})})})});i.observe(f,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]}),en.signal.addEventListener("abort",function(){i.disconnect(),o.disconnect(),t!==null&&window.cancelAnimationFrame(t)})}function Ji(e){var t=X(e,"a").filter(function(o){return!b(o,"ge-drawer-more")}),n=b(e,"ge-drawer-expanded");if(k(e,"ge-drawer-overflow ge-drawer-expanded"),t.forEach(function(o){k(o,"ge-tool-overflow")}),!!Br(e,t)){C(e,"ge-drawer-overflow"),P(e,".ge-drawer-more")||F(e,m("tool.more"),"ge-drawer-more","bi bi-three-dots",function(){R(e,"ge-drawer-expanded")});for(var r=t.length-1;r>=0&&Br(e,t);r--)C(t[r],"ge-tool-overflow");R(e,"ge-drawer-expanded",n)}}function Br(e,t){var n=window.getComputedStyle(e),r=e.getBoundingClientRect().right-parseFloat(n.borderRightWidth)-parseFloat(n.paddingRight);return t.some(function(o){var i=o.getClientRects();return i.length>0&&i[0].right>r+.5})}function F(e,t,n,r,o){var i=v("a",{title:t,class:n});return i.appendChild(v("i",{class:r})),e.appendChild(i),typeof o=="function"&&i.addEventListener("click",o),o&&typeof o=="object"&&Object.keys(o).forEach(function(l){ue(i,l,o[l])}),i}function Sn(e){return(e.getAttribute("class")||"").split(/\s+/).filter(function(t){return t!==""&&!$i(t)})}function $i(e){return e==="row"||e==="column"||/^(ge-|ui-)/.test(e)||/^col(-(sm|md|lg|xl|xxl))?(-auto)?$/.test(e)?!0:y.some(function(t){return new RegExp("^("+t.colPrefix+"|"+t.offsetPrefix+")\\d+$").test(e)})}function Qi(e,t){Sn(e).forEach(function(n){k(e,n)}),t.split(/\s+/).forEach(function(n){n!==""&&C(e,n)}),gt(e)}function st(e,t,n){var r=Zi(t,n||[]);Be.set(t,r),he()!=="sidebar"&&F(e,m("tool.settings"),"ge-settings","bi bi-gear-fill",function(){ta(t,r,this)});var o=me(t);return Object.keys(B).forEach(function(i){B[i].drawerTools&&B[i].drawerTools(e,t,o)}),Object.keys(L).forEach(function(i){L[i].drawerTools&&L[i].drawerTools(e,t,o)}),e.appendChild(r)}function Zi(e,t){var n=v("div",{class:"ge-details"});n.appendChild(Vr(m("panel.section_general")));var r=n.appendChild(v("div",{class:"ge-details-general"})),o=function(g){var h=v("label",{class:"ge-field"});return h.appendChild(v("span",{class:"ge-field-label"},g)),r.appendChild(h)},i=v("input",{class:"ge-id form-control form-control-sm",placeholder:m("tool.id_placeholder"),title:m("tool.id_title")});i.value=e.getAttribute("id")||"",o(m("panel.id")).appendChild(i),i.addEventListener("change",function(){this.value===""?e.removeAttribute("id"):e.setAttribute("id",this.value)});var l=v("input",{class:"ge-classes form-control form-control-sm",placeholder:m("tool.classes_placeholder"),title:m("tool.classes_title")});l.value=Sn(e).join(" "),o(m("panel.classes")).appendChild(l),l.addEventListener("change",function(){Qi(e,this.value),pe(e)});var c=r.appendChild(v("div",{class:"btn-group btn-group-sm ge-presets",role:"group"}));t.forEach(function(g){var h=b(e,g.cssClass),x=v("a",{role:"button",class:"btn btn-sm btn-outline-secondary",title:g.title?g.title:m("tool.toggle_class",{label:g.label}),"aria-pressed":h?"true":"false"});x.innerHTML=g.label,R(x,"active",h),x.addEventListener("click",function(){R(x,"active"),x.setAttribute("aria-pressed",b(x,"active")?"true":"false"),R(e,g.cssClass,b(x,"active")),pe(e)}),c.appendChild(x)}),ea(e).forEach(function(g){n.appendChild(g)});var u=Mi(e);return u&&n.appendChild(u),n}function Vr(e){return v("h6",{class:"ge-section-title"},e)}function ea(e){var t=me(e),n=he(),r=[];return[O,L,B].forEach(function(o){Object.keys(o).forEach(function(i){var l=o[i],c=l.panelSection?l.panelSection(e,t):null;if(!(!c||!c.body)){var u=v("div",{class:"ge-panel-section","data-ge-plugin":i});if(n==="offcanvas"||n==="modal"||n==="sidebar")u.appendChild(Vr(m(c.labelKey))),u.appendChild(c.body);else{var g=m(c.labelKey),h=u.appendChild(v("button",{type:"button",class:"btn btn-sm btn-outline-secondary ge-panel-section-open"},g));de(c.body),u.appendChild(c.body),h.addEventListener("click",function(){lo(c.titleKey?m(c.titleKey,{kind:Pn(e)}):g,c.body,h)})}r.push(u)}})}),r}var Gr=["offcanvas","popover","modal","inline","sidebar"],M={},V=null,Pt=new WeakMap;function he(){return Gr.indexOf(s.settings_panel)!==-1?s.settings_panel:(K("settings_panel",'settings_panel "'+s.settings_panel+'" is not one of '+Gr.join(", ")+": using offcanvas"),"offcanvas")}function Tn(e){return e&&Be.get(e)||null}function qr(){var e=[f];return V&&V.mode!=="inline"&&e.push(V.details),Ae&&e.push(Ae.details),e}function ta(e,t,n){var r=he();if(r==="inline"){Gn(t);return}var o=V&&V.details===t;ke(),o||na(r,e,t,n)}function na(e,t,n,r){var o=Yr(e),i=new AbortController;V={mode:e,node:t,details:n,home:n.parentElement,next:n.nextElementSibling,gear:r,listening:i},A(o,".ge-settings-title").textContent=m("panel.title",{kind:Pn(t)}),A(o,".ge-settings-body").appendChild(n),Me(n),C(t,"ge-settings-target");var l={signal:i.signal};if(document.addEventListener("keydown",function(u){u.key==="Escape"&&!le&&ke()},l),e==="offcanvas"){var c=window.innerWidth<576;R(o,"offcanvas-end",!c),R(o,"offcanvas-bottom",c),k(o,"hiding"),o.getBoundingClientRect(),C(o,"show")}else e==="popover"?(On(o,r),ue(window,"scroll resize",function(){On(o,r)},l),window.ResizeObserver&&(V.observer=new window.ResizeObserver(function(){On(o,r)}),V.observer.observe(n)),ue(document,"mousedown touchstart",function(u){!le&&!o.contains(u.target)&&!r.contains(u.target)&&ke()},l)):Ln(o,function(){V&&V.mode==="modal"&&ke()})}function ke(){we();var e=V;if(e){V=null;var t=M[e.mode];e.listening.abort(),e.observer&&e.observer.disconnect(),e.mode==="offcanvas"?(k(t,"show"),C(t,"hiding"),window.setTimeout(function(){k(t,"hiding")},300)):e.mode==="popover"?de(t):Mn(t),Xr(e)}}function Xr(e){k(e.node,"ge-settings-target"),e.details.style.removeProperty("display"),pt(e.details),e.home&&Oe(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 Yr(e){if(M[e])return M[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=G('<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>'),A(n,".offcanvas-header").appendChild(t())):e==="popover"?(n=G('<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>'),A(n,".popover-header").appendChild(t()),de(n)):e==="sidebar"?(n=G('<div class="offcanvas offcanvas-end ge-settings-panel ge-settings-sidebar" tabindex="-1" role="complementary"><div class="offcanvas-header"><h5 class="offcanvas-title ge-settings-title"></h5></div><div class="offcanvas-body ge-settings-body"></div></div>'),n.id="ge-settings-sidebar-"+er,A(n,".offcanvas-header").appendChild(t()),M["sidebar-toggle"]=document.body.appendChild(ra(n))):(n=G('<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>'),A(n,".modal-header").appendChild(t()),A(n,".modal-footer").appendChild(v("button",{type:"button",class:"btn btn-primary ge-settings-close"},m("panel.done")))),$e(n,"click",".ge-settings-close",function(r){r.preventDefault(),e==="sidebar"?be(null):ke()}),M[e]=document.body.appendChild(n),n}function Jr(){ke(),no(),k(document.documentElement,"ge-sidebar-open"),Object.keys(M).forEach(function(e){e==="modal"?rn(M[e]):M[e].remove()}),Object.keys(M).forEach(function(e){ao(M[e])}),M={}}var $r=576,Ae=null,dt=null;function ut(){return b(f,"ge-editing")}function ra(e){var t=v("button",{type:"button",class:"ge-sidebar-toggle","aria-controls":e.id});return t.appendChild(v("i")),t.addEventListener("click",function(){oa(!Ke)}),t}function oa(e){Ke=e,Qr()}function Qr(){var e=M.sidebar,t=M["sidebar-toggle"];if(e){var n=!Ke;n&&!b(e,"show")?(k(e,"hiding"),e.getBoundingClientRect(),C(e,"show")):!n&&b(e,"show")&&(k(e,"show"),C(e,"hiding"),window.setTimeout(function(){k(e,"hiding")},300));var r=m(n?"panel.collapse":"panel.expand");t.setAttribute("aria-expanded",n?"true":"false"),t.setAttribute("aria-label",r),t.setAttribute("title",r),A(t,"i").className="bi "+(n?"bi-chevron-right":"bi-chevron-left"),Zr()}}function Zr(){R(document.documentElement,"ge-sidebar-open",!!M.sidebar&&ut()&&!Ke&&window.innerWidth>=$r)}function ia(){if(he()==="sidebar"){var e=Yr("sidebar");Ke===null&&(Ke=window.innerWidth<$r),e.style.removeProperty("display"),M["sidebar-toggle"].style.removeProperty("display"),ro(),Qr()}}function aa(){to();var e=M.sidebar;e&&(e.style.display="none",M["sidebar-toggle"].style.display="none",k(document.documentElement,"ge-sidebar-open"))}function eo(e){var t=M.sidebar;A(t,".ge-settings-title").textContent=e,t.setAttribute("aria-label",e)}function to(){var e=Ae;Ae=null,e&&Xr(e)}function no(){to(),dt&&(dt.body.remove(),dt=null)}function ro(){var e=M.sidebar;if(!(!e||!ut())){var t=q?Tn(q):null;if(!(t?Ae&&Ae.details===t:!Ae&&dt)){no();var n=A(e,".ge-settings-body");if(!t){var r=la(),o=r?r.body:v("p",{class:"ge-sidebar-empty"},m("panel.sidebar_empty"));eo(r?r.title:m("panel.sidebar_title")),n.appendChild(o),dt={body:o};return}Ae={node:q,details:t,home:t.parentElement,next:t.nextElementSibling},eo(m("panel.title",{kind:Pn(q)})),n.appendChild(t),Me(t),C(q,"ge-settings-target")}}}function la(){var e=s.sidebar.empty,t=null;return typeof e=="function"?t=oo(e(a),function(n){return n.title}):e!=null&&K("sidebar.empty","sidebar.empty is a function(ge) returning { title, body }, not "+typeof e+": ignored"),[O,L,B].forEach(function(n){Object.keys(n).forEach(function(r){var o=n[r];t||!o.sidebarEmpty||(t=oo(o.sidebarEmpty(tr),function(i){return typeof i.titleKey=="string"&&i.titleKey!==""?m(i.titleKey):""}))})}),t}function oo(e,t){if(!e||!e.body||e.body.nodeType!==1)return null;var n=t(e);return{title:typeof n=="string"&&n!==""?n:m("panel.sidebar_title"),body:e.body}}function io(e){var t=Y(e,".ge-tools-drawer",f);if(t){var n=t.parentElement,r=Be.has(n)?n:X(n).filter(function(i){return Be.has(i)})[0];if(r)return r}for(var o=e;o&&o!==f;o=o.parentElement)if(Be.has(o))return o;return null}function be(e){if(e!==q){var t=q;q=e,ro(),N("selection-change",{canvas:f,node:e,from:t})}}function On(e,t){if(Oe(t)){Me(e);var n=t.getBoundingClientRect(),r=8,o=P(e,".popover-body");o.style.removeProperty("max-height");var i=ht(e),l=Kt(e),c=window.innerHeight-n.bottom-2*r,u=n.top-2*r,g=l<=c||c>=u,h=g?c:u;l>h&&(Le(o,{"max-height":Math.max(120,h-(l-Kt(o)))}),l=Kt(e));var x=g?n.bottom+r:n.top-r-l,T=Math.max(r,Math.min(n.left+n.width/2-24,window.innerWidth-i-r));R(e,"bs-popover-bottom",g),R(e,"bs-popover-top",!g),Le(e,{top:x+window.pageYOffset,left:T+window.pageXOffset}),Le(P(e,".popover-arrow"),{left:Math.max(r,Math.min(n.left+n.width/2-T-8,i-24))})}}function Ln(e,t){var n=yt(),r=Pt.get(e);if(r||(r={wanted:null,busy:!1,backdrop:null,dismissed:t},Pt.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,ir(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"&&Mn(e)}),e.addEventListener("hidden.bs.modal",function(){r.busy=!1,r.wanted==="open"?Ln(e,r.dismissed):r.dismissed()})),r.wanted="open",r.busy||(r.busy=!0,o.show())}function Mn(e){var t=yt(),n=Pt.get(e);if(n){if(n.wanted="closed",!t){n.backdrop&&(n.backdrop.remove(),n.backdrop=null),k(e,"show"),e.style.removeProperty("display"),e.setAttribute("aria-hidden","true");return}!n.busy&&b(e,"show")&&(n.busy=!0,t.getOrCreateInstance(e).hide())}}function ao(e){var t=Pt.get(e);t&&t.backdrop&&(t.backdrop.remove(),t.backdrop=null)}var J=null,le=null;function sa(){return J||(J=G('<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>'),A(J,".modal-header").appendChild(v("button",{type:"button",class:"btn-close ge-dialog-close","aria-label":m("panel.close")})),A(J,".modal-footer").appendChild(v("button",{type:"button",class:"btn btn-primary ge-dialog-close"},m("panel.done"))),$e(J,"click",".ge-dialog-close",function(e){e.preventDefault(),we()}),document.body.appendChild(J))}function lo(e,t,n){we();var r=sa(),o=new AbortController;le={body:t,home:t.parentElement,next:t.nextElementSibling,opener:n||document.activeElement,listening:o},A(r,".ge-dialog-title").textContent=e,A(r,".ge-dialog-body").appendChild(t),Me(t),yt()||document.addEventListener("keydown",function(i){i.key==="Escape"&&we()},{signal:o.signal}),Object.keys(M).forEach(function(i){C(M[i],"ge-under-dialog")}),Ln(r,function(){we()})}function we(){var e=le;e&&(le=null,e.listening.abort(),Mn(J),Object.keys(M).forEach(function(t){k(M[t],"ge-under-dialog")}),de(e.body),e.home&&Oe(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&&Oe(e.opener)&&e.opener.focus&&e.opener.focus())}function so(){we(),J&&(ao(J),rn(J),J=null)}function Pn(e){var t=me(e);if(O[t]&&O[t].labelKey)return m(O[t].labelKey);var n=Object.keys(O).filter(function(r){return O[r].paneKind===t&&O[r].paneLabelKey})[0];if(n)return m(O[n].paneLabelKey);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 da(){_(f,'.column, div[class*="col-"], div.col').forEach(function(e){C(e,"column"),!(ga(e).length||uo(e.parentElement))&&Nt(e,y[0],W)})}function uo(e){return b(e,"row")&&y.some(function(t){return Qe.some(function(n){return b(e,Jn(t,n))})})}function ct(e,t){if(!b(e,"row"))return null;for(var n=y.indexOf(t);n>=0;n--)for(var r=0;r<Qe.length;r++)if(b(e,Jn(y[n],Qe[r])))return{tier:n,value:Qe[r]};return null}function co(e,t){for(var n=y.indexOf(t);n>=0;n--){var r=qe(e,y[n]);if(r!==null)return{tier:n,size:r}}return null}function zt(e,t){var n=ct(e.parentElement,t);if(!n)return null;var r=co(e,t);return!r||n.tier>r.tier||n.tier===r.tier&&r.size==="equal"?n:null}function ua(e){return e.value==="auto"?0:W/parseInt(e.value,10)}function ca(e,t){var n=zt(e,t);return n?{flex:"0 0 auto",width:n.value==="auto"?"auto":100/parseInt(n.value,10)+"%","max-width":"100%"}:uo(e.parentElement)&&!co(e,t)?{flex:"0 0 auto",width:"100%","max-width":"100%"}:{}}function fa(e){se(e,".row").forEach(function(t){var n=s.row_cols===!1?null:z===Z?ct(t,y[0])||null:ct(t,ee(z));n?t.setAttribute("data-ge-row-cols",fo(n.value)):t.removeAttribute("data-ge-row-cols")})}function fo(e){return e==="auto"?m("badge.row_cols_auto"):m("badge.row_cols",{count:e})}function ma(){return{name:"row-cols",prefix:"row-cols",values:Qe,appliesTo:["row"],labelKey:"utility.row_cols"}}function qe(e,t){var n=go(e,t.colPrefix);return n!==null?n:b(e,He(t,"auto"))?"auto":b(e,He(t,"equal"))?"equal":null}function jt(e,t){return go(e,t.offsetPrefix)}function zn(e,t){return mo(e,t,qe)}function Rt(e,t){return mo(e,t,jt)}function mo(e,t,n){for(var r=y.indexOf(t);r>=0;r--){var o=n(e,y[r]);if(o!==null)return o}return null}function go(e,t){var n=new RegExp("(?:^|\\s)"+t+"(\\d+)(?:\\s|$)").exec(e.getAttribute("class")||"");return n?parseInt(n[1],10):null}function po(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 Nt(e,t,n){po(e,t.colPrefix,null),Yn.forEach(function(r){k(e,He(t,r))}),n!=null&&C(e,He(t,n))}function jn(e,t,n){po(e,t.offsetPrefix,n||null)}function ga(e){return y.filter(function(t){return qe(e,t)!==null})}function Rn(e,t,n){var r=0;return X(e,".column").forEach(function(o){if(!(n&&o===n)){var i=zt(o,t),l=i?ua(i):zn(o,t);r+=($(l)?l:0)+(Rt(o,t)||0)}}),W-r}function It(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),Ro),t===null||!$(t)?{size:t,offset:n,refused:!1}:(t=Math.min(Math.max(t,1),W),t+n<=W?{size:t,offset:n,refused:!1}:e.leading==="offset"?{size:W-n,offset:n,refused:!1}:{size:null,offset:n,refused:!0})}function Xe(e){se(e,".column").forEach(function(t){Le(t,{width:"",height:"",left:"",top:""}),pt(t)})}function vo(e){return"ge-"+e+"-"+er}function Nn(){return[".row",".ge-text-block",".ge-content","[data-ge-container]"].concat(Dt("blocks")).join(", ")}function Dt(e){return Object.keys(L).map(function(t){return L[t][e]||null}).filter(function(t){return t!==null})}function In(e,t){var n=!0;return Object.keys(L).forEach(function(r){var o=L[r];n&&o.accepts&&o.accepts(e,t)===!1&&(n=!1)}),n}function pa(){return s.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 Ft(e,t){var n=Do();if(e=Array.isArray(e)?e:e?[e]:[],!(!e.length||!n)){var r=s.drag_handle==="drawer",o=pa(),i=0;e.forEach(function(l){var c=t.group?{name:vo(t.group)}:{name:vo(t.draggable+"-"+ ++i),pull:!1,put:!1};t.group&&t.accepts&&(c.put=function(u,g,h){return g.options.group.name===c.name&&t.accepts(u.el,h)}),xt.push(n.create(l,Object.assign({group:c,draggable:t.draggable,handle:r?".ge-tools-drawer":".ge-tools-drawer .ge-move",filter:function(u,g){return Y(u.target,o,l)?!0:!g||g.parentNode!==l},preventOnFilter:!1,forceFallback:!0,fallbackOnBody:!1,ghostClass:"ge-drag-placeholder",chosenClass:"ge-drag-chosen",dragClass:"ge-drag-helper",fallbackClass:"ge-drag-helper",animation:s.drag.animation,delay:s.drag.delay||s.drag.touch_delay,delayOnTouchOnly:!s.drag.delay,touchStartThreshold:s.drag.threshold,scroll:s.drag.scroll,onStart:ha,onEnd:wa},t.options||{})))})}}function va(){if(!Do()){K("sortable_missing",m("error.sortable_missing"));return}Ft(_(f,".row"),{draggable:".column",group:"column"}),Ft([f].concat(_(f,".column")),{draggable:Nn(),group:"block",accepts:In});var e=Dt("regions");e.length&&Ft(_(f,e.join(", ")),{draggable:">"+Nn(),group:"block",accepts:In}),ae("onSortable",Ft)}function ha(e){var t=e.item,n=un(t),r=ho(t),o={from:n,canceled:!1};Qt.set(t,o),Q(function(){var i=N("before-move",re(r.kind,r.node,{parent:n.parent,source:"dragdrop",from:n}));i||(o.canceled=!0)})}function ho(e){var t=b(e,"ge-text-block")&&P(e,".ge-content")||e;return{kind:me(t),node:t}}function ba(e,t){var n=X(t.parent).filter(function(r){return r!==e&&!b(r,"ge-tools-drawer")});!n.length||t.index>=n.length?t.parent.appendChild(e):t.parent.insertBefore(e,n[t.index])}function wa(e){var t=e.item,n=Qt.get(t),r=n?n.from:un(t);if(Qt.delete(t),n&&n.canceled){ba(t,r);return}var o=un(t);if(!(o.parent===r.parent&&o.index===r.index)){var i=Y(t,"[data-ge-container]"),l=O[De(i)];l&&l.afterPaneMove&&l.afterPaneMove(i,t,r);var c=ho(t);Q(function(){N("after-move",re(c.kind,c.node,{parent:o.parent,source:"dragdrop",from:r,to:o,container:i||void 0}))})}}function ya(){s.resize.enabled&&_(f,".column").forEach(function(e){if(!P(e,".ge-resize-handle")){var t=P(e,".ge-tools-drawer");t&&t.appendChild(v("span",{class:"ge-resize-size"})),Ca().forEach(function(n){var r=v("span",{class:"ge-resize-handle ge-resize-"+n,"data-ge-edge":n});r.addEventListener("pointerdown",Ea),e.appendChild(r)})}})}function Ca(){return String(s.resize.handles).split(",").map(function(e){return e.trim()}).filter(function(e){return e==="e"||e==="w"})}function Ea(e){var t=e.currentTarget,n=t.parentElement,r=t.getAttribute("data-ge-edge")==="w",o=e.pageX,i=ht(n);if(e.preventDefault(),!_a(n))return;C(n,"ge-resizing"),e.pointerId!==void 0&&t.setPointerCapture&&t.setPointerCapture(e.pointerId);function l(g){var h=g.pageX-o;return Math.max(1,i+(r?-h:h))}function c(g){n.style.width=l(g)+"px",ka(n,l(g))}function u(g){t.removeEventListener("pointermove",c),qn(t,"pointerup pointercancel",u),k(n,"ge-resizing"),Aa(n,l(g))}t.addEventListener("pointermove",c),ue(t,"pointerup pointercancel",u)}function xa(){bo(f)}function bo(e){_(e,".ge-resize-handle").forEach(function(t){t.remove()}),_(e,".ge-resize-size").forEach(function(t){t.remove()}),Xe(e)}function wo(e,t){var n=Math.round(t/Kr(e.parentElement)*W),r=yo(e),o=r?ot(r):null,i=kt.get(e),l=i?i.units:it(e),c=r&&$(o)?l+o-lt(s.valid_col_sizes):W-at(e);return Math.min(Math.max(n,lt(s.valid_col_sizes)),Math.max(c,lt(s.valid_col_sizes)),kn(s.valid_col_sizes))}function yo(e){return s.resize.balance!=="next"?null:To(e,".column")[0]||null}function Dn(e,t){var n=P(e,".ge-tools-drawer"),r=n?P(n,".ge-resize-size"):null;r&&(r.textContent=t)}function Co(e){return(z===Z?y[0].colPrefix:_e().colPrefix)+e}function _a(e){var t=ot(e),n=Q(function(){return N("before-resize",re("column",e,{source:"dragdrop",from:t,to:null}))});if(!n)return!1;var r={from:t,units:it(e)};return kt.set(e,r),Dn(e,Co(r.units)),!0}function ka(e,t){Dn(e,Co(wo(e,t)))}function Aa(e,t){var n=kt.get(e),r=wo(e,t);if(kt.delete(e),Dn(e,""),Xe(e),!!n&&r!==n.units){var o=an(e,r);o&&Q(function(){ln(e,o),Sa(e,r-n.units),pe(e),N("after-resize",re("column",e,sn({source:"dragdrop",from:n.from,to:o.size},o.cleared)))})}}function Sa(e,t){var n=yo(e);if(!(!n||!t)){var r=ot(n);if($(r)){var o=an(n,r-t);o&&(ln(n,o),pe(n))}}}function Ta(){xt.forEach(function(e){e.destroy()}),xt=[]}function Ye(){return v("div",{class:"row"})}function Ht(e,t,n){var r=null;if(Xa.forEach(function(c){r===null&&n&&n[c]!==void 0&&(r=c)}),r===null)return e;var o=oe(n[r]);if(!o)return U(t+": "+r+" matches no element; the "+t+" is left detached"),e;var i=r==="appendTo"||r==="prependTo"?o:o.parentElement,l=function(){return ie(t,e,function(){r==="appendTo"?o.appendChild(e):r==="prependTo"?o.insertBefore(e,o.firstChild):r==="insertBefore"?o.parentNode.insertBefore(e,o):Vt(e,o)},{parent:i,source:n.source||"api"})};return Ze>0?(nn(l),e):l()}function Oa(e,t){var n=Ye();return e!==void 0&&!Array.isArray(e)&&!(e&&e.row_cols)&&(U("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=tt(e)),(Array.isArray(e)?e:[]).forEach(function(r){n.appendChild(Se(r))}),Ht(n,"row",t)}function La(e,t){t=t||{};var n=oe(t.appendTo||t.prependTo||null);e===void 0&&n&&ct(n,_e())?e=null:!$(e)&&Yn.indexOf(e)===-1&&(U("createColumn: no column size given, using "+W),e=W);var r=Se(e,t.offset);return t.content!==void 0&&r.appendChild(Ha(t.content)),Ht(r,"column",t)}function Ma(e,t){t=t||{};var n=O[e];return n?Ht(n.create(t),e,t):(U('createContainer: no such container type "'+e+'"'),null)}function Fn(e,t,n){e=oe(e),n=n||{};var r=O[De(e)];if(!r||De(e)!==t)return U("this is not a "+t+" container"),null;var o=r.addPane(e,n);return o?ie(r.paneKind,o,function(){},{parent:e,source:"api",container:e}):null}function Pa(e,t){e=oe(e);var n=De(e);return!O[n]||!O[n].addPane?(U("addPane: this is not a container with panes"),null):Fn(e,n,t)}function Hn(){var e={};return Object.keys(s).forEach(function(t){var n=s[t];e[t]=Array.isArray(n)?n.slice():n}),Object.freeze(e)}function Se(e,t){var n=v("div",{class:"column"}),r=No(z)[0],o=It({size:e,offset:t||0,leading:"offset"});return Nt(n,r,o.size===null?e:o.size),jn(n,r,o.offset),n}function Wn(e,t){if(!(!s.custom_filter||!s.custom_filter.length)){var n=typeof s.custom_filter=="string"||typeof s.custom_filter=="function"?[s.custom_filter]:s.custom_filter;Array.prototype.forEach.call(n,function(r){typeof r=="string"&&(r=window[r]),r(t||f,e)})}}function za(){var e=[".row","[data-ge-container]"];return Object.keys(L).forEach(function(t){var n=L[t],r=typeof n.cuts=="function"?n.cuts():n.cuts;r&&e.push(r)}),e.join(", ")}function ja(e){_(f,".column > .ge-content, .column > .ge-text-block > .ge-content").forEach(function(t){if(!(b(t,"ge-rte-active")||!X(t,e).length)){var n=t.getAttribute("data-ge-content-type"),r=b(t.parentElement,"ge-text-block")?t.parentElement:t,o=[],i=[];for(Array.prototype.slice.call(t.childNodes).forEach(function(u){u.nodeType===1&&u.matches(e)?(o.push({text:i},{block:u}),i=[]):i.push(u)}),o.push({text:i});t.firstChild;)t.removeChild(t.firstChild);var l=!1,c=r;o.forEach(function(u){var g;if(u.block)g=u.block;else if(Ra(u.text))l?(g=Un(n),u.text.forEach(function(h){g.appendChild(h)})):(u.text.forEach(function(h){t.appendChild(h)}),g=r,l=!0);else return;g!==c&&Vt(g,c),c=g}),l||r.remove()}})}function Ra(e){return e.some(function(t){return t.nodeType===1||t.nodeType===3&&/\S/.test(t.nodeValue)})}function Na(e){_(f,".column").forEach(function(t){var n=[];X(t).forEach(function(r){Te(r,".ge-tools-drawer, .ge-resize-handle")||(Te(r,".ge-content, .ge-text-block")||r.matches(e)?n=Eo(n):n.push(r))}),Eo(n)})}function Eo(e){if(e.length){var t=Vt(Un(),e[e.length-1]);e.forEach(function(n){t.appendChild(n)})}return[]}function Un(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 Ia(){_(f,".column > .ge-content").forEach(function(e){Mo(e,v("div",{class:"ge-text-block"}))}),_(f,".ge-text-block").forEach(function(e){if(!P(e,".ge-tools-drawer")){var t=P(e,".ge-content"),n=t?t.getAttribute("data-ge-content-type"):null;n?ci(n)||Fa(e,n):Da(e)}})}function xo(e){_(e,".ge-text-block").forEach(function(t){Gt(t)})}function Da(e){var t=P(e,".ge-content"),n=Ge(e,"ge-tools-drawer ge-text-drawer ge-plain-drawer");C(e,"ge-plain-block"),Fe(n),Object.keys(L).forEach(function(r){L[r].plainTools&&L[r].plainTools(n,t)}),F(n,m("tool.delete_plain"),"ge-delete-plain","bi bi-trash",function(){je("plain",t,m("confirm.delete_plain"),function(r){bt(e,function(){e.remove(),r()})})})}function Fa(e,t){var n=P(e,".ge-content"),r=Ge(e,"ge-tools-drawer ge-text-drawer");Fe(r),F(r,m("text.no_editor",{type:t}),"ge-text-info ge-text-missing","bi bi-exclamation-triangle"),F(r,m("tool.delete_text"),"ge-delete-text","bi bi-trash",function(){je("text",n,m("confirm.delete_text"),function(o){bt(e,function(){e.remove(),o()})})})}function Ha(e){var t=wr(),n=Un(t.length?t[0].type:null);return e&&e.nodeType?n.appendChild(e):mt(n,e),n}function _o(e){z=e,Xn.forEach(function(t){R(f,"ge-layout-"+t,t===e)}),A(We,"button").textContent=m(wt(e))}function Kn(e){return Xn.indexOf(e)===-1?null:e}function ko(e){var t=Kn(e);if(t===null){U("changeView("+JSON.stringify(e)+"): no such layout mode");return}var n=z;_o(t),t!==n&&(qr().forEach(function(r){_(r,".ge-utilities").forEach(function(o){xn(o)})}),jr(null),rt(f),ae("onViewChange",t),N("view-change",{canvas:f,breakpoint:t,from:n,to:t}))}function Bn(){return z}function Ao(e,t,n){return function(){return Ie[e]?Ie[e].apply(null,arguments):(K("plugin:"+t,e+" needs the "+t+" plugin: include dist/plugins/grideditor."+n+".js after the editor"),null)}}function Wa(e){if(!s.active_target){K("active_target","setActiveTarget needs the active_target setting: without it, it does nothing");return}if(e==null){Re(null);return}var t=oe(e);if(!mi(t)){var n=typeof e=="string"?e:t?"<"+t.tagName.toLowerCase()+">":String(e);U("setActiveTarget: "+n+" is not a column or a region of the canvas");return}Re(t)}function Ua(e){if(he()!=="sidebar"){K("sidebar-api",'setSelected needs settings_panel "sidebar": without it, it does nothing');return}if(e==null){be(null);return}var t=oe(e);if(!t||t===f||!f.contains(t)||!Be.has(t)){var n=typeof e=="string"?e:t?"<"+t.tagName.toLowerCase()+">":String(e);U("setSelected: "+n+" is not a node of the canvas with settings");return}be(t)}var Vn={getHtml:nt,getPlainHtml:hi,init:function(){nn(ge)},reset:function(){nn(yr)},deinit:Ne,destroy:wi,changeView:ko,getView:Bn,createRow:Oa,createColumn:La,createText:function(e,t){return Ie.createText?Ie.createText(e,t):(K("plugin:text","createText needs a text editor plugin: include dist/plugins/grideditor.tinymce.js, or another editor's, after the editor"),null)},createElement:Ao("createElement","elements","elements"),createSection:Ao("createSection","sections","sections"),createContainer:Ma,addTab:function(e,t){return Fn(e,"tabs",t)},addAccordionItem:function(e,t){return Fn(e,"accordion",t)},addPane:Pa,setLocale:Ho,getUtility:Mr,setUtility:En,getActiveTarget:function(){return s.active_target?H:null},setActiveTarget:Wa,getSelected:function(){return he()==="sidebar"?q:null},setSelected:Ua};Object.keys(Vn).forEach(function(e){var t=!!(jo[e]&&jo[e].value);a[e]=function(){if(_t)return K("destroyed:"+e,m("warning.destroyed",{method:e})),e==="getHtml"?f.innerHTML:e==="getPlainHtml"?$n(f.innerHTML):t?null:a;var n=Vn[e].apply(a,arguments);return t?n:a}}),a.canvas=f,a.settings=Hn(),Xt.set(f,a),yi(),a.settings=Hn(),Object.keys(Ie).forEach(function(e){Object.prototype.hasOwnProperty.call(Vn,e)||e in a||(a[e]=function(){return _t?(K("destroyed:"+e,m("warning.destroyed",{method:e})),null):Ie[e].apply(null,arguments)})}),Vo(),ge(),S._created.forEach(function(e){e(a)})}S._created=[];S.containers={};S.features={};S.utilities={};S.texts={};S.t=Qn;S._plainHtml=$n;S.Sortable=null;S.bootstrap=null;S.version="9.0.0-beta.2";S.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
|
|
1
|
+
(()=>{function _(a,d){return a?Array.prototype.slice.call(a.querySelectorAll(d)):[]}function A(a,d){return a?a.querySelector(d):null}function ue(a,d){if(!a)return[];var p=_(a,d);return a.nodeType===1&&a.matches(d)&&p.unshift(a),p}function X(a,d){return a?Array.prototype.filter.call(a.children,function(p){return!d||p.matches(d)}):[]}function P(a,d){return X(a,d)[0]||null}function Y(a,d,p){var s=a&&a.nodeType===1?a.closest(d):null;return s&&p&&s!==p&&!p.contains(s)?null:s}function Oe(a,d){return!!a&&a.nodeType===1&&a.matches(d)}function Le(a){return!!a&&document.documentElement.contains(a)}function Oo(a,d){for(var p=[],s=a.nextElementSibling;s;s=s.nextElementSibling)(!d||s.matches(d))&&p.push(s);return p}function Lo(a,d){for(var p=[],s=a.parentElement;s&&s!==d;s=s.parentElement)p.push(s);return p}function Ka(a){var d=document.createElement("template");return d.innerHTML=a,Array.prototype.slice.call(d.content.childNodes)}function G(a){for(var d=Ka(a.trim()),p=0;p<d.length;p++)if(d[p].nodeType===1)return d[p];return null}function v(a,d,p){var s=document.createElement(a);return Object.keys(d||{}).forEach(function(c){var E=d[c];E!=null&&E!==!1&&s.setAttribute(c,E)}),p!=null&&(s.textContent=p),s}function mt(a,d){return a.innerHTML=d==null?"":String(d),a}function y(a,d){return Je(d).forEach(function(p){a.classList.add(p)}),a}function k(a,d){return Je(d).forEach(function(p){a.classList.remove(p)}),a}function R(a,d,p){return Je(d).forEach(function(s){p===void 0?a.classList.toggle(s):a.classList.toggle(s,!!p)}),a}function b(a,d){return!!a&&a.nodeType===1&&a.classList.contains(d)}function Je(a){return String(a||"").split(/\s+/).filter(Boolean)}function gt(a){return a.getAttribute("class")||a.removeAttribute("class"),a}function pt(a){return a.getAttribute("style")||a.removeAttribute("style"),a}function Ut(a,d){return Object.keys(d).forEach(function(p){var s=d[p];s==null?a.removeAttribute(p):a.setAttribute(p,s)}),a}function Me(a,d){return Object.keys(d).forEach(function(p){var s=d[p];typeof s=="number"&&!Ba[p]&&(s=s+"px"),a.style.setProperty(p,s==null?"":String(s))}),a}var Ba={opacity:!0,"z-index":!0,"flex-grow":!0,"flex-shrink":!0,order:!0},ft={};function Va(a){var d=a.nodeName;if(!ft[d]){var p=document.body.appendChild(document.createElement(d));ft[d]=getComputedStyle(p).display,p.remove(),ft[d]==="none"&&(ft[d]="block")}return ft[d]}function Pe(a){return a.style.removeProperty("display"),getComputedStyle(a).display==="none"&&(a.style.display=Va(a)),a}function ce(a){return a.style.display="none",a}function Gn(a,d){return d===void 0&&(d=!vt(a)),d?Pe(a):ce(a)}function vt(a){return!!(a.offsetWidth||a.offsetHeight||a.getClientRects().length)}function ht(a){return a.getBoundingClientRect().width}function Kt(a){return a.getBoundingClientRect().height}function Mo(a){var d=getComputedStyle(a);return a.clientHeight-parseFloat(d.paddingTop)-parseFloat(d.paddingBottom)}function Bt(a){var d=a.getBoundingClientRect();return{top:d.top+window.pageYOffset,left:d.left+window.pageXOffset}}function Vt(a,d){return d.parentNode.insertBefore(a,d.nextSibling),a}function Gt(a){for(var d=a.parentNode;a.firstChild;)d.insertBefore(a.firstChild,a);a.remove()}function Po(a,d){return a.parentNode.insertBefore(d,a),d.appendChild(a),d}function $e(a,d,p,s,c){var E=function(w){var D=Y(w.target,p,a);if(D&&a.contains(D))return s.call(D,w)};return Je(d).forEach(function(w){a.addEventListener(w,E,c)}),E}function fe(a,d,p,s){return Je(d).forEach(function(c){a.addEventListener(c,p,s)}),p}function qn(a,d,p,s){Je(d).forEach(function(c){a.removeEventListener(c,p,s)})}var Ga=400;function zo(a,d,p,s){p=p===void 0?Ga:p;var c=function(){ce(a),s&&s()};if(!vt(a)||!a.animate||p<=0){window.setTimeout(c,0);return}var E=a.animate(d(getComputedStyle(a)),{duration:p,easing:"ease-in-out"}),w=!1,D=function(){w||(w=!0,c())};E.onfinish=D,E.oncancel=D}function bt(a,d,p){typeof d=="function"&&(p=d,d=void 0),a.style.overflow="hidden",zo(a,function(s){return[{height:s.height,paddingTop:s.paddingTop,paddingBottom:s.paddingBottom,marginTop:s.marginTop,marginBottom:s.marginBottom},{height:"0px",paddingTop:"0px",paddingBottom:"0px",marginTop:"0px",marginBottom:"0px"}]},d,function(){a.style.removeProperty("overflow"),p&&p()})}function jo(a,d,p,s){a.style.overflow="hidden",zo(a,function(c){var E={opacity:c.opacity,height:c.height},w={opacity:0,height:"0px"};return s&&(E.width=c.width,w.width="0px"),[E,w]},d,function(){a.style.removeProperty("overflow"),p&&p()})}var Ro={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},addPane:{value:!0},setLocale:{},getUtility:{value:!0},setUtility:{value:!0},getActiveTarget:{value:!0},setActiveTarget:{},getSelected:{value:!0},setSelected:{}},Xa=["appendTo","prependTo","insertAfter","insertBefore"],Ya=["data-bs-target","data-bs-parent","href","aria-controls","aria-labelledby","aria-describedby","for","data-ge-popup-id","data-ge-popup-target"],Ja=/^ge-([a-z][a-z-]*?)-\d+-[a-z0-9]+$/,C=[{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"}],Z="all",$a="view.all",Xn=[Z].concat(C.map(function(a){return a.key})),W=12,No=11,Yn=["equal","auto"],Qe=["1","2","3","4","5","6","auto"];function Jn(a,d){return"row-cols"+(a.infix?"-"+a.infix:"")+"-"+d}function $(a){return typeof a=="number"}function We(a,d){return d==="equal"?a.infix?"col-"+a.infix:"col":a.colPrefix+d}function ee(a){for(var d=0;d<C.length;d++)if(C[d].key===a)return C[d];return null}function Io(a){if(a===Z)return[C[0]];var d=ee(a);return d?[d]:[]}function wt(a){var d=ee(a);return d?d.labelKey:$a}var ze={add_column:{size:12,picker:!0,delay:600},elements:{enabled:"auto",selector:"[data-ge-element]",auto:!1,types:[]},resize:{enabled:!0,tools:!0,handles:"e",balance:"next"},indent:{tools:!0},sidebar:{empty:null},drag:{delay:0,touch_delay:100,threshold:3,animation:150,scroll:!0}},Do={},Qa=0,Xt=new WeakMap,qt=null,Za=".ge-mainControls, .ge-settings-panel, .ge-sidebar-toggle, .ge-dialog, .ge-confirm, .ge-size-picker, .modal, .modal-backdrop";function Qn(a,d,p){var s=S.locales,c=s[a.locale]||{},E=a.locale_strings||{},w=E[d];return w===void 0&&(w=c[d]),w===void 0&&(w=s.en[d]),w===void 0&&(tl("locale:"+d,'no string for "'+d+'" in any locale, showing the key'),w=d),w.replace(/\{(\w+)\}/g,function(D,me){return p&&p[me]!==void 0?p[me]:D})}function el(a,d){var p=S.locales;return(a.locale_strings||{})[d]!==void 0||(p[a.locale]||{})[d]!==void 0||p.en[d]!==void 0}function U(a){window.console&&window.console.warn&&window.console.warn("grid-editor: "+a)}function tl(a,d){Do[a]||(Do[a]=!0,U(d))}function nl(a,d){return Qn({locale:"en"},a,d)}function rl(a){if(typeof a=="string"){var d=document.querySelector(a);if(!d)throw new TypeError("grid-editor: no element matches "+JSON.stringify(a));return d}if(a&&a.nodeType===1)return a;throw new TypeError("grid-editor: the target is an element or a selector, not "+(a===null?"null":typeof a))}function oe(a){return typeof a=="string"?document.querySelector(a):a&&a.nodeType===1?a:null}function Fo(){return S.Sortable||window.Sortable||null}function yt(){var a=S.bootstrap||window.bootstrap;return a&&a.Modal?a.Modal:null}function $n(a){var d=document.implementation.createHTMLDocument("").body;d.innerHTML=a;var p=[];return _(d,"*").forEach(function(s){var c=!1;Array.prototype.slice.call(s.attributes).forEach(function(D){D.name.indexOf("data-ge-")===0&&(s.removeAttribute(D.name),c=!0)});var E=(s.getAttribute("class")||"").split(/\s+/).filter(Boolean),w=E.filter(function(D){return D!=="column"&&D.indexOf("ge-")!==0});w.length!==E.length&&(c=!0),w.length?s.setAttribute("class",w.join(" ")):s.removeAttribute("class"),c&&s.tagName==="DIV"&&!s.attributes.length&&p.push(s)}),p.forEach(function(s){Gt(s)}),d.innerHTML}function S(a,d){var p=rl(a),s=Xt.get(p);if(s)return Ho.has(p)||(Ho.add(p),U(nl("warning.already_editing"))),s;if(!(this instanceof S))return new S(p,d);ol(this,p,d||{})}var Ho=new WeakSet;S.create=function(a,d){return new S(a,d)};S.get=function(a){var d=oe(a);return d&&Xt.get(d)||null};function ol(a,d,p){var s=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",drawer_overflow:"menu",toolbar_groups:!1,active_target:!1,element_tools:[],element_classes:[],container_classes:[],pane_classes:[],container_tools:[],tab_tools:[],accordion_tools:[],plugins:null,row_cols:!0,utilities:{},elements:ze.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:ze.add_column,layout_modes:Xn.slice(),default_view:Z,resize:ze.resize,indent:ze.indent,source_textarea:"",edit_source:!0,locale:"en",locale_strings:{},callbacks:{},confirm_delete:!0,settings_panel:"offcanvas",sidebar:ze.sidebar,drag:ze.drag},p);if(Object.keys(ze).forEach(function(e){s[e]=Object.assign({},ze[e],s[e])}),s.settings_panel==="sidebar"){if(p&&p.active_target===!1)throw new TypeError('grid-editor: settings_panel "sidebar" needs active_target; leave it out or set it to true');s.active_target=!0}var c,E,w,D,me,Ue,te,z=s.default_view,j=null,ne=null,ye=!1,Ke=null,H=null,Ct=null,Yt=function(){},Jt=function(){},ge=[],Et={},$t=null,Zn={},xt=[],er=++Qa,_t=!1,q=null,Be=null,tr=null;s.settings_panel==="sidebar"&&(qt?(K("sidebar",'settings_panel "sidebar" is in use by another editor on the page, which has one sidebar: using offcanvas'),s.settings_panel="offcanvas"):qt=a);var je=new WeakMap,Qt=new WeakMap,kt=new WeakMap,nr=new WeakMap,Zt=new WeakSet,en=new AbortController;c=y(d,"ge-canvas");function K(e,t){Zn[e]||(Zn[e]=!0,U(t))}function m(e,t){return Qn(s,e,t)}function Wo(e){s.locale=e,a.settings=Hn(),or(),$r(),uo(),fn(),cn(),yr()}var Ze=0,tn=[];function re(e,t,n){return Object.assign({kind:e,node:t,parent:t.parentElement,canvas:c,breakpoint:Bn(),source:"api"},n||{})}function N(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(i){var l=new CustomEvent("grideditor:"+i,{detail:t,bubbles:!0,cancelable:!0});c.dispatchEvent(l)||(o=!0)}),n.forEach(function(i){var l=s.callbacks[i.replace(/-/g,"_")];typeof l=="function"&&l(t)===!1&&(o=!0)}),!o}function Q(e){Ze++;try{return e()}finally{if(Ze--,Ze===0)for(;tn.length;)tn.shift()()}}function nn(e){if(Ze===0){e();return}tn.push(e)}function ie(e,t,n,r){var o=Uo(e);return Q(function(){var i=re(e,t,r);return N("before-add-"+o,i)?(n(),ve(),N("after-add-"+o,i),t):null})}function Uo(e){return S.containers[e]?"container":e}function Ko(e,t){if(!s.confirm_delete){t();return}rr(e,{danger:!0},function(n){n&&t()})}function rr(e,t,n){t=t||{};var r=yt();if(!r){n(window.confirm(e));return}var o=Bo(),i=!1,l=A(o,".ge-confirm-ok");Re&&Re(null);var f=function(u){Re===f&&(Re=null,n(u))};Re=f,A(o,".modal-title").textContent=t.title||m("confirm.title"),A(o,".ge-confirm-cancel").textContent=t.cancel||m("confirm.cancel"),l.textContent=t.ok||m("confirm.ok"),R(l,"btn-danger",!!t.danger),R(l,"btn-primary",!t.danger),A(o,".ge-confirm-message").textContent=e,l.onclick=function(){i=!0,r.getInstance(o).hide()},Ce.hidden=function(){f(i)},Ce.shown=function(){l.focus()},r.getOrCreateInstance(o).show()}var Ce={hidden:null,shown:null},Re=null;function Bo(){if(j)return j;j=G('<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(j),A(j,".modal-title").textContent=m("confirm.title"),A(j,".btn-close").setAttribute("aria-label",m("confirm.cancel")),A(j,".ge-confirm-cancel").textContent=m("confirm.cancel"),A(j,".ge-confirm-ok").textContent=m("confirm.ok"),ir(j);var e=j;return j.addEventListener("hidden.bs.modal",function(){e===j&&Ce.hidden&&Ce.hidden()}),j.addEventListener("shown.bs.modal",function(){e===j&&Ce.shown&&Ce.shown()}),j}function or(){j&&(Ce.hidden=null,Ce.shown=null,rn(j),j=null,Re&&Re(null))}function rn(e){var t=yt(),n=t?t.getInstance(e):null,r=!1,o=function(){r||(r=!0,n&&n.dispose(),e.remove())};if(!n||!on.get(e)&&!b(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 on=new WeakMap;function ir(e){fe(e,"show.bs.modal hide.bs.modal",function(){on.set(e,!0)}),fe(e,"shown.bs.modal hidden.bs.modal",function(){on.set(e,!1)})}function Ne(e,t,n,r){Q(function(){var o=re(e,t,{source:"tool"});N("before-delete",o)&&Ko(n,function(){Q(function(){r(function(){t.remove(),Q(function(){ve(),N("after-delete",o)})})})})})}function an(e,t,n){if(n=n||z,n!==Z){var r=ee(n),o=It({size:t,offset:Rt(e,r)||0});return o.refused||qe(e,r)===o.size?null:{writes:[{tier:r,size:o.size}],cleared:null,size:o.size}}var i=C.some(function(g){return It({size:t,offset:Rt(e,g)||0}).refused});if(i)return null;var l=C[0],f=[],u=[];return C.slice(1).forEach(function(g){var h=qe(e,g);h!==null&&(f.push({tier:g,size:null}),u.push({breakpoint:g.key,value:h}))}),qe(e,l)!==t&&f.unshift({tier:l,size:t}),f.length?{writes:f,cleared:u,size:t}:null}function ln(e,t){t.writes.forEach(function(n){Nt(e,n.tier,n.size)}),Xe(e)}function sn(e,t){return t&&(e.cleared=t),e}function dn(e,t,n,r){r=r||z;var o=ot(e),i=an(e,t,r);return i?Q(function(){var l=re("column",e,sn({source:n,breakpoint:r,from:o,to:i.size},i.cleared));return N("before-resize",l)?(ln(e,i),he(e),N("after-resize",l),!0):(he(e),!1)}):!1}function ar(e,t,n){var r=z===Z,o=r?C[0]:ee(z),i=at(e);t=Math.min(Math.max(t,0),No);var l=r?C.slice(1).filter(function(f){return jt(e,f)!==null}):[];return(jt(e,o)||0)===t&&!l.length?!1:Q(function(){var f=re("column",e,sn({source:n,from:i,to:t},r?l.map(function(u){return{breakpoint:u.key,value:jt(e,u)}}):null));return N("before-indent",f)?(jn(e,o,t),l.forEach(function(u){jn(e,u,0)}),(r?C:[o]).forEach(function(u){var g=zn(e,u);if($(g)){var h=It({size:g,offset:t,leading:"offset"});h.size!==g&&Nt(e,u,h.size)}}),he(e),N("after-indent",f),!0):!1})}function un(e){var t=e.parentElement;return{parent:t,index:X(t).filter(function(n){return!b(n,"ge-tools-drawer")}).indexOf(e)}}function pe(e){var t=null;if(Object.keys(L).forEach(function(r){var o=L[r];!t&&o.kindOf&&(t=o.kindOf(e))}),t)return t;if(e.getAttribute("data-ge-container"))return e.getAttribute("data-ge-container");var n=null;return Object.keys(O).forEach(function(r){var o=O[r];!n&&o.paneClass&&b(e,o.paneClass)&&(n=o.paneKind)}),n||(b(e,"ge-tab")?"tab":b(e,"ge-accordion-item")?"accordion-item":b(e,"row")?"row":b(e,"column")?"column":b(e,"ge-element")?"element":(b(e,"ge-text-block")&&(e=P(e,".ge-content")||e),b(e,"ge-content")?e.getAttribute("data-ge-content-type")?"text":"plain":"node"))}if(s.source_textarea){var et=oe(s.source_textarea).value,lr=v("div");lr.innerHTML=et,et.length>0&&!lr.querySelector(".row")&&(et='<div class="row"><div class="col-lg-12">'+et+"</div></div>"),mt(d,et)}if(d.children.length&&!d.querySelector("div.row")){var Vo=X(d),sr=G('<div class="row"><div class="col-lg-12"></div></div>');d.appendChild(sr),Vo.forEach(function(e){sr.firstChild.appendChild(e)})}function Go(){te=v("textarea",{class:"ge-html-output"}),c.parentNode.insertBefore(te,c),cn(),Yi();var e={signal:en.signal};window.addEventListener("scroll",gr,e),$e(c,"click",".ge-content",ui,e),$e(c,"click",".ge-popup-trigger, [data-ge-popup-target]",function(o){b(c,"ge-editing")&&o.preventDefault()},e);var t=le()==="sidebar";if(s.active_target||t){var n=null;c.addEventListener("pointerdown",function(o){n={x:o.clientX,y:o.clientY}},e),c.addEventListener("click",function(o){var i=n;n=null,b(c,"ge-editing")&&(i&&Math.abs(o.clientX-i.x)+Math.abs(o.clientY-i.y)>s.drag.threshold||(s.active_target&&r(o),t&&c.contains(o.target)&&se(ao(o.target))))},e),document.addEventListener("keydown",function(o){if(!(o.key!=="Escape"||V||de)&&!(j&&b(j,"show"))){var i=document.activeElement;i&&(Oe(i,"input, textarea, select")||i.isContentEditable)||(q&&ut()?se(null):H&&Ee(null))}},e)}t&&(c.addEventListener("focusin",function(o){var i=ut()?ao(o.target):null;i&&se(i)},e),document.addEventListener("click",function(o){var i=o.target;!q||!ut()||!i||i.nodeType!==1||!Le(i)||c.contains(i)||Y(i,Za)||c.querySelector(".ge-rte-active")||se(null)},e),window.addEventListener("resize",eo,e));function r(o){var i=Y(o.target,Cr());if(i&&i===H&&(o.target===i||o.target===P(i,".ge-tools-drawer"))){Ee(null);return}Ee(i&&i!==c&&c.contains(i)?i:null)}}function qo(e){!Oe(e,".ge-content")||!c.contains(e)||(ae("onContentReady",e),rt(e))}function cn(){E=v("div",{class:"ge-mainControls"}),te.parentNode.insertBefore(E,te),w=E.appendChild(v("div",{class:"ge-wrapper ge-top"}));var e=s.toolbar_overflow!=="wrap",t=w;e&&(y(w,"ge-toolbar-menu"),t=w.appendChild(v("div",{class:"ge-toolbar-start"}))),ge=[],D=t.appendChild(v("div",{class:"ge-addRowGroup btn-group"})),me=v("div",{class:"ge-addContainerGroup btn-group ms-1"}),s.new_row_layouts.forEach(function(u){var g=!Array.isArray(u),h=v("a",{class:"btn btn-sm btn-light",title:g?m("row.add_row_cols",{columns:u.columns,counts:si(u.row_cols)}):m("row.add",{layout:u.join("-")}),"data-ge-toolbar":"row","data-ge-layout":g?JSON.stringify(u):u.join(",")});h.addEventListener("click",function(){if(H){hn(h,"tool");return}var I=tt(u),Wt=ie("row",I,function(){c.appendChild(I)},{parent:c,source:"tool"});Wt&&I.scrollIntoView&&I.scrollIntoView({behavior:"smooth"})}),D.appendChild(h),ge.push({button:h,home:D,group:"rows"}),h.appendChild(G('<i class="bi bi-plus"></i>'));var x=g?di(u):u,T='<div class="row ge-row-icon">';x.forEach(function(I){T+='<div class="column '+We(C[0],I)+'"></div>'}),T+="</div>",h.appendChild(G(T))}),t.appendChild(me),Object.keys(O).forEach(function(u){var g=O[u],h=ur(v("a",{class:"btn btn-sm btn-light ge-add-container"}),m(g.labelKey),g.iconClass);Ut(h,{"data-ge-toolbar":"container","data-ge-container-type":u}),h.addEventListener("click",function(){if(H){hn(h,"tool");return}var x=Ye(),T=x.appendChild(Te(W)),I=T.appendChild(g.create({}));ie(u,I,function(){c.appendChild(x)},{parent:c,source:"tool"})}),me.appendChild(h),ge.push({button:h,home:me,group:dr(g.group)||"content"})});var n=[];Et={},Object.keys(L).forEach(function(u){Et[u]=Qo(L[u]),Et[u].forEach(function(g,h){var x=ti(u,g,h);g.align==="end"?n.push(x):(me.appendChild(x),ge.push({button:x,home:me,group:dr(g.group)||u}))})}),Ue=G('<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>'),$e(Ue,"click","a",function(){Ao(this.getAttribute("data-ge-view"))}),w.appendChild(Ue),s.layout_modes.forEach(function(u){A(Ue,".dropdown-menu").appendChild(v("a",{class:"dropdown-item","data-ge-view":u,title:m(wt(u))},m(wt(u))))}),A(Ue,"button").textContent=m(wt(z));var r=w.appendChild(v("div",{class:"btn-group pull-right"}));if(s.edit_source){var o=G('<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",ye),o.addEventListener("click",function(){ye?vn():mi(),R(o,"active btn-danger",ye)}),r.appendChild(o)}var i=G('<button type="button" class="btn btn-sm btn-primary gm-preview"><i class="bi bi-eye-fill"></i></button>'),l=function(){b(i,"active")||y(c,"ge-editing")};if(i.setAttribute("title",m("tool.preview")),i.addEventListener("mouseenter",function(){k(c,"ge-editing")}),i.addEventListener("click",function(){R(i,"active btn-danger"),l()}),i.addEventListener("mouseleave",l),r.appendChild(i),n.length){var f=w.appendChild(v("div",{class:"pull-right ge-toolbar-end"}));n.forEach(function(u){f.appendChild(u)})}s.toolbar_groups&&Yo(t),e&&ei(t),ri()}var Xo=[{name:"rows",labelKey:"group.rows"},{name:"content",labelKey:"group.content"},{name:"elements",labelKey:"group.elements"}];function dr(e){return typeof e=="string"&&e.trim()!==""?e:null}function Yo(e){var t=Xo.map(function(i){return i.name});if(ge.forEach(function(i){t.indexOf(i.group)<0&&t.push(i.group)}),t=t.filter(function(i){return ge.some(function(l){return l.group===i})}),t.length<2)return;var n=v("div",{class:"ge-toolbar-groups btn-group",role:"tablist","aria-label":m("group.select")});e.insertBefore(n,e.firstChild);var r=E.appendChild(v("div",{class:"ge-toolbar-stash",hidden:"hidden"}));t.forEach(function(i){var l=n.appendChild(v("button",{type:"button",class:"btn btn-sm btn-outline-secondary",role:"tab","data-ge-group":i},Jo(i)));l.addEventListener("click",function(){o(i)})}),o(t.indexOf($t)>=0?$t:t[0]);function o(i){$t=i,ge.forEach(function(l){(l.group===i?l.home:r).appendChild(l.button)}),X(n).forEach(function(l){var f=l.getAttribute("data-ge-group")===i;R(l,"active",f),l.setAttribute("aria-selected",f?"true":"false")}),Jt()}}function Jo(e){var t="group."+e;if(el(s,t))return m(t);var n=ge.filter(function(r){return r.group===e})[0];return n.button.getAttribute("title")||e}function $o(){return ge.filter(function(e){return!Y(e.button,".ge-toolbar-stash")})}function Qo(e){var t=typeof e.toolbar=="function"?e.toolbar():e.toolbar;return Array.isArray(t)?t:[]}function Zo(){if(!(!E||_t)){var e=!!A(E,".gm-preview.active");fn(),cn(),e&&y(A(E,".gm-preview"),"active btn-danger"),gr()}}function fn(){Ct&&Ct.abort(),Ct=null,Yt=function(){},Jt=function(){},E.remove()}function ei(e){var t=G('<div class="ge-toolbar-more"><button type="button" class="btn btn-sm btn-light"><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=A(t,"button"),r=A(t,".ge-toolbar-overflow"),o=_(r,".btn-group");function i(T){return T===D?o[0]:o[1]}n.setAttribute("title",m("tool.more")),n.setAttribute("aria-haspopup","true"),n.setAttribute("aria-expanded","false");var l=Ct=new AbortController,f={signal:l.signal};if(n.addEventListener("click",function(){h(!b(t,"ge-open"))}),r.addEventListener("click",function(T){Y(T.target,"[data-ge-toolbar]")&&h(!1)}),document.addEventListener("pointerdown",function(T){t.contains(T.target)||h(!1)},f),document.addEventListener("keydown",function(T){T.key==="Escape"&&h(!1)},f),Yt=function(){h(!1)},Jt=x,x(),window.ResizeObserver){var u=!1,g=new window.ResizeObserver(function(){u||(u=!0,window.requestAnimationFrame(function(){u=!1,l.signal.aborted||x()}))});g.observe(w),g.observe(e),l.signal.addEventListener("abort",function(){g.disconnect()})}function h(T){T=T&&b(t,"ge-needed"),R(t,"ge-open",T),n.setAttribute("aria-expanded",T?"true":"false")}function x(){var T=$o();if(T.forEach(function(To){To.home.appendChild(To.button)}),k(t,"ge-needed"),e.scrollWidth<=e.clientWidth){h(!1);return}y(t,"ge-needed");for(var I=T.length-1;I>=0&&e.scrollWidth>e.clientWidth;I--){var Wt=i(T[I].home);Wt.insertBefore(T[I].button,Wt.firstChild)}}}function ur(e,t,n){return e.setAttribute("title",t),n?(e.appendChild(v("i",{class:n})),e):(e.appendChild(G('<i class="bi bi-plus"></i>')),e.appendChild(v("span",{},t)),e)}function ti(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),i=t.align==="end"?"btn-primary":"btn-light",l=ur(v("a",{class:"btn btn-sm "+i+" ge-add-container ge-add-feature"}),o,r),f=typeof t.action=="function";return y(l,t.className||""),(typeof t.hidden=="function"?t.hidden():t.hidden)&&ce(l),Ut(l,{"data-ge-toolbar":"feature","data-ge-feature":e,"data-ge-item":n}),f&&(l.setAttribute("data-ge-action",""),(typeof t.disabled=="function"?t.disabled():t.disabled)&&(y(l,"disabled"),l.setAttribute("aria-disabled","true"))),l.addEventListener("click",function(){if(f){b(l,"disabled")||t.action(l);return}if(H){hn(l,t.source||"tool");return}var u=t.create();if(u){var g=t.inColumn?mn(u):u,h=ie(t.kind,u,function(){c.appendChild(g)},{parent:c,source:t.source||"tool"});h&&t.inColumn&&g.scrollIntoView&&g.scrollIntoView({behavior:"smooth"})}}),l}function ni(){return s.toolbar_drag==="auto"?s.drag_handle==="drawer":!!s.toolbar_drag}function ri(){var e=_(E,"[data-ge-toolbar]:not([data-ge-action])");e.forEach(function(t){k(t,"ge-palette-button"),t.removeEventListener("pointerdown",cr)}),ni()&&e.forEach(function(t){y(t,"ge-palette-button"),t.addEventListener("pointerdown",cr)})}function cr(e){var t=e.currentTarget,n=e.pageX,r=e.pageY,o=null;if(e.button)return;function i(u){return Math.abs(u.pageX-n)+Math.abs(u.pageY-r)>s.drag.threshold}function l(u){if(!o){if(!i(u))return;o=y(t.cloneNode(!0),"ge-toolbar-helper"),document.body.appendChild(o),Yt(),y(c,"ge-dropping")}Me(o,{left:u.pageX-14,top:u.pageY-14}),ii(u.pageX,u.pageY)}function f(u){if(document.removeEventListener("pointermove",l),qn(document,"pointerup pointercancel",f),!!o){o.remove(),k(c,"ge-dropping"),gn();var g=function(x){x.target!==t&&!t.contains(x.target)||(x.preventDefault(),x.stopImmediatePropagation())};window.addEventListener("click",g,{capture:!0,once:!0}),window.setTimeout(function(){window.removeEventListener("click",g,{capture:!0})},0);var h=fr(u.pageX,u.pageY);h&&mr(t,h)}}document.addEventListener("pointermove",l),fe(document,"pointerup pointercancel",f)}function fr(e,t){var n=e-window.scrollX,r=t-window.scrollY,o=document.elementFromPoint(n,r);if(!o)return null;var i=Y(o,[".column",".ge-canvas"].concat(Dt("regions")).join(", "));if(!i||i!==c&&!c.contains(i))return null;var l=null;return X(i,Nn()).forEach(function(f){if(!l){var u=f.getBoundingClientRect();r<u.top+u.height/2&&(l=f)}}),{region:i,before:l}}function oi(e,t,n){var r=(Et[e.getAttribute("data-ge-feature")]||[])[parseInt(e.getAttribute("data-ge-item"),10)];if(!r)return null;var o=r.create();if(!o)return null;var i=o;if(r.inColumn)Oe(t.region,".column")||(i=mn(o));else if(!In(t.region,o)){var l=t.region===c?[]:Lo(t.region,c).reverse().concat([t.region]),f=l[0]||null;t={region:c,before:f?f.nextElementSibling:null}}return ie(r.kind,o,function(){t.before?t.before.parentNode.insertBefore(i,t.before):t.region.appendChild(i)},{parent:t.region,source:r.source||n||"dragdrop"})}function mn(e){var t=Ye();return t.appendChild(Te(W)).appendChild(e),t}function ii(e,t){var n=fr(e,t);if(!n)return gn();Ke||(Ke=v("div",{class:"ge-drop-marker"})),n.before?n.before.parentNode.insertBefore(Ke,n.before):n.region.appendChild(Ke)}function gn(){Ke&&Ke.remove()}function mr(e,t,n){if(e.getAttribute("data-ge-toolbar")==="feature")return oi(e,t,n);var r=e.getAttribute("data-ge-toolbar")==="container",o=e.getAttribute("data-ge-container-type"),i=r?O[o].create({}):li(e.getAttribute("data-ge-layout")),l=i;return r&&!Oe(t.region,".column")&&(l=mn(i)),ie(r?o:"row",i,function(){t.before?t.before.parentNode.insertBefore(l,t.before):t.region.appendChild(l)},{parent:t.region,source:n||"dragdrop"})}function ai(){for(var e=[],t=1;t<=W;t++)e.push(String(t));return{name:"col",values:e.concat(Yn),appliesTo:["column"],labelKey:"utility.col_width",className:function(n,r){return We(ee(n),pn(r))},choices:function(){return s.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,i){return dn(n,r===null?null:pn(r),i,o)},blank:function(n,r){var o=r===Z?null:zt(n,ee(r));return o?m("utility.col_from_row",{count:mo(o.value)}):null}}}function pn(e){return/^\d+$/.test(String(e))?parseInt(e,10):e}function li(e){return/^\s*\{/.test(e||"")?tt(JSON.parse(e)):tt((e||"").split(",").filter(function(t){return t!==""}).map(pn))}function tt(e){var t=Ye();if(Array.isArray(e))return e.forEach(function(r){t.appendChild(Te(r))}),t;Object.keys(e.row_cols||{}).forEach(function(r){var o=e.row_cols[r],i=ee(r);i&&Qe.indexOf(String(o))!==-1&&y(t,Jn(i,o))});for(var n=0;n<(e.columns||0);n++)t.appendChild(Te(null));return t}function si(e){return C.filter(function(t){return e&&e[t.key]!==void 0}).map(function(t){return(t.infix?t.key+": ":"")+e[t.key]}).join(", ")}function di(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 gr(){var e=window.pageYOffset;e>Bt(E).top&&e<Bt(c).top+Mo(c)?b(w,"ge-top")&&(Me(w,{left:Bt(w).left,width:ht(w)}),k(w,"ge-top"),y(w,"ge-fixed")):b(w,"ge-fixed")&&(Me(w,{left:"",width:""}),k(w,"ge-fixed"),y(w,"ge-top"))}function ui(){var e=this;if(!e.getAttribute("data-ge-content-type")&&!be()&&vt(e)){var t=wr();t.length&&(t.length===1?pr(e,t[0]):ci(e,t))}}function pr(e,t){return t.available&&!t.available()?(t.missingKey&&console.error(m(t.missingKey)),!1):Q(function(){var n=re("plain",e,{source:"tool",from:"plain",to:t.type});if(!N("before-convert",n))return!1;y(e,"ge-content-type-"+t.type),e.setAttribute("data-ge-content-type",t.type);var r=e.parentElement;return b(r,"ge-text-block")&&(k(r,"ge-plain-block"),X(r,".ge-tools-drawer").forEach(function(o){o.remove()})),N("after-convert",n),t.edit(e),!0})}function ci(e,t){var n=b(e.parentElement,"ge-text-block")?e.parentElement:null;n&&vr(P(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(){pr(e,r)}}}),"ge-text-picker ge-convert-picker",n)}function vr(e,t,n,r){if(be(),!!e){var o=Y(e,".ge-tools-drawer");o&&y(o,"ge-picker-open"),ne=e.appendChild(y(v("div",{class:"ge-size-picker"}),n||"")),t.forEach(function(i){var l=Ut(v("a",{class:"ge-size ge-size-flex"}),i.attributes||{});l.setAttribute("title",i.title||i.label),l.textContent=i.label,l.addEventListener("click",function(f){f.preventDefault(),f.stopPropagation(),be(),i.choose()}),ne.appendChild(l)}),hr(r||e)}}function hr(e){e.addEventListener("mouseleave",function(){window.setTimeout(function(){ne&&!ne.matches(":hover")&&be()},400)},{once:!0})}function br(){var e={},t=[];return Object.keys(L).forEach(function(n){var r=L[n];r.textTypes&&(r.textTypes()||[]).forEach(function(o){if(e[o.type]){e[o.type]!==n&&K("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 wr(){return br().filter(function(e){return e.offered!==!1})}function fi(e){return br().some(function(t){return t.type===e})}function yr(){Ie(),ve()}function mi(){Ie(),Ee(null),se(null),te.style.height=.8*document.documentElement.clientHeight+"px",te.value=c.innerHTML,Pe(te),ce(c),ye=!0,ae("onSourceOpen",te)}function vn(){ae("onSourceClose",te),ye=!1,mt(c,te.value),Pe(c),ve(),ce(te)}function Cr(){return[".column"].concat(Dt("regions")).join(", ")}function Er(e){return!!e&&e!==c&&c.contains(e)&&Oe(e,Cr())}function Ee(e){if(e!==H){var t=H;t&&k(t,"ge-active-target"),H=e,e&&b(c,"ge-editing")&&y(e,"ge-active-target"),N("target-change",{canvas:c,target:e,from:t})}}function hn(e,t){var n=mr(e,{region:H,before:null},t);n&&n.scrollIntoView&&n.scrollIntoView({behavior:"smooth"})}function ve(){V&&!Le(V.node)&&Ae(),q&&!c.contains(q)&&se(null),de&&de.home&&!Le(de.home)&&we(),Wn(!0),y(c,"ge-editing"),R(c,"ge-drag-drawer",s.drag_handle==="drawer"),da();var e=za();ja(e),Na(e),Ia(),Vi(),Gi(),Ri(),ae("onInit"),va(),ya(),ko(z),rt(c),H&&!c.contains(H)?Ee(null):H&&y(H,"ge-active-target"),ia()}function Ie(){Ae(),aa(),k(c,"ge-editing ge-drag-drawer ge-dropping"),H&&k(H,"ge-active-target"),ae("onBeforeDeinit"),be(),gn(),we(),xr(c),Tt.clear(),_o(c),ae("onDeinit"),St(c),_r(c),Ni(),Ta(),xa(),Wn(!1,c)}function xr(e){_(e,".ge-tools-drawer").forEach(function(t){t.remove()})}function _r(e){_(e,"[data-ge-row-cols]").forEach(function(t){t.removeAttribute("data-ge-row-cols")})}function gi(){var e=[];return[O,L,B].forEach(function(t){Object.keys(t).forEach(function(n){var r=t[n],o=r.unmark||r.onDeinit||r.onBeforeDeinit;o&&!r.cleanMarkup&&e.push(n)})}),e}function pi(){for(var e=c.cloneNode(!0),t=new Map,n=new Map,r=document.createTreeWalker(c,NodeFilter.SHOW_ELEMENT),o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT),i=r.currentNode,l=o.currentNode;i&&l;)t.set(l,i),n.set(i,l),i=r.nextNode(),l=o.nextNode();return{root:e,liveOf:function(f){return t.get(f)||null},copyOf:function(f){return n.get(f)||null}}}function kr(){if(ye)return nt();var e=gi();if(e.length)return e.forEach(function(o){K("snapshot:"+o,'the "'+o+'" plugin has no cleanMarkup, so the canvas leaves editing to be read: open texts and settings panels close')}),nt();var t=pi(),n=t.root;[n].concat(_(n,".ge-active-target, .ge-settings-target")).forEach(function(o){k(o,"ge-active-target ge-settings-target"),gt(o)}),_(n,".ge-drop-marker").forEach(function(o){o.remove()}),xr(n),_o(n);var r=null;return[O,L,B].forEach(function(o){Object.keys(o).forEach(function(i){var l=o[i];r||!l.cleanMarkup||l.cleanMarkup(n,t.liveOf)===!1&&(r=i)})}),r?(K("snapshot-refused:"+r,'the "'+r+'" plugin cannot take its marking off a copy right now, so the canvas leaves editing to be read'),nt()):(St(n),_r(n),_(n,"[data-ge-container]").forEach(Fr),xt.forEach(function(o){var i=t.copyOf(o.el);i&&_(i,"[draggable]").forEach(function(l){l.removeAttribute("draggable")})}),wo(n),Wn(!1,n),Xe(n),n.innerHTML)}function nt(e){if(e&&e.keepEditing)return kr();Ie(),Xe(c);var t=c.innerHTML;return ve(),t}function vi(e){Ie(),Xe(e);var t=e.outerHTML;return ve(),t}function hi(e){return $n(nt(e))}function bi(e){ye&&(vn(),E&&_(E,".gm-edit-mode").forEach(function(t){k(t,"active btn-danger")})),Ie(),mt(c,e),ve()}function wi(){ae("onDestroy"),ye&&vn(),Ie(),H=null,q=null,qt===a&&(qt=null),or(),$r(),uo(),fn(),te.remove(),en.abort(),Xt.delete(c),_t=!0}function yi(){var e=tr=Ci();wn("grid",{},ai()),s.row_cols!==!1&&wn("grid",{},ma());var t=function(r){return!s.plugins||s.plugins.indexOf(r)!==-1},n=function(r,o){return o.always===!0||t(r)};Object.keys(S.containers).forEach(function(r){t(r)&&(O[r]=S.containers[r](e))}),Object.keys(S.features).forEach(function(r){var o=S.features[r];n(r,o)&&(L[r]=o(e))}),Object.keys(S.utilities).forEach(function(r){t(r)&&(B[r]=S.utilities[r](e),(B[r].families||[]).forEach(function(o){wn(r,B[r],o)}))}),Object.keys(L).forEach(function(r){var o=L[r].methods||{};Object.keys(o).forEach(function(i){De[i]=o[i]})}),(s.plugins||[]).forEach(function(r){O[r]||L[r]||B[r]||K("plugin:"+r,'the "'+r+'" plugin is not loaded: include dist/plugins/grideditor.'+r+".js after the editor")})}function ae(e,t){[O,L,B].forEach(function(n){Object.keys(n).forEach(function(r){n[r][e]&&n[r][e](t)})})}function Ci(){return{canvas:c,settings:s,t:m,warn:U,containerId:Dr,freshNode:zi,defaultRegion:ji,createTool:F,createMoveTool:He,addSettingsTool:st,deleteNode:Ne,place:Ht,createPaneControls:Di,makeLabelEditable:Fi,labelIn:Hi,unwrapLabels:Wi,suspendToggles:Hr,resumeToggles:Wr,emit:N,payloadFor:re,operate:Q,kindOf:pe,view:Bn,viewTiers:function(){return Io(z).map(function(e){return e.key})},breakpoints:C.map(function(e){return e.key}),getUtility:Pr,setUtility:En,utilityField:Pi,bareStyle:ki,hostStyle:zr,setHostStyle:Li,openDialog:so,closeDialog:we,rowFromLayout:tt,nodeHtml:vi,snapshotHtml:kr,setHtml:bi,confirm:rr,textReady:qo,attachPicker:Kr,openPicker:vr,closePicker:be,detailsOf:Tn,drawerOf:Ei,refreshToolbar:Zo,toolbarItems:function(e){return E?_(E,'[data-ge-toolbar="feature"][data-ge-feature="'+e+'"]'):[]},getSelected:function(){return le()==="sidebar"?q:null},getActiveTarget:function(){return s.active_target?H:null},setSelected:function(e){var t=le()==="sidebar"&&!!e&&e!==c&&c.contains(e)&&je.has(e);return t&&se(e),t},setActiveTarget:function(e){var t=!!s.active_target&&Er(e);return t&&Ee(e),t},panelOpen:function(){return V||de||j&&b(j,"show")?!0:le()==="inline"&&_(c,".ge-tools-drawer > .ge-details").some(vt)},contains:function(e){return!e||e.nodeType!==1?!1:c.contains(e)||E&&E.contains(e)||J&&J.contains(e)||j&&j.contains(e)?!0:Object.keys(M).some(function(t){return M[t].contains(e)})}}}function Ei(e){if(b(e,"ge-content")){var t=e.parentElement;return b(t,"ge-text-block")?P(t,".ge-tools-drawer"):null}return P(e,".ge-tools-drawer")}var xe={},xi=".row, .column, .ge-content, .ge-element, [data-ge-container]",Ve="data-ge-preview",bn=!1;function wn(e,t,n){var r=n.name||n.prefix;if(xe[r]){U('the "'+e+'" plugin declares the utility "'+r+'", which the "'+xe[r].plugin+'" plugin already declared: ignored');return}xe[r]={plugin:e,family:Object.assign({},n,{name:r,values:n.values.map(String),appliesTo:n.appliesTo||t.appliesTo||["row","column"]})}}function At(e,t){return xe[e]?xe[e].family:(K("utility:"+e,t+"("+JSON.stringify(e)+"): no loaded plugin declares that utility"),null)}function Ar(e,t){return t==="plain"&&(t="text"),e.appliesTo.indexOf(t)!==-1?!0:!!O[t]&&e.appliesTo.indexOf("container")!==-1}function Sr(e){return Object.keys(xe).map(function(t){return xe[t].family}).filter(function(t){return Ar(t,e)})}function yn(e,t,n){return e.className?e.className(t.key,n):e.prefix+(t.infix?"-"+t.infix:"")+"-"+n}function _e(e,t,n){for(var r=(e.getAttribute("class")||"").split(/\s+/),o=0;o<t.values.length;o++)if(r.indexOf(yn(t,n,t.values[o]))!==-1)return t.values[o];return null}function Tr(e,t,n){for(var r=C.indexOf(n)-1;r>=0;r--){var o=_e(e,t,C[r]);if(o!==null)return{tier:C[r],value:o}}return null}function Or(e,t,n){var r=_e(e,t,n);if(r!==null)return r;var o=Tr(e,t,n);return o?o.value:null}function Cn(e,t){return C.map(function(n){return{tier:n,value:_e(e,t,n)}}).filter(function(n){return n.value!==null})}function Lr(e,t,n,r){t.values.forEach(function(o){k(e,yn(t,n,o))}),r!==null&&y(e,yn(t,n,r)),gt(e)}function Mr(e,t,n){return n===Z?_e(e,t,C[0]):Or(e,t,ee(n))}function _i(e,t,n,r){if(n!==Z){var o=ee(n);return _e(e,t,o)===r?null:{writes:[{tier:o,value:r}],cleared:[]}}var i=[],l=[];return Cn(e,t).forEach(function(f){f.tier!==C[0]&&(i.push({tier:f.tier,value:null}),l.push({breakpoint:f.tier.key,value:f.value}))}),_e(e,t,C[0])!==r&&i.unshift({tier:C[0],value:r}),i.length?{writes:i,cleared:l}:null}function Pr(e,t,n){e=oe(e);var r=At(t,"getUtility");if(!r||!e)return null;var o=n===void 0?z:Kn(n);return o===null?(U("getUtility("+JSON.stringify(n)+"): no such layout mode"),null):Mr(e,r,o)}function En(e,t,n,r){r=typeof r=="string"?{view:r}:r||{},e=oe(e);var o=At(t,"setUtility");if(!o||!e)return!1;var i=r.view===void 0?z:Kn(r.view);if(i===null)return U("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 U("setUtility: "+JSON.stringify(n)+' is not a value of "'+t+'", which takes '+JSON.stringify(o.values)),!1;var l=pe(e);if(!Ar(o,l))return U('setUtility: "'+t+'" does not apply to a '+l),!1;if(o.write)return o.write(e,n,i,r.source||"api");var f=_i(e,o,i,n);return f?Q(function(){var u=re(l,e,{family:t,breakpoint:i,tiers:f.writes.map(function(g){return g.tier.key}),from:Mr(e,o,i),to:n,cleared:f.cleared,source:r.source||"api"});return N("before-utility",u)?(f.writes.forEach(function(g){Lr(e,o,g.tier,g.value)}),he(e),N("after-utility",u),!0):(he(e),!1)}):!1}function ki(e,t,n){var r=At(t,"bareStyle");if(e=oe(e),!r||!e)return null;var o=e.getAttribute("class");C.forEach(function(l){Lr(e,r,l,null)});var i=getComputedStyle(e).getPropertyValue(n);return o===null?e.removeAttribute("class"):e.setAttribute("class",o),i}function he(e){var t=Tn(e);if(t){var n=A(t,".ge-classes");n&&(n.value=Sn(e).join(" ")),X(t,".ge-utilities").forEach(function(r){xn(r)})}Rr(e),rt(e)}function Ai(e){return ue(e,xi)}function rt(e){St(e),z!==Z&&Si(e,ee(z)),fa(e),ae("onRefresh",e)}function Si(e,t){Ai(e).forEach(function(n){var r=pe(n),o={};Sr(r).forEach(function(i){!i.preview||!Cn(n,i).length||Object.assign(o,i.preview(Or(n,i,t),n,r))}),r==="column"&&Object.assign(o,ca(n,t)),Object.keys(B).forEach(function(i){var l=B[i];l.preview&&Object.assign(o,l.preview(n,r,t.key))}),Object.keys(o).length&&Ti(n,o)})}function Ti(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(Ve,JSON.stringify(r))}function St(e){ue(e,"["+Ve+"]").forEach(function(t){var n=t.style,r={};try{r=JSON.parse(t.getAttribute(Ve))||{}}catch(o){}Object.keys(r).forEach(function(o){var i=r[o];i&&i[0]?n.setProperty(o,i[0],i[1]):n.removeProperty(o)}),t.removeAttribute(Ve),pt(t)})}function Oi(e){var t=document.createElement("div"),n={};t.style.cssText=e.style.cssText;try{n=JSON.parse(e.getAttribute(Ve))||{}}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 zr(e,t){var n=Oi(e);return t===void 0?n.cssText:{value:n.getPropertyValue(t),priority:n.getPropertyPriority(t)}}function Li(e,t,n,r){if(n=n==null?"":String(n).trim(),r===void 0&&(r=zr(e,t).priority),n!==""){var o=document.createElement("div").style;if(o.setProperty(t,n,r||""),o.getPropertyValue(t)==="")return!1}var i=e.hasAttribute(Ve);return i&&St(e),n===""?e.style.removeProperty(t):e.style.setProperty(t,n,r||""),pt(e),i&&rt(e),!0}function Mi(e){var t=pe(e),n=Sr(t).filter(function(l){return l.panel!==!1}).map(function(l){return jr(e,l)});if(Object.keys(B).forEach(function(l){var f=B[l],u=f.panel?f.panel(e,t):null;u&&n.push(u)}),!n.length)return null;var r=R(v("div",{class:"ge-utilities"}),"ge-open",bn);nr.set(r,e);var o=r.appendChild(v("a",{class:"ge-utilities-toggle"}));o.addEventListener("click",function(){bn=!b(r,"ge-open"),Xr().forEach(function(l){_(l,".ge-utilities").forEach(function(f){R(f,"ge-open",bn)})})});var i=r.appendChild(v("div",{class:"ge-utilities-body"}));return n.forEach(function(l){i.appendChild(l)}),xn(r),r}function jr(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(){En(e,t.name,this.value,{source:"panel"})}),n.appendChild(v("small",{class:"ge-utility-note"})),n}function Pi(e,t){var n=At(t,"utilityField");if(!n)return null;var r=jr(e,n);return _n(r,e),Tt.set(r,e),r}var Tt=new Map;function Rr(e){Tt.forEach(function(t,n){if(!n.isConnected){Tt.delete(n);return}e&&t!==e||Y(n,".ge-utilities")||_n(n,t)})}function xn(e){var t=nr.get(e);X(e,".ge-utilities-toggle").forEach(function(n){n.textContent=m("utility.section",{view:m(wt(z))})}),_(e,".ge-utility").forEach(function(n){_n(n,t)})}function _n(e,t){var n=xe[e.getAttribute("data-ge-family")].family,r=P(e,"select"),o=n.choices?n.choices(t,pe(t)):n.values,i,l,f="";if(r.innerHTML="",z===Z){i=_e(t,n,C[0]),l=m("utility.default");var u=Cn(t,n).filter(function(I){return I.tier!==C[0]});u.length&&(f=m("utility.varies",{breakpoints:u.map(function(I){return I.tier.key}).join(", ")}))}else{var g=ee(z),h=Tr(t,n,g);i=_e(t,n,g),l=h?m("utility.inherit",{value:Nr(n,h.value),breakpoint:h.tier.key}):m("utility.default");var x=n.blank?n.blank(t,z):null;x&&i===null&&(l=x)}i!==null&&o.indexOf(i)===-1&&(o=o.concat([i])),r.appendChild(v("option",{value:""},l)),o.forEach(function(I){r.appendChild(v("option",{value:I},Nr(n,I)))}),r.value=i===null?"":i;var T=P(e,".ge-utility-note");T.textContent=f,Gn(T,f!=="")}function Nr(e,t){return e.label?e.label(t):t}var O={},L={},B={},De={},Ir=0;function Dr(e){return Ir++,"ge-"+e+"-"+Ir+"-"+Math.random().toString(36).slice(2,6)}function zi(e){var t=G(e),n={},r=function(o){return!!document.getElementById(o)||Object.keys(n).some(function(i){return n[i]===o})};return ue(t,"[id]").forEach(function(o){var i=o.id;if(document.getElementById(i)){var l=Ja.exec(i),f;if(l)do f=Dr(l[1]);while(r(f));else{for(var u=2;r(i+"-"+u);)u++;f=i+"-"+u}n[i]=f,o.id=f}}),Object.keys(n).length&&ue(t,"*").forEach(function(o){Ya.forEach(function(i){var l=o.getAttribute(i);if(l!==null&&!(i==="href"&&l.charAt(0)!=="#")){var f=l.split(/(\s+)/).map(function(u){return n[u]?n[u]:u.charAt(0)==="#"&&n[u.slice(1)]?"#"+n[u.slice(1)]:u}).join("");f!==l&&o.setAttribute(i,f)}})}),t}function ji(){var e=Ye();return e.appendChild(Te(W)),e}function Fe(e){return e?e.getAttribute("data-ge-container"):null}function Ri(){_(c,"[data-ge-container]").forEach(function(e){var t=Fe(e),n=O[t];if(!n){K("container:"+t,'unknown container type "'+t+'"');return}y(e,"ge-container ge-container-"+t),n.mark(e),P(e,".ge-tools-drawer")||Ii(e,t,n)})}function Ni(){_(c,"[data-ge-container]").forEach(function(e){var t=O[Fe(e)];t&&t.unmark(e),Fr(e)})}function Fr(e){k(e,"ge-container ge-container-"+Fe(e)),gt(e)}function Ge(e,t){var n=v("div",{class:t});return e.insertBefore(n,e.firstChild),n}function Ot(e,t){(t||[]).forEach(function(n){F(e,n.title||"",n.className||"",n.iconClass||"bi bi-wrench",n.on)})}function Ii(e,t,n){var r=Ge(e,"ge-tools-drawer ge-container-drawer");He(r),st(r,e,s.container_classes),Ot(r,s.container_tools),n.tools&&n.tools(r,e),F(r,m("tool.delete_container"),"ge-delete-container","bi bi-trash",function(){Ne(t,e,m("confirm.delete_container"),function(o){bt(e,o)})}),n.addPane&&F(r,m(n.addPaneKey),"ge-add-pane","bi bi-plus-circle",function(){var o=n.addPane(e,{});o&&ie(n.paneKind,o,function(){},{parent:e,source:"tool",container:e})})}function Di(e,t,n,r,o){var i=Ge(e,"ge-tools-drawer ge-pane-drawer");return He(i),st(i,e,s.pane_classes),Ot(i,n),F(i,m("tool.delete_pane"),"ge-delete-pane","bi bi-trash",function(){Ne(t,e,r,function(l){o(l)})}),i}var Lt=["toggle","dismiss","slide","slide-to","ride"];function Hr(e){e&&ue(e,Lt.map(function(t){return"[data-bs-"+t+"]"}).join(", ")).forEach(function(t){Lt.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 Wr(e){e&&ue(e,Lt.map(function(t){return"[data-ge-bs-"+t+"]"}).join(", ")).forEach(function(t){Lt.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 Fi(e){if(!Zt.has(e)){var t=Y(e,"[data-bs-toggle], [data-ge-bs-toggle]");Zt.add(e),e.setAttribute("title",m("tool.rename")),e.addEventListener("dblclick",function(n){n.preventDefault(),n.stopPropagation(),Hr(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"),Wr(t)})}}function Hi(e){var t=P(e,".ge-pane-label");return t||(t=v("span",{class:"ge-pane-label"},e.textContent.trim()),e.innerHTML="",e.appendChild(t)),t}function Wi(e){_(e,".ge-pane-label").forEach(function(t){Zt.delete(t),Gt(t)})}function Ur(e,t){var n=Te(t);return ie("column",n,function(){e.appendChild(n)},{parent:e,source:"tool"})}function Ui(e,t){!s.add_column.picker||!e||Kr(e,function(){Ki(e,t)})}function Kr(e,t){var n=null,r=function(){window.clearTimeout(n),n=null};fe(e,"mouseenter mousedown",function(){n||ne||(n=window.setTimeout(function(){n=null,t()},s.add_column.delay))}),fe(e,"mouseleave mouseup",r)}function Ki(e,t){be();var n=Rn(t,ke()),r=Y(e,".ge-tools-drawer");r&&y(r,"ge-picker-open"),ne=e.appendChild(v("div",{class:"ge-size-picker"})),s.valid_col_sizes.forEach(function(o){var i=v("a",{class:"ge-size","data-ge-size":o,title:Bi(o)},$(o)?o:We(C[0],o));R(i,"ge-size-tight",$(o)&&o>n),R(i,"ge-size-flex",!$(o)),i.addEventListener("click",function(l){l.preventDefault(),l.stopPropagation(),be(),Ur(t,o)}),ne.appendChild(i)}),hr(e)}function Bi(e){return e==="equal"?m("tool.column_equal"):e==="auto"?m("tool.column_auto"):m("tool.column_size",{size:e})}function be(){if(!ne)return!1;var e=Y(ne,".ge-tools-drawer");return e&&k(e,"ge-picker-open"),ne.remove(),ne=null,!0}function Vi(){_(c,".row").forEach(function(e){if(!P(e,".ge-tools-drawer")){var t=Ge(e,"ge-tools-drawer");He(t),st(t,e,s.row_classes),Ot(t,s.row_tools),F(t,m("tool.delete_row"),"ge-delete-row","bi bi-trash",function(){Ne("row",e,m("confirm.delete_row"),function(n){bt(e,n)})}),F(t,m("tool.add_column"),"ge-add-column","bi bi-plus-circle",function(){be()||Ur(e,ct(e,ke())?null:s.add_column.size)}),Ui(P(t,".ge-add-column"),e)}})}function Gi(){_(c,".column").forEach(function(e){if(!P(e,".ge-tools-drawer")){var t=Ge(e,"ge-tools-drawer");He(t),s.resize.tools!==!1&&(F(t,m("tool.column_narrower"),"ge-decrease-col-width","bi bi-dash-lg",function(n){dn(e,n.shiftKey?lt(s.valid_col_sizes):Mt(s.valid_col_sizes.filter($),it(e),-1),"tool")}),F(t,m("tool.column_wider"),"ge-increase-col-width","bi bi-plus-lg",function(n){dn(e,n.shiftKey?qi(e):Mt(s.valid_col_sizes.filter($),it(e),1),"tool")})),s.indent.tools!==!1&&(F(t,m("tool.indent_decrease"),"ge-decrease-col-offset","bi bi-text-indent-right",function(n){ar(e,n.shiftKey?lt(s.valid_col_offsets):Mt(s.valid_col_offsets,at(e),-1),"tool")}),F(t,m("tool.indent_increase"),"ge-increase-col-offset","bi bi-text-indent-left",function(n){ar(e,n.shiftKey?Xi(e):Mt(s.valid_col_offsets,at(e),1),"tool")})),st(t,e,s.col_classes),Ot(t,s.col_tools),F(t,m("tool.delete_column"),"ge-delete-column","bi bi-trash",function(){Ne("column",e,m("confirm.delete_column"),function(n){jo(e,400,n,!0)})}),F(t,m("tool.add_row"),"ge-add-row","bi bi-plus-circle",function(){var n=Ye();ie("row",n,function(){e.appendChild(n)},{parent:e,source:"tool"})})}})}function ke(){return z===Z?C[C.length-1]:ee(z)}function ot(e){var t=ke();if(zt(e,t))return null;var n=zn(e,t);return n===null?W:n}function it(e){var t=ot(e);if($(t))return t;var n=Math.round(ht(e)/Br(e.parentElement)*W);return Math.min(Math.max(n,1),W)}function Br(e){var t=window.getComputedStyle(e);return e.clientWidth-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight)}function at(e){return Rt(e,ke())||0}function Mt(e,t,n){var r=e.indexOf(t);return r===-1?e.reduce(function(o,i){return Math.abs(i-t)<Math.abs(o-t)?i:o},e[0]):e[Math.min(Math.max(r+n,0),e.length-1)]}function lt(e){return e.filter($).reduce(function(t,n){return Math.min(t,n)},W)}function kn(e){return e.filter($).reduce(function(t,n){return Math.max(t,n)},0)}function qi(e){var t=Rn(e.parentElement,ke(),e)-at(e);return Math.min(kn(s.valid_col_sizes),Math.max(t,1))}function Xi(e){var t=Rn(e.parentElement,ke(),e)-it(e);return Math.min(kn(s.valid_col_offsets),Math.max(t,0))}function He(e){return s.drag_handle==="drawer"?null:F(e,m("tool.move"),"ge-move","bi bi-arrows-move")}var An=".ge-tools-drawer:not(.ge-text-drawer):not(.ge-pane-drawer):not(.ge-code-inline)";function Yi(){if(s.drawer_overflow==="wrap"||!window.ResizeObserver||!window.MutationObserver)return;var e=new Set,t=null;function n(l){e.add(l),t===null&&(t=window.requestAnimationFrame(r))}function r(){t=null;var l=Array.from(e);e.clear(),l.forEach(function(f){if(!f.isConnected){o.unobserve(f);return}Ji(f)})}var o=new window.ResizeObserver(function(l){l.forEach(function(f){n(f.target)})}),i=new window.MutationObserver(function(l){l.forEach(function(f){var u=f.target;if(f.type==="attributes"){var g=u.parentNode;g&&g.nodeType===1&&g.matches(An)&&n(g);return}if(u.nodeType===1&&u.matches(An)){n(u);return}f.addedNodes.forEach(function(h){h.nodeType===1&&ue(h,An).forEach(function(x){y(x,"ge-drawer-fit"),o.observe(x),n(x)})})})});i.observe(c,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]}),en.signal.addEventListener("abort",function(){i.disconnect(),o.disconnect(),t!==null&&window.cancelAnimationFrame(t)})}function Ji(e){var t=X(e,"a").filter(function(o){return!b(o,"ge-drawer-more")}),n=b(e,"ge-drawer-expanded");if(k(e,"ge-drawer-overflow ge-drawer-expanded"),t.forEach(function(o){k(o,"ge-tool-overflow")}),!!Vr(e,t)){y(e,"ge-drawer-overflow"),P(e,".ge-drawer-more")||F(e,m("tool.more"),"ge-drawer-more","bi bi-three-dots",function(){R(e,"ge-drawer-expanded")});for(var r=t.length-1;r>=0&&Vr(e,t);r--)y(t[r],"ge-tool-overflow");R(e,"ge-drawer-expanded",n)}}function Vr(e,t){var n=window.getComputedStyle(e),r=e.getBoundingClientRect().right-parseFloat(n.borderRightWidth)-parseFloat(n.paddingRight);return t.some(function(o){var i=o.getClientRects();return i.length>0&&i[0].right>r+.5})}function F(e,t,n,r,o){var i=v("a",{title:t,class:n});return i.appendChild(v("i",{class:r})),e.appendChild(i),typeof o=="function"&&i.addEventListener("click",o),o&&typeof o=="object"&&Object.keys(o).forEach(function(l){fe(i,l,o[l])}),i}function Sn(e){return(e.getAttribute("class")||"").split(/\s+/).filter(function(t){return t!==""&&!$i(t)})}function $i(e){return e==="row"||e==="column"||/^(ge-|ui-)/.test(e)||/^col(-(sm|md|lg|xl|xxl))?(-auto)?$/.test(e)?!0:C.some(function(t){return new RegExp("^("+t.colPrefix+"|"+t.offsetPrefix+")\\d+$").test(e)})}function Qi(e,t){Sn(e).forEach(function(n){k(e,n)}),t.split(/\s+/).forEach(function(n){n!==""&&y(e,n)}),gt(e)}function st(e,t,n){var r=Zi(t,n||[]);je.set(t,r),le()!=="sidebar"&&F(e,m("tool.settings"),"ge-settings","bi bi-gear-fill",function(){ta(t,r,this)});var o=pe(t);return Object.keys(B).forEach(function(i){B[i].drawerTools&&B[i].drawerTools(e,t,o)}),Object.keys(L).forEach(function(i){L[i].drawerTools&&L[i].drawerTools(e,t,o)}),e.appendChild(r)}function Zi(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(g){var h=v("label",{class:"ge-field"});return h.appendChild(v("span",{class:"ge-field-label"},g)),r.appendChild(h)},i=v("input",{class:"ge-id form-control form-control-sm",placeholder:m("tool.id_placeholder"),title:m("tool.id_title")});i.value=e.getAttribute("id")||"",o(m("panel.id")).appendChild(i),i.addEventListener("change",function(){this.value===""?e.removeAttribute("id"):e.setAttribute("id",this.value)});var l=v("input",{class:"ge-classes form-control form-control-sm",placeholder:m("tool.classes_placeholder"),title:m("tool.classes_title")});l.value=Sn(e).join(" "),o(m("panel.classes")).appendChild(l),l.addEventListener("change",function(){Qi(e,this.value),he(e)});var f=r.appendChild(v("div",{class:"btn-group btn-group-sm ge-presets",role:"group"}));t.forEach(function(g){var h=b(e,g.cssClass),x=v("a",{role:"button",class:"btn btn-sm btn-outline-secondary",title:g.title?g.title:m("tool.toggle_class",{label:g.label}),"aria-pressed":h?"true":"false"});x.innerHTML=g.label,R(x,"active",h),x.addEventListener("click",function(){R(x,"active"),x.setAttribute("aria-pressed",b(x,"active")?"true":"false"),R(e,g.cssClass,b(x,"active")),he(e)}),f.appendChild(x)}),ea(e).forEach(function(g){n.appendChild(g)});var u=Mi(e);return u&&n.appendChild(u),n}function Gr(e){return v("h6",{class:"ge-section-title"},e)}function ea(e){var t=pe(e),n=le(),r=[];return[O,L,B].forEach(function(o){Object.keys(o).forEach(function(i){var l=o[i],f=l.panelSection?l.panelSection(e,t):null;if(!(!f||!f.body)){var u=v("div",{class:"ge-panel-section","data-ge-plugin":i});if(n==="offcanvas"||n==="modal"||n==="sidebar")u.appendChild(Gr(m(f.labelKey))),u.appendChild(f.body);else{var g=m(f.labelKey),h=u.appendChild(v("button",{type:"button",class:"btn btn-sm btn-outline-secondary ge-panel-section-open"},g));ce(f.body),u.appendChild(f.body),h.addEventListener("click",function(){so(f.titleKey?m(f.titleKey,{kind:Pn(e)}):g,f.body,h)})}r.push(u)}})}),r}var qr=["offcanvas","popover","modal","inline","sidebar"],M={},V=null,Pt=new WeakMap;function le(){return qr.indexOf(s.settings_panel)!==-1?s.settings_panel:(K("settings_panel",'settings_panel "'+s.settings_panel+'" is not one of '+qr.join(", ")+": using offcanvas"),"offcanvas")}function Tn(e){return e&&je.get(e)||null}function Xr(){var e=[c];return V&&V.mode!=="inline"&&e.push(V.details),Se&&e.push(Se.details),e}function ta(e,t,n){var r=le();if(r==="inline"){Gn(t);return}var o=V&&V.details===t;Ae(),o||na(r,e,t,n)}function na(e,t,n,r){var o=Jr(e),i=new AbortController;V={mode:e,node:t,details:n,home:n.parentElement,next:n.nextElementSibling,gear:r,listening:i},A(o,".ge-settings-title").textContent=m("panel.title",{kind:Pn(t)}),A(o,".ge-settings-body").appendChild(n),Pe(n),y(t,"ge-settings-target");var l={signal:i.signal};if(document.addEventListener("keydown",function(u){u.key==="Escape"&&!de&&Ae()},l),e==="offcanvas"){var f=window.innerWidth<576;R(o,"offcanvas-end",!f),R(o,"offcanvas-bottom",f),k(o,"hiding"),o.getBoundingClientRect(),y(o,"show")}else e==="popover"?(On(o,r),fe(window,"scroll resize",function(){On(o,r)},l),window.ResizeObserver&&(V.observer=new window.ResizeObserver(function(){On(o,r)}),V.observer.observe(n)),fe(document,"mousedown touchstart",function(u){!de&&!o.contains(u.target)&&!r.contains(u.target)&&Ae()},l)):Ln(o,function(){V&&V.mode==="modal"&&Ae()})}function Ae(){we();var e=V;if(e){V=null;var t=M[e.mode];e.listening.abort(),e.observer&&e.observer.disconnect(),e.mode==="offcanvas"?(k(t,"show"),y(t,"hiding"),window.setTimeout(function(){k(t,"hiding")},300)):e.mode==="popover"?ce(t):Mn(t),Yr(e)}}function Yr(e){k(e.node,"ge-settings-target"),e.details.style.removeProperty("display"),pt(e.details),e.home&&Le(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 Jr(e){if(M[e])return M[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=G('<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>'),A(n,".offcanvas-header").appendChild(t())):e==="popover"?(n=G('<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>'),A(n,".popover-header").appendChild(t()),ce(n)):e==="sidebar"?(n=G('<div class="offcanvas offcanvas-end ge-settings-panel ge-settings-sidebar" tabindex="-1" role="complementary"><div class="offcanvas-header"><h5 class="offcanvas-title ge-settings-title"></h5></div><div class="offcanvas-body ge-settings-body"></div></div>'),n.id="ge-settings-sidebar-"+er,A(n,".offcanvas-header").appendChild(t()),M["sidebar-toggle"]=document.body.appendChild(ra(n))):(n=G('<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>'),A(n,".modal-header").appendChild(t()),A(n,".modal-footer").appendChild(v("button",{type:"button",class:"btn btn-primary ge-settings-close"},m("panel.done")))),$e(n,"click",".ge-settings-close",function(r){r.preventDefault(),e==="sidebar"?se(null):Ae()}),M[e]=document.body.appendChild(n),n}function $r(){Ae(),ro(),k(document.documentElement,"ge-sidebar-open"),Object.keys(M).forEach(function(e){e==="modal"?rn(M[e]):M[e].remove()}),Object.keys(M).forEach(function(e){lo(M[e])}),M={}}var Qr=576,Se=null,dt=null;function ut(){return b(c,"ge-editing")}function ra(e){var t=v("button",{type:"button",class:"ge-sidebar-toggle","aria-controls":e.id});return t.appendChild(v("i")),t.addEventListener("click",function(){oa(!Be)}),t}function oa(e){Be=e,Zr()}function Zr(){var e=M.sidebar,t=M["sidebar-toggle"];if(e){var n=!Be;n&&!b(e,"show")?(k(e,"hiding"),e.getBoundingClientRect(),y(e,"show")):!n&&b(e,"show")&&(k(e,"show"),y(e,"hiding"),window.setTimeout(function(){k(e,"hiding")},300));var r=m(n?"panel.collapse":"panel.expand");t.setAttribute("aria-expanded",n?"true":"false"),t.setAttribute("aria-label",r),t.setAttribute("title",r),A(t,"i").className="bi "+(n?"bi-chevron-right":"bi-chevron-left"),eo()}}function eo(){R(document.documentElement,"ge-sidebar-open",!!M.sidebar&&ut()&&!Be&&window.innerWidth>=Qr)}function ia(){if(le()==="sidebar"){var e=Jr("sidebar");Be===null&&(Be=window.innerWidth<Qr),e.style.removeProperty("display"),M["sidebar-toggle"].style.removeProperty("display"),oo(),Zr()}}function aa(){no();var e=M.sidebar;e&&(e.style.display="none",M["sidebar-toggle"].style.display="none",k(document.documentElement,"ge-sidebar-open"))}function to(e){var t=M.sidebar;A(t,".ge-settings-title").textContent=e,t.setAttribute("aria-label",e)}function no(){var e=Se;Se=null,e&&Yr(e)}function ro(){no(),dt&&(dt.body.remove(),dt=null)}function oo(){var e=M.sidebar;if(!(!e||!ut())){var t=q?Tn(q):null;if(!(t?Se&&Se.details===t:!Se&&dt)){ro();var n=A(e,".ge-settings-body");if(!t){var r=la(),o=r?r.body:v("p",{class:"ge-sidebar-empty"},m("panel.sidebar_empty"));to(r?r.title:m("panel.sidebar_title")),n.appendChild(o),dt={body:o};return}Se={node:q,details:t,home:t.parentElement,next:t.nextElementSibling},to(m("panel.title",{kind:Pn(q)})),n.appendChild(t),Pe(t),y(q,"ge-settings-target")}}}function la(){var e=s.sidebar.empty,t=null;return typeof e=="function"?t=io(e(a),function(n){return n.title}):e!=null&&K("sidebar.empty","sidebar.empty is a function(ge) returning { title, body }, not "+typeof e+": ignored"),[O,L,B].forEach(function(n){Object.keys(n).forEach(function(r){var o=n[r];t||!o.sidebarEmpty||(t=io(o.sidebarEmpty(tr),function(i){return typeof i.titleKey=="string"&&i.titleKey!==""?m(i.titleKey):""}))})}),t}function io(e,t){if(!e||!e.body||e.body.nodeType!==1)return null;var n=t(e);return{title:typeof n=="string"&&n!==""?n:m("panel.sidebar_title"),body:e.body}}function ao(e){var t=Y(e,".ge-tools-drawer",c);if(t){var n=t.parentElement,r=je.has(n)?n:X(n).filter(function(i){return je.has(i)})[0];if(r)return r}for(var o=e;o&&o!==c;o=o.parentElement)if(je.has(o))return o;return null}function se(e){if(e!==q){var t=q;q=e,oo(),N("selection-change",{canvas:c,node:e,from:t})}}function On(e,t){if(Le(t)){Pe(e);var n=t.getBoundingClientRect(),r=8,o=P(e,".popover-body");o.style.removeProperty("max-height");var i=ht(e),l=Kt(e),f=window.innerHeight-n.bottom-2*r,u=n.top-2*r,g=l<=f||f>=u,h=g?f:u;l>h&&(Me(o,{"max-height":Math.max(120,h-(l-Kt(o)))}),l=Kt(e));var x=g?n.bottom+r:n.top-r-l,T=Math.max(r,Math.min(n.left+n.width/2-24,window.innerWidth-i-r));R(e,"bs-popover-bottom",g),R(e,"bs-popover-top",!g),Me(e,{top:x+window.pageYOffset,left:T+window.pageXOffset}),Me(P(e,".popover-arrow"),{left:Math.max(r,Math.min(n.left+n.width/2-T-8,i-24))})}}function Ln(e,t){var n=yt(),r=Pt.get(e);if(r||(r={wanted:null,busy:!1,backdrop:null,dismissed:t},Pt.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)),y(e,"show"),e.style.display="block",e.removeAttribute("aria-hidden");return}var o=n.getOrCreateInstance(e);r.watched||(r.watched=!0,ir(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"&&Mn(e)}),e.addEventListener("hidden.bs.modal",function(){r.busy=!1,r.wanted==="open"?Ln(e,r.dismissed):r.dismissed()})),r.wanted="open",r.busy||(r.busy=!0,o.show())}function Mn(e){var t=yt(),n=Pt.get(e);if(n){if(n.wanted="closed",!t){n.backdrop&&(n.backdrop.remove(),n.backdrop=null),k(e,"show"),e.style.removeProperty("display"),e.setAttribute("aria-hidden","true");return}!n.busy&&b(e,"show")&&(n.busy=!0,t.getOrCreateInstance(e).hide())}}function lo(e){var t=Pt.get(e);t&&t.backdrop&&(t.backdrop.remove(),t.backdrop=null)}var J=null,de=null;function sa(){return J||(J=G('<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>'),A(J,".modal-header").appendChild(v("button",{type:"button",class:"btn-close ge-dialog-close","aria-label":m("panel.close")})),A(J,".modal-footer").appendChild(v("button",{type:"button",class:"btn btn-primary ge-dialog-close"},m("panel.done"))),$e(J,"click",".ge-dialog-close",function(e){e.preventDefault(),we()}),document.body.appendChild(J))}function so(e,t,n){we();var r=sa(),o=new AbortController;de={body:t,home:t.parentElement,next:t.nextElementSibling,opener:n||document.activeElement,listening:o},A(r,".ge-dialog-title").textContent=e,A(r,".ge-dialog-body").appendChild(t),Pe(t),yt()||document.addEventListener("keydown",function(i){i.key==="Escape"&&we()},{signal:o.signal}),Object.keys(M).forEach(function(i){y(M[i],"ge-under-dialog")}),Ln(r,function(){we()})}function we(){var e=de;e&&(de=null,e.listening.abort(),Mn(J),Object.keys(M).forEach(function(t){k(M[t],"ge-under-dialog")}),ce(e.body),e.home&&Le(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&&Le(e.opener)&&e.opener.focus&&e.opener.focus())}function uo(){we(),J&&(lo(J),rn(J),J=null)}function Pn(e){var t=pe(e);if(O[t]&&O[t].labelKey)return m(O[t].labelKey);var n=Object.keys(O).filter(function(r){return O[r].paneKind===t&&O[r].paneLabelKey})[0];if(n)return m(O[n].paneLabelKey);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 da(){_(c,'.column, div[class*="col-"], div.col').forEach(function(e){y(e,"column"),!(ga(e).length||co(e.parentElement))&&Nt(e,C[0],W)})}function co(e){return b(e,"row")&&C.some(function(t){return Qe.some(function(n){return b(e,Jn(t,n))})})}function ct(e,t){if(!b(e,"row"))return null;for(var n=C.indexOf(t);n>=0;n--)for(var r=0;r<Qe.length;r++)if(b(e,Jn(C[n],Qe[r])))return{tier:n,value:Qe[r]};return null}function fo(e,t){for(var n=C.indexOf(t);n>=0;n--){var r=qe(e,C[n]);if(r!==null)return{tier:n,size:r}}return null}function zt(e,t){var n=ct(e.parentElement,t);if(!n)return null;var r=fo(e,t);return!r||n.tier>r.tier||n.tier===r.tier&&r.size==="equal"?n:null}function ua(e){return e.value==="auto"?0:W/parseInt(e.value,10)}function ca(e,t){var n=zt(e,t);return n?{flex:"0 0 auto",width:n.value==="auto"?"auto":100/parseInt(n.value,10)+"%","max-width":"100%"}:co(e.parentElement)&&!fo(e,t)?{flex:"0 0 auto",width:"100%","max-width":"100%"}:{}}function fa(e){ue(e,".row").forEach(function(t){var n=s.row_cols===!1?null:z===Z?ct(t,C[0])||null:ct(t,ee(z));n?t.setAttribute("data-ge-row-cols",mo(n.value)):t.removeAttribute("data-ge-row-cols")})}function mo(e){return e==="auto"?m("badge.row_cols_auto"):m("badge.row_cols",{count:e})}function ma(){return{name:"row-cols",prefix:"row-cols",values:Qe,appliesTo:["row"],labelKey:"utility.row_cols"}}function qe(e,t){var n=po(e,t.colPrefix);return n!==null?n:b(e,We(t,"auto"))?"auto":b(e,We(t,"equal"))?"equal":null}function jt(e,t){return po(e,t.offsetPrefix)}function zn(e,t){return go(e,t,qe)}function Rt(e,t){return go(e,t,jt)}function go(e,t,n){for(var r=C.indexOf(t);r>=0;r--){var o=n(e,C[r]);if(o!==null)return o}return null}function po(e,t){var n=new RegExp("(?:^|\\s)"+t+"(\\d+)(?:\\s|$)").exec(e.getAttribute("class")||"");return n?parseInt(n[1],10):null}function vo(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 Nt(e,t,n){vo(e,t.colPrefix,null),Yn.forEach(function(r){k(e,We(t,r))}),n!=null&&y(e,We(t,n))}function jn(e,t,n){vo(e,t.offsetPrefix,n||null)}function ga(e){return C.filter(function(t){return qe(e,t)!==null})}function Rn(e,t,n){var r=0;return X(e,".column").forEach(function(o){if(!(n&&o===n)){var i=zt(o,t),l=i?ua(i):zn(o,t);r+=($(l)?l:0)+(Rt(o,t)||0)}}),W-r}function It(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),No),t===null||!$(t)?{size:t,offset:n,refused:!1}:(t=Math.min(Math.max(t,1),W),t+n<=W?{size:t,offset:n,refused:!1}:e.leading==="offset"?{size:W-n,offset:n,refused:!1}:{size:null,offset:n,refused:!0})}function Xe(e){ue(e,".column").forEach(function(t){Me(t,{width:"",height:"",left:"",top:""}),pt(t)})}function ho(e){return"ge-"+e+"-"+er}function Nn(){return[".row",".ge-text-block",".ge-content","[data-ge-container]"].concat(Dt("blocks")).join(", ")}function Dt(e){return Object.keys(L).map(function(t){return L[t][e]||null}).filter(function(t){return t!==null})}function In(e,t){var n=!0;return Object.keys(L).forEach(function(r){var o=L[r];n&&o.accepts&&o.accepts(e,t)===!1&&(n=!1)}),n}function pa(){return s.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 Ft(e,t){var n=Fo();if(e=Array.isArray(e)?e:e?[e]:[],!(!e.length||!n)){var r=s.drag_handle==="drawer",o=pa(),i=0;e.forEach(function(l){var f=t.group?{name:ho(t.group)}:{name:ho(t.draggable+"-"+ ++i),pull:!1,put:!1};t.group&&t.accepts&&(f.put=function(u,g,h){return g.options.group.name===f.name&&t.accepts(u.el,h)}),xt.push(n.create(l,Object.assign({group:f,draggable:t.draggable,handle:r?".ge-tools-drawer":".ge-tools-drawer .ge-move",filter:function(u,g){return Y(u.target,o,l)?!0:!g||g.parentNode!==l},preventOnFilter:!1,forceFallback:!0,fallbackOnBody:!1,ghostClass:"ge-drag-placeholder",chosenClass:"ge-drag-chosen",dragClass:"ge-drag-helper",fallbackClass:"ge-drag-helper",animation:s.drag.animation,delay:s.drag.delay||s.drag.touch_delay,delayOnTouchOnly:!s.drag.delay,touchStartThreshold:s.drag.threshold,scroll:s.drag.scroll,onStart:ha,onEnd:wa},t.options||{})))})}}function va(){if(!Fo()){K("sortable_missing",m("error.sortable_missing"));return}Ft(_(c,".row"),{draggable:".column",group:"column"}),Ft([c].concat(_(c,".column")),{draggable:Nn(),group:"block",accepts:In});var e=Dt("regions");e.length&&Ft(_(c,e.join(", ")),{draggable:">"+Nn(),group:"block",accepts:In}),ae("onSortable",Ft)}function ha(e){var t=e.item,n=un(t),r=bo(t),o={from:n,canceled:!1};Qt.set(t,o),Q(function(){var i=N("before-move",re(r.kind,r.node,{parent:n.parent,source:"dragdrop",from:n}));i||(o.canceled=!0)})}function bo(e){var t=b(e,"ge-text-block")&&P(e,".ge-content")||e;return{kind:pe(t),node:t}}function ba(e,t){var n=X(t.parent).filter(function(r){return r!==e&&!b(r,"ge-tools-drawer")});!n.length||t.index>=n.length?t.parent.appendChild(e):t.parent.insertBefore(e,n[t.index])}function wa(e){var t=e.item,n=Qt.get(t),r=n?n.from:un(t);if(Qt.delete(t),n&&n.canceled){ba(t,r);return}var o=un(t);if(!(o.parent===r.parent&&o.index===r.index)){var i=Y(t,"[data-ge-container]"),l=O[Fe(i)];l&&l.afterPaneMove&&l.afterPaneMove(i,t,r);var f=bo(t);Q(function(){N("after-move",re(f.kind,f.node,{parent:o.parent,source:"dragdrop",from:r,to:o,container:i||void 0}))})}}function ya(){s.resize.enabled&&_(c,".column").forEach(function(e){if(!P(e,".ge-resize-handle")){var t=P(e,".ge-tools-drawer");t&&t.appendChild(v("span",{class:"ge-resize-size"})),Ca().forEach(function(n){var r=v("span",{class:"ge-resize-handle ge-resize-"+n,"data-ge-edge":n});r.addEventListener("pointerdown",Ea),e.appendChild(r)})}})}function Ca(){return String(s.resize.handles).split(",").map(function(e){return e.trim()}).filter(function(e){return e==="e"||e==="w"})}function Ea(e){var t=e.currentTarget,n=t.parentElement,r=t.getAttribute("data-ge-edge")==="w",o=e.pageX,i=ht(n);if(e.preventDefault(),!_a(n))return;y(n,"ge-resizing"),e.pointerId!==void 0&&t.setPointerCapture&&t.setPointerCapture(e.pointerId);function l(g){var h=g.pageX-o;return Math.max(1,i+(r?-h:h))}function f(g){n.style.width=l(g)+"px",ka(n,l(g))}function u(g){t.removeEventListener("pointermove",f),qn(t,"pointerup pointercancel",u),k(n,"ge-resizing"),Aa(n,l(g))}t.addEventListener("pointermove",f),fe(t,"pointerup pointercancel",u)}function xa(){wo(c)}function wo(e){_(e,".ge-resize-handle").forEach(function(t){t.remove()}),_(e,".ge-resize-size").forEach(function(t){t.remove()}),Xe(e)}function yo(e,t){var n=Math.round(t/Br(e.parentElement)*W),r=Co(e),o=r?ot(r):null,i=kt.get(e),l=i?i.units:it(e),f=r&&$(o)?l+o-lt(s.valid_col_sizes):W-at(e);return Math.min(Math.max(n,lt(s.valid_col_sizes)),Math.max(f,lt(s.valid_col_sizes)),kn(s.valid_col_sizes))}function Co(e){return s.resize.balance!=="next"?null:Oo(e,".column")[0]||null}function Dn(e,t){var n=P(e,".ge-tools-drawer"),r=n?P(n,".ge-resize-size"):null;r&&(r.textContent=t)}function Eo(e){return(z===Z?C[0].colPrefix:ke().colPrefix)+e}function _a(e){var t=ot(e),n=Q(function(){return N("before-resize",re("column",e,{source:"dragdrop",from:t,to:null}))});if(!n)return!1;var r={from:t,units:it(e)};return kt.set(e,r),Dn(e,Eo(r.units)),!0}function ka(e,t){Dn(e,Eo(yo(e,t)))}function Aa(e,t){var n=kt.get(e),r=yo(e,t);if(kt.delete(e),Dn(e,""),Xe(e),!!n&&r!==n.units){var o=an(e,r);o&&Q(function(){ln(e,o),Sa(e,r-n.units),he(e),N("after-resize",re("column",e,sn({source:"dragdrop",from:n.from,to:o.size},o.cleared)))})}}function Sa(e,t){var n=Co(e);if(!(!n||!t)){var r=ot(n);if($(r)){var o=an(n,r-t);o&&(ln(n,o),he(n))}}}function Ta(){xt.forEach(function(e){e.destroy()}),xt=[]}function Ye(){return v("div",{class:"row"})}function Ht(e,t,n){var r=null;if(Xa.forEach(function(f){r===null&&n&&n[f]!==void 0&&(r=f)}),r===null)return e;var o=oe(n[r]);if(!o)return U(t+": "+r+" matches no element; the "+t+" is left detached"),e;var i=r==="appendTo"||r==="prependTo"?o:o.parentElement,l=function(){return ie(t,e,function(){r==="appendTo"?o.appendChild(e):r==="prependTo"?o.insertBefore(e,o.firstChild):r==="insertBefore"?o.parentNode.insertBefore(e,o):Vt(e,o)},{parent:i,source:n.source||"api"})};return Ze>0?(nn(l),e):l()}function Oa(e,t){var n=Ye();return e!==void 0&&!Array.isArray(e)&&!(e&&e.row_cols)&&(U("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=tt(e)),(Array.isArray(e)?e:[]).forEach(function(r){n.appendChild(Te(r))}),Ht(n,"row",t)}function La(e,t){t=t||{};var n=oe(t.appendTo||t.prependTo||null);e===void 0&&n&&ct(n,ke())?e=null:!$(e)&&Yn.indexOf(e)===-1&&(U("createColumn: no column size given, using "+W),e=W);var r=Te(e,t.offset);return t.content!==void 0&&r.appendChild(Ha(t.content)),Ht(r,"column",t)}function Ma(e,t){t=t||{};var n=O[e];return n?Ht(n.create(t),e,t):(U('createContainer: no such container type "'+e+'"'),null)}function Fn(e,t,n){e=oe(e),n=n||{};var r=O[Fe(e)];if(!r||Fe(e)!==t)return U("this is not a "+t+" container"),null;var o=r.addPane(e,n);return o?ie(r.paneKind,o,function(){},{parent:e,source:"api",container:e}):null}function Pa(e,t){e=oe(e);var n=Fe(e);return!O[n]||!O[n].addPane?(U("addPane: this is not a container with panes"),null):Fn(e,n,t)}function Hn(){var e={};return Object.keys(s).forEach(function(t){var n=s[t];e[t]=Array.isArray(n)?n.slice():n}),Object.freeze(e)}function Te(e,t){var n=v("div",{class:"column"}),r=Io(z)[0],o=It({size:e,offset:t||0,leading:"offset"});return Nt(n,r,o.size===null?e:o.size),jn(n,r,o.offset),n}function Wn(e,t){if(!(!s.custom_filter||!s.custom_filter.length)){var n=typeof s.custom_filter=="string"||typeof s.custom_filter=="function"?[s.custom_filter]:s.custom_filter;Array.prototype.forEach.call(n,function(r){typeof r=="string"&&(r=window[r]),r(t||c,e)})}}function za(){var e=[".row","[data-ge-container]"];return Object.keys(L).forEach(function(t){var n=L[t],r=typeof n.cuts=="function"?n.cuts():n.cuts;r&&e.push(r)}),e.join(", ")}function ja(e){_(c,".column > .ge-content, .column > .ge-text-block > .ge-content").forEach(function(t){if(!(b(t,"ge-rte-active")||!X(t,e).length)){var n=t.getAttribute("data-ge-content-type"),r=b(t.parentElement,"ge-text-block")?t.parentElement:t,o=[],i=[];for(Array.prototype.slice.call(t.childNodes).forEach(function(u){u.nodeType===1&&u.matches(e)?(o.push({text:i},{block:u}),i=[]):i.push(u)}),o.push({text:i});t.firstChild;)t.removeChild(t.firstChild);var l=!1,f=r;o.forEach(function(u){var g;if(u.block)g=u.block;else if(Ra(u.text))l?(g=Un(n),u.text.forEach(function(h){g.appendChild(h)})):(u.text.forEach(function(h){t.appendChild(h)}),g=r,l=!0);else return;g!==f&&Vt(g,f),f=g}),l||r.remove()}})}function Ra(e){return e.some(function(t){return t.nodeType===1||t.nodeType===3&&/\S/.test(t.nodeValue)})}function Na(e){_(c,".column").forEach(function(t){var n=[];X(t).forEach(function(r){Oe(r,".ge-tools-drawer, .ge-resize-handle")||(Oe(r,".ge-content, .ge-text-block")||r.matches(e)?n=xo(n):n.push(r))}),xo(n)})}function xo(e){if(e.length){var t=Vt(Un(),e[e.length-1]);e.forEach(function(n){t.appendChild(n)})}return[]}function Un(e){var t=v("div",{class:"ge-content"});return e&&(y(t,"ge-content-type-"+e),t.setAttribute("data-ge-content-type",e)),t}function Ia(){_(c,".column > .ge-content").forEach(function(e){Po(e,v("div",{class:"ge-text-block"}))}),_(c,".ge-text-block").forEach(function(e){if(!P(e,".ge-tools-drawer")){var t=P(e,".ge-content"),n=t?t.getAttribute("data-ge-content-type"):null;n?fi(n)||Fa(e,n):Da(e)}})}function _o(e){_(e,".ge-text-block").forEach(function(t){Gt(t)})}function Da(e){var t=P(e,".ge-content"),n=Ge(e,"ge-tools-drawer ge-text-drawer ge-plain-drawer");y(e,"ge-plain-block"),He(n),Object.keys(L).forEach(function(r){L[r].plainTools&&L[r].plainTools(n,t)}),F(n,m("tool.delete_plain"),"ge-delete-plain","bi bi-trash",function(){Ne("plain",t,m("confirm.delete_plain"),function(r){bt(e,function(){e.remove(),r()})})})}function Fa(e,t){var n=P(e,".ge-content"),r=Ge(e,"ge-tools-drawer ge-text-drawer");He(r),F(r,m("text.no_editor",{type:t}),"ge-text-info ge-text-missing","bi bi-exclamation-triangle"),F(r,m("tool.delete_text"),"ge-delete-text","bi bi-trash",function(){Ne("text",n,m("confirm.delete_text"),function(o){bt(e,function(){e.remove(),o()})})})}function Ha(e){var t=wr(),n=Un(t.length?t[0].type:null);return e&&e.nodeType?n.appendChild(e):mt(n,e),n}function ko(e){z=e,Xn.forEach(function(t){R(c,"ge-layout-"+t,t===e)}),A(Ue,"button").textContent=m(wt(e))}function Kn(e){return Xn.indexOf(e)===-1?null:e}function Ao(e){var t=Kn(e);if(t===null){U("changeView("+JSON.stringify(e)+"): no such layout mode");return}var n=z;ko(t),t!==n&&(Xr().forEach(function(r){_(r,".ge-utilities").forEach(function(o){xn(o)})}),Rr(null),rt(c),ae("onViewChange",t),N("view-change",{canvas:c,breakpoint:t,from:n,to:t}))}function Bn(){return z}function So(e,t,n){return function(){return De[e]?De[e].apply(null,arguments):(K("plugin:"+t,e+" needs the "+t+" plugin: include dist/plugins/grideditor."+n+".js after the editor"),null)}}function Wa(e){if(!s.active_target){K("active_target","setActiveTarget needs the active_target setting: without it, it does nothing");return}if(e==null){Ee(null);return}var t=oe(e);if(!Er(t)){var n=typeof e=="string"?e:t?"<"+t.tagName.toLowerCase()+">":String(e);U("setActiveTarget: "+n+" is not a column or a region of the canvas");return}Ee(t)}function Ua(e){if(le()!=="sidebar"){K("sidebar-api",'setSelected needs settings_panel "sidebar": without it, it does nothing');return}if(e==null){se(null);return}var t=oe(e);if(!t||t===c||!c.contains(t)||!je.has(t)){var n=typeof e=="string"?e:t?"<"+t.tagName.toLowerCase()+">":String(e);U("setSelected: "+n+" is not a node of the canvas with settings");return}se(t)}var Vn={getHtml:nt,getPlainHtml:hi,init:function(){nn(ve)},reset:function(){nn(yr)},deinit:Ie,destroy:wi,changeView:Ao,getView:Bn,createRow:Oa,createColumn:La,createText:function(e,t){return De.createText?De.createText(e,t):(K("plugin:text","createText needs a text editor plugin: include dist/plugins/grideditor.tinymce.js, or another editor's, after the editor"),null)},createElement:So("createElement","elements","elements"),createSection:So("createSection","sections","sections"),createContainer:Ma,addTab:function(e,t){return Fn(e,"tabs",t)},addAccordionItem:function(e,t){return Fn(e,"accordion",t)},addPane:Pa,setLocale:Wo,getUtility:Pr,setUtility:En,getActiveTarget:function(){return s.active_target?H:null},setActiveTarget:Wa,getSelected:function(){return le()==="sidebar"?q:null},setSelected:Ua};Object.keys(Vn).forEach(function(e){var t=!!(Ro[e]&&Ro[e].value);a[e]=function(){if(_t)return K("destroyed:"+e,m("warning.destroyed",{method:e})),e==="getHtml"?c.innerHTML:e==="getPlainHtml"?$n(c.innerHTML):t?null:a;var n=Vn[e].apply(a,arguments);return t?n:a}}),a.canvas=c,a.settings=Hn(),Xt.set(c,a),yi(),a.settings=Hn(),Object.keys(De).forEach(function(e){Object.prototype.hasOwnProperty.call(Vn,e)||e in a||(a[e]=function(){return _t?(K("destroyed:"+e,m("warning.destroyed",{method:e})),null):De[e].apply(null,arguments)})}),Go(),ve(),S._created.forEach(function(e){e(a)})}S._created=[];S.containers={};S.features={};S.utilities={};S.texts={};S.t=Qn;S._plainHtml=$n;S.Sortable=null;S.bootstrap=null;S.version="9.0.0-beta.3";S.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
|
|
2
2
|
(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
|
|
3
3
|
(hold shift for min)`,"tool.column_wider":`Make column wider
|
|
4
4
|
(hold shift for max)`,"tool.indent_decrease":`Decrease indent
|