@themarioga/grid-editor 7.0.0 → 7.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- (()=>{function _(i,s){return i?Array.prototype.slice.call(i.querySelectorAll(s)):[]}function z(i,s){return i?i.querySelector(s):null}function we(i,s){if(!i)return[];var f=_(i,s);return i.nodeType===1&&i.matches(s)&&f.unshift(i),f}function G(i,s){return i?Array.prototype.filter.call(i.children,function(f){return!s||f.matches(s)}):[]}function T(i,s){return G(i,s)[0]||null}function oe(i,s,f){var l=i&&i.nodeType===1?i.closest(s):null;return l&&f&&l!==f&&!f.contains(l)?null:l}function Me(i,s){return!!i&&i.nodeType===1&&i.matches(s)}function ct(i){return!!i&&document.documentElement.contains(i)}function Er(i,s){for(var f=[],l=i.nextElementSibling;l;l=l.nextElementSibling)(!s||l.matches(s))&&f.push(l);return f}function xr(i,s){for(var f=[],l=i.parentElement;l&&l!==s;l=l.parentElement)f.push(l);return f}function Ei(i){var s=document.createElement("template");return s.innerHTML=i,Array.prototype.slice.call(s.content.childNodes)}function q(i){for(var s=Ei(i.trim()),f=0;f<s.length;f++)if(s[f].nodeType===1)return s[f];return null}function v(i,s,f){var l=document.createElement(i);return Object.keys(s||{}).forEach(function(d){var E=s[d];E!=null&&E!==!1&&l.setAttribute(d,E)}),f!=null&&(l.textContent=f),l}function ft(i,s){return i.innerHTML=s==null?"":String(s),i}function k(i,s){return ze(s).forEach(function(f){i.classList.add(f)}),i}function O(i,s){return ze(s).forEach(function(f){i.classList.remove(f)}),i}function I(i,s,f){return ze(s).forEach(function(l){f===void 0?i.classList.toggle(l):i.classList.toggle(l,!!f)}),i}function y(i,s){return!!i&&i.nodeType===1&&i.classList.contains(s)}function ze(i){return String(i||"").split(/\s+/).filter(Boolean)}function mt(i){return i.getAttribute("class")||i.removeAttribute("class"),i}function pt(i){return i.getAttribute("style")||i.removeAttribute("style"),i}function gt(i,s){return Object.keys(s).forEach(function(f){var l=s[f];l==null?i.removeAttribute(f):i.setAttribute(f,l)}),i}function me(i,s){return Object.keys(s).forEach(function(f){var l=s[f];typeof l=="number"&&!xi[f]&&(l=l+"px"),i.style.setProperty(f,l==null?"":String(l))}),i}var xi={opacity:!0,"z-index":!0,"flex-grow":!0,"flex-shrink":!0,order:!0},qe={};function _i(i){var s=i.nodeName;if(!qe[s]){var f=document.body.appendChild(document.createElement(s));qe[s]=getComputedStyle(f).display,f.remove(),qe[s]==="none"&&(qe[s]="block")}return qe[s]}function Pe(i){return i.style.removeProperty("display"),getComputedStyle(i).display==="none"&&(i.style.display=_i(i)),i}function ye(i){return i.style.display="none",i}function ln(i,s){return s===void 0&&(s=!vt(i)),s?Pe(i):ye(i)}function vt(i){return!!(i.offsetWidth||i.offsetHeight||i.getClientRects().length)}function Xe(i){return i.getBoundingClientRect().width}function ht(i){return i.getBoundingClientRect().height}function _r(i){var s=getComputedStyle(i);return i.clientHeight-parseFloat(s.paddingTop)-parseFloat(s.paddingBottom)}function bt(i){var s=i.getBoundingClientRect();return{top:s.top+window.pageYOffset,left:s.left+window.pageXOffset}}function wt(i,s){return s.parentNode.insertBefore(i,s.nextSibling),i}function yt(i){for(var s=i.parentNode;i.firstChild;)s.insertBefore(i.firstChild,i);i.remove()}function kr(i,s){return i.parentNode.insertBefore(s,i),s.appendChild(i),s}function Ye(i,s,f,l,d){var E=function(b){var j=oe(b.target,f,i);if(j&&i.contains(j))return l.call(j,b)};return ze(s).forEach(function(b){i.addEventListener(b,E,d)}),E}function Q(i,s,f,l){return ze(s).forEach(function(d){i.addEventListener(d,f,l)}),f}function sn(i,s,f,l){ze(s).forEach(function(d){i.removeEventListener(d,f,l)})}var ki=400;function Ar(i,s,f,l){f=f===void 0?ki:f;var d=function(){ye(i),l&&l()};if(!vt(i)||!i.animate||f<=0){window.setTimeout(d,0);return}var E=i.animate(s(getComputedStyle(i)),{duration:f,easing:"ease-in-out"}),b=!1,j=function(){b||(b=!0,d())};E.onfinish=j,E.oncancel=j}function Je(i,s,f){typeof s=="function"&&(f=s,s=void 0),i.style.overflow="hidden",Ar(i,function(l){return[{height:l.height,paddingTop:l.paddingTop,paddingBottom:l.paddingBottom,marginTop:l.marginTop,marginBottom:l.marginBottom},{height:"0px",paddingTop:"0px",paddingBottom:"0px",marginTop:"0px",marginBottom:"0px"}]},s,function(){i.style.removeProperty("overflow"),f&&f()})}function Sr(i,s,f,l){i.style.overflow="hidden",Ar(i,function(d){var E={opacity:d.opacity,height:d.height},b={opacity:0,height:"0px"};return l&&(E.width=d.width,b.width="0px"),[E,b]},s,function(){i.style.removeProperty("overflow"),f&&f()})}var Tr={getHtml:{value:!0},getPlainHtml:{value:!0},init:{},deinit:{},reset:{},destroy:{},changeView:{},getView:{value:!0},createRow:{value:!0},createColumn:{value:!0},createElement:{value:!0},createText:{value:!0},createSection:{value:!0},createContainer:{value:!0},addTab:{value:!0},addAccordionItem:{value:!0},setLocale:{},getUtility:{value:!0},setUtility:{value:!0}},Si=["appendTo","prependTo","insertAfter","insertBefore"],h=[{key:"xs",infix:"",colPrefix:"col-",offsetPrefix:"offset-",min:0,preview:400,labelKey:"view.xs"},{key:"sm",infix:"sm",colPrefix:"col-sm-",offsetPrefix:"offset-sm-",min:576,preview:576,labelKey:"view.sm"},{key:"md",infix:"md",colPrefix:"col-md-",offsetPrefix:"offset-md-",min:768,preview:768,labelKey:"view.md"},{key:"lg",infix:"lg",colPrefix:"col-lg-",offsetPrefix:"offset-lg-",min:992,preview:992,labelKey:"view.lg"},{key:"xl",infix:"xl",colPrefix:"col-xl-",offsetPrefix:"offset-xl-",min:1200,preview:1200,labelKey:"view.xl"},{key:"xxl",infix:"xxl",colPrefix:"col-xxl-",offsetPrefix:"offset-xxl-",min:1400,preview:null,labelKey:"view.xxl"}],W="all",Ti="view.all",Ct=[W].concat(h.map(function(i){return i.key})),Or=["lg","sm","xs"],P=12,Lr=11,un=["equal","auto"],je=["1","2","3","4","5","6","auto"];function dn(i,s){return"row-cols"+(i.infix?"-"+i.infix:"")+"-"+s}function F(i){return typeof i=="number"}function Ce(i,s){return s==="equal"?i.infix?"col-"+i.infix:"col":i.colPrefix+s}function K(i){for(var s=0;s<h.length;s++)if(h[s].key===i)return h[s];return null}function Mr(i){if(i===W)return[h[0]];var s=K(i);return s?[s]:[]}function $e(i){var s=K(i);return s?s.labelKey:Ti}var Ie={add_column:{size:12,picker:!0,delay:600},elements:{enabled:"auto",selector:"[data-ge-element]",auto:!1},resize:{enabled:!0,handles:"e",balance:"next"},drag:{delay:0,touch_delay:100,threshold:3,animation:150,scroll:!0}},zr={sortable_options:"drag",resizable_options:"resize"},Pr={},Oi=0,xt=new WeakMap;function _t(i,s,f){var l=C.locales,d=l[i.locale]||{},E=i.locale_strings||{},b=E[s];return b===void 0&&(b=d[s]),b===void 0&&(b=l.en[s]),b===void 0&&(Li("locale:"+s,'no string for "'+s+'" in any locale, showing the key'),b=s),b.replace(/\{(\w+)\}/g,function(j,ge){return f&&f[ge]!==void 0?f[ge]:j})}function N(i){window.console&&window.console.warn&&window.console.warn("grid-editor: "+i)}function Li(i,s){Pr[i]||(Pr[i]=!0,N(s))}function Mi(i,s){return _t({locale:"en"},i,s)}function zi(i){if(typeof i=="string"){var s=document.querySelector(i);if(!s)throw new TypeError("grid-editor: no element matches "+JSON.stringify(i));return s}if(i&&i.nodeType===1)return i;throw new TypeError("grid-editor: the target is an element or a selector, not "+(i===null?"null":typeof i))}function pe(i){return typeof i=="string"?document.querySelector(i):i&&i.nodeType===1?i:null}function jr(){return C.Sortable||window.Sortable||null}function Et(){var i=C.bootstrap||window.bootstrap;return i&&i.Modal?i.Modal:null}function cn(i){var s=document.implementation.createHTMLDocument("").body;s.innerHTML=i;var f=[];return _(s,"*").forEach(function(l){var d=!1;Array.prototype.slice.call(l.attributes).forEach(function(j){j.name.indexOf("data-ge-")===0&&(l.removeAttribute(j.name),d=!0)});var E=(l.getAttribute("class")||"").split(/\s+/).filter(Boolean),b=E.filter(function(j){return j!=="column"&&j.indexOf("ge-")!==0});b.length!==E.length&&(d=!0),b.length?l.setAttribute("class",b.join(" ")):l.removeAttribute("class"),d&&l.tagName==="DIV"&&!l.attributes.length&&f.push(l)}),f.forEach(function(l){yt(l)}),s.innerHTML}function C(i,s){var f=zi(i),l=xt.get(f);if(l)return Ir.has(f)||(Ir.add(f),N(Mi("warning.already_editing"))),l;if(!(this instanceof C))return new C(f,s);Pi(this,f,s||{})}var Ir=new WeakSet;C.create=function(i,s){return new C(i,s)};C.get=function(i){var s=pe(i);return s&&xt.get(s)||null};function Pi(i,s,f){var l=Object.assign({new_row_layouts:[[12],[6,6],[4,4,4],[3,3,3,3],[2,2,2,2,2,2],[2,8,2],[4,8],[8,4]],row_classes:[],col_classes:[],col_tools:[],row_tools:[],drag_handle:"tool",toolbar_drag:"auto",element_tools:[],element_classes:[],container_classes:[],pane_classes:[],container_tools:[],tab_tools:[],accordion_tools:[],plugins:null,row_cols:!0,utilities:{},elements:Ie.elements,custom_filter:"",valid_col_sizes:[1,2,3,4,5,6,7,8,9,10,11,12,"equal","auto"],valid_col_offsets:[0,1,2,3,4,5,6,7,8,9,10,11],add_column:Ie.add_column,layout_modes:Ct.slice(),default_view:W,resize:Ie.resize,source_textarea:"",edit_source:!0,locale:"en",locale_strings:{},callbacks:{},confirm_delete:!0,settings_panel:"offcanvas",drag:Ie.drag},f);Object.keys(Ie).forEach(function(e){l[e]=Object.assign({},Ie[e],l[e])}),Object.keys(zr).forEach(function(e){f&&f[e]!==void 0&&N(_t(l,"warning.setting_removed",{setting:e,replacement:zr[e]}))});var d,E,b,j,ge,Ee,B,A=l.default_view,R=null,X=null,xe=!1,_e=null,fn={},kt=[],Nr=++Oi,mn=!1,pn=new WeakMap,At=new WeakMap,Qe=new WeakMap,gn=new WeakMap,St=new WeakSet,vn=new AbortController;d=k(s,"ge-canvas");function J(e,t){fn[e]||(fn[e]=!0,N(t))}function p(e,t){return _t(l,e,t)}function Rr(e){l.locale=e,i.settings=nn(),hn(),tr(),E.remove(),xn(),zn()}var Ne=0,Tt=[];function Y(e,t,n){return Object.assign({kind:e,node:t,parent:t.parentElement,canvas:d,breakpoint:an(),source:"api"},n||{})}function L(e,t){var n=[e],r=e.replace(/^(before|after)-add-.+$/,"$1-add");r!==e&&n.push(r);var o=!1;return n.forEach(function(a){var u=new CustomEvent("grideditor:"+a,{detail:t,bubbles:!0,cancelable:!0});d.dispatchEvent(u)||(o=!0)}),n.forEach(function(a){var u=l.callbacks[a.replace(/-/g,"_")];typeof u=="function"&&u(t)===!1&&(o=!0)}),!o}function H(e){Ne++;try{return e()}finally{if(Ne--,Ne===0)for(;Tt.length;)Tt.shift()()}}function Ot(e){if(Ne===0){e();return}Tt.push(e)}function $(e,t,n,r){var o=Dr(e);return H(function(){var a=Y(e,t,r);return L("before-add-"+o,a)?(n(),le(),L("after-add-"+o,a),t):null})}function Dr(e){return C.containers[e]?"container":e}function Ur(e,t){if(!l.confirm_delete){t();return}var n=Et();if(!n){window.confirm(e)&&t();return}var r=Fr(),o=!1;z(r,".ge-confirm-message").textContent=e,z(r,".ge-confirm-ok").onclick=function(){o=!0,n.getInstance(r).hide()},ie.hidden=function(){o&&t()},ie.shown=function(){z(r,".ge-confirm-ok").focus()},n.getOrCreateInstance(r).show()}var ie={hidden:null,shown:null};function Fr(){return R||(R=q('<div class="modal fade ge-confirm" tabindex="-1" aria-hidden="true"><div class="modal-dialog modal-dialog-centered"><div class="modal-content"><div class="modal-header"><h5 class="modal-title"></h5><button type="button" class="btn-close" data-bs-dismiss="modal"></button></div><div class="modal-body"><p class="ge-confirm-message"></p></div><div class="modal-footer"><button type="button" class="btn btn-secondary ge-confirm-cancel" data-bs-dismiss="modal"></button><button type="button" class="btn btn-danger ge-confirm-ok"></button></div></div></div></div>'),document.body.appendChild(R),z(R,".modal-title").textContent=p("confirm.title"),z(R,".btn-close").setAttribute("aria-label",p("confirm.cancel")),z(R,".ge-confirm-cancel").textContent=p("confirm.cancel"),z(R,".ge-confirm-ok").textContent=p("confirm.ok"),wn(R),R.addEventListener("hidden.bs.modal",function(){ie.hidden&&ie.hidden()}),R.addEventListener("shown.bs.modal",function(){ie.shown&&ie.shown()}),R)}function hn(){R&&(ie.hidden=null,ie.shown=null,bn(R),R=null)}function bn(e){var t=Et(),n=t?t.getInstance(e):null,r=!1,o=function(){r||(r=!0,n&&n.dispose(),e.remove())};if(!n||!Lt.get(e)&&!y(e,"show")){o();return}e.addEventListener("hidden.bs.modal",o,{once:!0}),e.addEventListener("shown.bs.modal",function(){n.hide()},{once:!0}),n.hide()}var Lt=new WeakMap;function wn(e){Q(e,"show.bs.modal hide.bs.modal",function(){Lt.set(e,!0)}),Q(e,"shown.bs.modal hidden.bs.modal",function(){Lt.set(e,!1)})}function ve(e,t,n,r){H(function(){var o=Y(e,t,{source:"tool"});L("before-delete",o)&&Ur(n,function(){H(function(){r(function(){t.remove(),H(function(){le(),L("after-delete",o)})})})})})}function Mt(e,t,n){if(n=n||A,n!==W){var r=K(n),o=st({size:t,offset:at(e,r)||0});return o.refused||Te(e,r)===o.size?null:{writes:[{tier:r,size:o.size}],cleared:null,size:o.size}}var a=h.some(function(g){return st({size:t,offset:at(e,g)||0}).refused});if(a)return null;var u=h[0],c=[],m=[];return h.slice(1).forEach(function(g){var w=Te(e,g);w!==null&&(c.push({tier:g,size:null}),m.push({breakpoint:g.key,value:w}))}),Te(e,u)!==t&&c.unshift({tier:u,size:t}),c.length?{writes:c,cleared:m,size:t}:null}function zt(e,t){t.writes.forEach(function(n){lt(e,n.tier,n.size)}),Ge(e)}function Pt(e,t){return t&&(e.cleared=t),e}function jt(e,t,n,r){r=r||A;var o=Fe(e),a=Mt(e,t,r);return a?H(function(){var u=Y("column",e,Pt({source:n,breakpoint:r,from:o,to:a.size},a.cleared));return L("before-resize",u)?(zt(e,a),ee(e),L("after-resize",u),!0):(ee(e),!1)}):!1}function yn(e,t,n){var r=A===W,o=r?h[0]:K(A),a=We(e);t=Math.min(Math.max(t,0),Lr);var u=r?h.slice(1).filter(function(c){return it(e,c)!==null}):[];return(it(e,o)||0)===t&&!u.length?!1:H(function(){var c=Y("column",e,Pt({source:n,from:a,to:t},r?u.map(function(m){return{breakpoint:m.key,value:it(e,m)}}):null));return L("before-indent",c)?(Jt(e,o,t),u.forEach(function(m){Jt(e,m,0)}),(r?h:[o]).forEach(function(m){var g=Yt(e,m);if(F(g)){var w=st({size:g,offset:t,leading:"offset"});w.size!==g&&lt(e,m,w.size)}}),ee(e),L("after-indent",c),!0):!1})}function It(e){var t=e.parentElement;return{parent:t,index:G(t).filter(function(n){return!y(n,"ge-tools-drawer")}).indexOf(e)}}function ae(e){var t=null;return Object.keys(S).forEach(function(n){var r=S[n];!t&&r.kindOf&&(t=r.kindOf(e))}),t||(e.getAttribute("data-ge-container")?e.getAttribute("data-ge-container"):y(e,"ge-tab")?"tab":y(e,"ge-accordion-item")?"accordion-item":y(e,"row")?"row":y(e,"column")?"column":y(e,"ge-element")?"element":(y(e,"ge-text-block")&&(e=T(e,".ge-content")||e),y(e,"ge-content")?e.getAttribute("data-ge-content-type")?"text":"plain":"node"))}if(l.source_textarea){var Re=pe(l.source_textarea).value,Cn=v("div");Cn.innerHTML=Re,Re.length>0&&!Cn.querySelector(".row")&&(Re='<div class="row"><div class="col-lg-12">'+Re+"</div></div>"),ft(s,Re)}if(s.children.length&&!s.querySelector("div.row")){var Hr=G(s),En=q('<div class="row"><div class="col-lg-12"></div></div>');s.appendChild(En),Hr.forEach(function(e){En.firstChild.appendChild(e)})}function Wr(){B=v("textarea",{class:"ge-html-output"}),d.parentNode.insertBefore(B,d),xn();var e={signal:vn.signal};window.addEventListener("scroll",eo,e),Ye(d,"click",".ge-content",to,e),Ye(d,"click",".ge-popup-trigger, [data-ge-popup-target]",function(t){y(d,"ge-editing")&&t.preventDefault()},e)}function Kr(e){!Me(e,".ge-content")||!d.contains(e)||(Z("onContentReady",e),tt(e))}function xn(){E=v("div",{class:"ge-mainControls"}),B.parentNode.insertBefore(E,B),b=E.appendChild(v("div",{class:"ge-wrapper ge-top"})),j=b.appendChild(v("div",{class:"ge-addRowGroup btn-group"})),ge=v("div",{class:"ge-addContainerGroup btn-group ms-1"}),l.new_row_layouts.forEach(function(u){var c=!Array.isArray(u),m=v("a",{class:"btn btn-sm btn-primary",title:c?p("row.add_row_cols",{columns:u.columns,counts:Qr(u.row_cols)}):p("row.add",{layout:u.join("-")}),"data-ge-toolbar":"row","data-ge-layout":c?JSON.stringify(u):u.join(",")});m.addEventListener("click",function(){var x=De(u),be=$("row",x,function(){d.appendChild(x)},{parent:d,source:"tool"});be&&x.scrollIntoView&&x.scrollIntoView({behavior:"smooth"})}),j.appendChild(m),m.appendChild(q('<i class="bi bi-plus"></i>'));var g=c?Zr(u):u,w='<div class="row ge-row-icon">';g.forEach(function(x){w+='<div class="column '+Ce(h[0],x)+'"></div>'}),w+="</div>",m.appendChild(q(w))}),b.appendChild(ge),Object.keys(D).forEach(function(u){var c=D[u],m=_n(v("a",{class:"btn btn-sm btn-primary ge-add-container"}),p(c.labelKey),c.iconClass);gt(m,{"data-ge-toolbar":"container","data-ge-container-type":u}),m.addEventListener("click",function(){var g=Oe(),w=g.appendChild(fe(P)),x=w.appendChild(c.create({}));$(u,x,function(){d.appendChild(g)},{parent:d,source:"tool"})}),ge.appendChild(m)});var e=[];Object.keys(S).forEach(function(u){(S[u].toolbar||[]).forEach(function(c,m){var g=Br(u,c,m);c.align==="end"?e.push(g):ge.appendChild(g)})}),Ee=q('<div class="dropdown pull-right ge-layout-mode"><button type="button" class="btn btn-sm btn-primary dropdown-toggle" data-bs-toggle="dropdown"></button><div class="dropdown-menu" role="menu"></div></div>'),Ye(Ee,"click","a",function(){wr(this.getAttribute("data-ge-view"))}),b.appendChild(Ee),l.layout_modes.forEach(function(u){z(Ee,".dropdown-menu").appendChild(v("a",{class:"dropdown-item","data-ge-view":u,title:p($e(u))},p($e(u))))}),z(Ee,"button").textContent=p($e(A));var t=b.appendChild(v("div",{class:"btn-group pull-right"}));if(l.edit_source){var n=q('<button type="button" class="btn btn-sm btn-primary gm-edit-mode"><i class="bi bi-code-slash"></i></button>');n.setAttribute("title",p("tool.edit_source")),I(n,"active btn-danger",xe),n.addEventListener("click",function(){xe?Pn():oo(),I(n,"active btn-danger",xe)}),t.appendChild(n)}var r=q('<button type="button" class="btn btn-sm btn-primary gm-preview"><i class="bi bi-eye-fill"></i></button>'),o=function(){y(r,"active")||k(d,"ge-editing")};if(r.setAttribute("title",p("tool.preview")),r.addEventListener("mouseenter",function(){O(d,"ge-editing")}),r.addEventListener("click",function(){I(r,"active btn-danger"),o()}),r.addEventListener("mouseleave",o),t.appendChild(r),e.length){var a=b.appendChild(v("div",{class:"pull-right ge-toolbar-end"}));e.forEach(function(u){a.appendChild(u)})}Gr()}function _n(e,t,n){return e.setAttribute("title",t),n?(e.appendChild(v("i",{class:n})),e):(e.appendChild(q('<i class="bi bi-plus"></i>')),e.appendChild(v("span",{},t)),e)}function Br(e,t,n){var r=t.iconClass||(t.align==="end"?"bi bi-plus":null),o=typeof t.label=="function"?t.label():t.label||p(t.labelKey),a=_n(v("a",{class:"btn btn-sm btn-primary ge-add-container ge-add-feature"}),o,r);return k(a,t.className||""),gt(a,{"data-ge-toolbar":"feature","data-ge-feature":e,"data-ge-item":n}),a.addEventListener("click",function(){var u=t.create(),c=t.inColumn?Nt(u):u,m=$(t.kind,u,function(){d.appendChild(c)},{parent:d,source:t.source||"tool"});m&&t.inColumn&&c.scrollIntoView&&c.scrollIntoView({behavior:"smooth"})}),a}function Vr(){return l.toolbar_drag==="auto"?l.drag_handle==="drawer":!!l.toolbar_drag}function Gr(){var e=_(E,"[data-ge-toolbar]");e.forEach(function(t){O(t,"ge-palette-button"),t.removeEventListener("pointerdown",kn)}),Vr()&&e.forEach(function(t){k(t,"ge-palette-button"),t.addEventListener("pointerdown",kn)})}function kn(e){var t=e.currentTarget,n=e.pageX,r=e.pageY,o=null;if(e.button)return;function a(m){return Math.abs(m.pageX-n)+Math.abs(m.pageY-r)>l.drag.threshold}function u(m){if(!o){if(!a(m))return;o=k(t.cloneNode(!0),"ge-toolbar-helper"),document.body.appendChild(o),k(d,"ge-dropping")}me(o,{left:m.pageX-14,top:m.pageY-14}),Xr(m.pageX,m.pageY)}function c(m){if(document.removeEventListener("pointermove",u),sn(document,"pointerup pointercancel",c),!!o){o.remove(),O(d,"ge-dropping"),Rt();var g=function(x){x.target!==t&&!t.contains(x.target)||(x.preventDefault(),x.stopImmediatePropagation())};window.addEventListener("click",g,{capture:!0,once:!0}),window.setTimeout(function(){window.removeEventListener("click",g,{capture:!0})},0);var w=An(m.pageX,m.pageY);w&&Yr(t,w)}}document.addEventListener("pointermove",u),Q(document,"pointerup pointercancel",c)}function An(e,t){var n=e-window.scrollX,r=t-window.scrollY,o=document.elementFromPoint(n,r);if(!o)return null;var a=oe(o,[".column",".ge-canvas"].concat(Zt("regions")).join(", "));if(!a||a!==d&&!d.contains(a))return null;var u=null;return G(a,Qt()).forEach(function(c){if(!u){var m=c.getBoundingClientRect();r<m.top+m.height/2&&(u=c)}}),{region:a,before:u}}function qr(e,t){var n=S[e.getAttribute("data-ge-feature")].toolbar[parseInt(e.getAttribute("data-ge-item"),10)],r=n.create(),o=r;if(n.inColumn)Me(t.region,".column")||(o=Nt(r));else if(!en(t.region,r)){var a=t.region===d?[]:xr(t.region,d).reverse().concat([t.region]),u=a[0]||null;t={region:d,before:u?u.nextElementSibling:null}}return $(n.kind,r,function(){t.before?t.before.parentNode.insertBefore(o,t.before):t.region.appendChild(o)},{parent:t.region,source:n.source||"dragdrop"})}function Nt(e){var t=Oe();return t.appendChild(fe(P)).appendChild(e),t}function Xr(e,t){var n=An(e,t);if(!n)return Rt();_e||(_e=v("div",{class:"ge-drop-marker"})),n.before?n.before.parentNode.insertBefore(_e,n.before):n.region.appendChild(_e)}function Rt(){_e&&_e.remove()}function Yr(e,t){if(e.getAttribute("data-ge-toolbar")==="feature")return qr(e,t);var n=e.getAttribute("data-ge-toolbar")==="container",r=e.getAttribute("data-ge-container-type"),o=n?D[r].create({}):$r(e.getAttribute("data-ge-layout")),a=o;return n&&!Me(t.region,".column")&&(a=Nt(o)),$(n?r:"row",o,function(){t.before?t.before.parentNode.insertBefore(a,t.before):t.region.appendChild(a)},{parent:t.region,source:"dragdrop"})}function Jr(){for(var e=[],t=1;t<=P;t++)e.push(String(t));return{name:"col",values:e.concat(un),appliesTo:["column"],labelKey:"utility.col_width",className:function(n,r){return Ce(K(n),Dt(r))},choices:function(){return l.valid_col_sizes.map(String)},label:function(n){return n==="equal"?p("utility.col_equal"):n==="auto"?p("utility.col_auto"):n},write:function(n,r,o,a){return jt(n,r===null?null:Dt(r),a,o)},blank:function(n,r){var o=r===W?null:ot(n,K(r));return o?p("utility.col_from_row",{count:ar(o.value)}):null}}}function Dt(e){return/^\d+$/.test(String(e))?parseInt(e,10):e}function $r(e){return/^\s*\{/.test(e||"")?De(JSON.parse(e)):De((e||"").split(",").filter(function(t){return t!==""}).map(Dt))}function De(e){var t=Oe();if(Array.isArray(e))return e.forEach(function(r){t.appendChild(fe(r))}),t;Object.keys(e.row_cols||{}).forEach(function(r){var o=e.row_cols[r],a=K(r);a&&je.indexOf(String(o))!==-1&&k(t,dn(a,o))});for(var n=0;n<(e.columns||0);n++)t.appendChild(fe(null));return t}function Qr(e){return h.filter(function(t){return e&&e[t.key]!==void 0}).map(function(t){return(t.infix?t.key+": ":"")+e[t.key]}).join(", ")}function Zr(e){var t=1;return Object.keys(e.row_cols||{}).forEach(function(n){var r=e.row_cols[n];r!=="auto"&&(t=Math.max(t,parseInt(r,10)||1))}),Array.apply(null,Array(Math.min(t,e.columns||t))).map(function(){return"equal"})}function eo(){var e=window.pageYOffset;e>bt(E).top&&e<bt(d).top+_r(d)?y(b,"ge-top")&&(me(b,{left:bt(b).left,width:Xe(b)}),O(b,"ge-top"),k(b,"ge-fixed")):y(b,"ge-fixed")&&(me(b,{left:"",width:""}),O(b,"ge-fixed"),k(b,"ge-top"))}function to(){var e=this;if(!e.getAttribute("data-ge-content-type")&&!te()&&vt(e)){var t=Mn();t.length&&(t.length===1?Sn(e,t[0]):no(e,t))}}function Sn(e,t){return t.available&&!t.available()?(t.missingKey&&console.error(p(t.missingKey)),!1):H(function(){var n=Y("plain",e,{source:"tool",from:"plain",to:t.type});if(!L("before-convert",n))return!1;k(e,"ge-content-type-"+t.type),e.setAttribute("data-ge-content-type",t.type);var r=e.parentElement;return y(r,"ge-text-block")&&(O(r,"ge-plain-block"),G(r,".ge-tools-drawer").forEach(function(o){o.remove()})),L("after-convert",n),t.edit(e),!0})}function no(e,t){var n=y(e.parentElement,"ge-text-block")?e.parentElement:null;n&&Tn(T(n,".ge-tools-drawer"),t.map(function(r){return{label:r.label,title:p("tool.convert_type",{editor:r.label}),attributes:{"data-ge-content-type":r.type},choose:function(){Sn(e,r)}}}),"ge-text-picker ge-convert-picker",n)}function Tn(e,t,n,r){if(te(),!!e){var o=oe(e,".ge-tools-drawer");o&&k(o,"ge-picker-open"),X=e.appendChild(k(v("div",{class:"ge-size-picker"}),n||"")),t.forEach(function(a){var u=gt(v("a",{class:"ge-size ge-size-flex"}),a.attributes||{});u.setAttribute("title",a.title||a.label),u.textContent=a.label,u.addEventListener("click",function(c){c.preventDefault(),c.stopPropagation(),te(),a.choose()}),X.appendChild(u)}),On(r||e)}}function On(e){e.addEventListener("mouseleave",function(){window.setTimeout(function(){X&&!X.matches(":hover")&&te()},400)},{once:!0})}function Ln(){var e={},t=[];return Object.keys(S).forEach(function(n){var r=S[n];r.textTypes&&(r.textTypes()||[]).forEach(function(o){if(e[o.type]){e[o.type]!==n&&J("text-type:"+o.type,'the "'+n+'" plugin declares the text type "'+o.type+'", which the "'+e[o.type]+'" plugin already declares: ignored');return}e[o.type]=n,t.push(o)})}),t}function Mn(){return Ln().filter(function(e){return e.offered!==!1})}function ro(e){return Ln().some(function(t){return t.type===e})}function zn(){ke(),le()}function oo(){ke(),B.style.height=.8*document.documentElement.clientHeight+"px",B.value=d.innerHTML,Pe(B),ye(d),xe=!0,Z("onSourceOpen",B)}function Pn(){Z("onSourceClose",B),xe=!1,ft(d,B.value),Pe(d),le(),ye(B)}function le(){U&&!ct(U.node)&&ne(),vr(!0),k(d,"ge-editing"),I(d,"ge-drag-drawer",l.drag_handle==="drawer"),Bo();var e=mi();pi(e),vi(e),hi(),zo(),Po(),Eo(),Z("onInit"),$o(),ti(),br(A),tt(d)}function ke(){ne(),O(d,"ge-editing ge-drag-drawer ge-dropping"),Z("onBeforeDeinit"),te(),Rt(),_(d,".ge-tools-drawer").forEach(function(e){e.remove()}),bi(),Z("onDeinit"),Wn(d),_(d,"[data-ge-row-cols]").forEach(function(e){e.removeAttribute("data-ge-row-cols")}),xo(),ui(),oi(),vr(!1)}function jn(){ke(),Ge(d);var e=d.innerHTML;return le(),e}function io(e){ke(),Ge(e);var t=e.outerHTML;return le(),t}function ao(){return cn(jn())}function lo(){xe&&Pn(),ke(),hn(),tr(),E.remove(),B.remove(),vn.abort(),xt.delete(d),mn=!0}function so(){var e=uo();Ft("grid",{},Jr()),l.row_cols!==!1&&Ft("grid",{},Xo());var t=function(r){return!l.plugins||l.plugins.indexOf(r)!==-1},n=function(r,o){return o.always===!0||t(r)};Object.keys(C.containers).forEach(function(r){t(r)&&(D[r]=C.containers[r](e))}),Object.keys(C.features).forEach(function(r){var o=C.features[r];n(r,o)&&(S[r]=o(e))}),Object.keys(C.utilities).forEach(function(r){t(r)&&(V[r]=C.utilities[r](e),(V[r].families||[]).forEach(function(o){Ft(r,V[r],o)}))}),Object.keys(S).forEach(function(r){var o=S[r].methods||{};Object.keys(o).forEach(function(a){Ue[a]=o[a]})}),(l.plugins||[]).forEach(function(r){D[r]||S[r]||V[r]||J("plugin:"+r,'the "'+r+'" plugin is not loaded: include dist/plugins/grideditor.'+r+".js after the editor")})}function Z(e,t){[D,S,V].forEach(function(n){Object.keys(n).forEach(function(r){n[r][e]&&n[r][e](t)})})}function uo(){return{canvas:d,settings:l,t:p,warn:N,containerId:yo,defaultRegion:Co,createTool:M,createMoveTool:he,addSettingsTool:Be,deleteNode:ve,place:dt,createPaneControls:ko,makeLabelEditable:Ao,labelIn:So,unwrapLabels:To,suspendToggles:qn,resumeToggles:Xn,emit:L,payloadFor:Y,operate:H,kindOf:ae,view:an,viewTiers:function(){return Mr(A).map(function(e){return e.key})},breakpoints:h.map(function(e){return e.key}),getUtility:Hn,setUtility:Kt,utilityField:wo,bareStyle:po,rowFromLayout:De,nodeHtml:io,textReady:Kr,attachPicker:Jn,openPicker:Tn,closePicker:te,detailsOf:Zn,drawerOf:co,toolbarItems:function(e){return E?_(E,'[data-ge-toolbar="feature"][data-ge-feature="'+e+'"]'):[]}}}function co(e){if(y(e,"ge-content")){var t=e.parentElement;return y(t,"ge-text-block")?T(t,".ge-tools-drawer"):null}return T(e,".ge-tools-drawer")}var se={},fo=".row, .column, .ge-content, .ge-element, [data-ge-container]",Ze="data-ge-preview",Ut=!1;function Ft(e,t,n){var r=n.name||n.prefix;if(se[r]){N('the "'+e+'" plugin declares the utility "'+r+'", which the "'+se[r].plugin+'" plugin already declared: ignored');return}se[r]={plugin:e,family:Object.assign({},n,{name:r,values:n.values.map(String),appliesTo:n.appliesTo||t.appliesTo||["row","column"]})}}function et(e,t){return se[e]?se[e].family:(J("utility:"+e,t+"("+JSON.stringify(e)+"): no loaded plugin declares that utility"),null)}function In(e,t){return t==="plain"&&(t="text"),e.appliesTo.indexOf(t)!==-1?!0:!!D[t]&&e.appliesTo.indexOf("container")!==-1}function Nn(e){return Object.keys(se).map(function(t){return se[t].family}).filter(function(t){return In(t,e)})}function Ht(e,t,n){return e.className?e.className(t.key,n):e.prefix+(t.infix?"-"+t.infix:"")+"-"+n}function ue(e,t,n){for(var r=(e.getAttribute("class")||"").split(/\s+/),o=0;o<t.values.length;o++)if(r.indexOf(Ht(t,n,t.values[o]))!==-1)return t.values[o];return null}function Rn(e,t,n){for(var r=h.indexOf(n)-1;r>=0;r--){var o=ue(e,t,h[r]);if(o!==null)return{tier:h[r],value:o}}return null}function Dn(e,t,n){var r=ue(e,t,n);if(r!==null)return r;var o=Rn(e,t,n);return o?o.value:null}function Wt(e,t){return h.map(function(n){return{tier:n,value:ue(e,t,n)}}).filter(function(n){return n.value!==null})}function Un(e,t,n,r){t.values.forEach(function(o){O(e,Ht(t,n,o))}),r!==null&&k(e,Ht(t,n,r)),mt(e)}function Fn(e,t,n){return n===W?ue(e,t,h[0]):Dn(e,t,K(n))}function mo(e,t,n,r){if(n!==W){var o=K(n);return ue(e,t,o)===r?null:{writes:[{tier:o,value:r}],cleared:[]}}var a=[],u=[];return Wt(e,t).forEach(function(c){c.tier!==h[0]&&(a.push({tier:c.tier,value:null}),u.push({breakpoint:c.tier.key,value:c.value}))}),ue(e,t,h[0])!==r&&a.unshift({tier:h[0],value:r}),a.length?{writes:a,cleared:u}:null}function Hn(e,t,n){e=pe(e);var r=et(t,"getUtility");if(!r||!e)return null;var o=n===void 0?A:on(n);return o===null?(N("getUtility("+JSON.stringify(n)+"): no such layout mode"),null):Fn(e,r,o)}function Kt(e,t,n,r){r=typeof r=="string"?{view:r}:r||{},e=pe(e);var o=et(t,"setUtility");if(!o||!e)return!1;var a=r.view===void 0?A:on(r.view);if(a===null)return N("setUtility("+JSON.stringify(r.view)+"): no such layout mode"),!1;if(n=n==null||n===""?null:String(n),n!==null&&o.values.indexOf(n)===-1)return N("setUtility: "+JSON.stringify(n)+' is not a value of "'+t+'", which takes '+JSON.stringify(o.values)),!1;var u=ae(e);if(!In(o,u))return N('setUtility: "'+t+'" does not apply to a '+u),!1;if(o.write)return o.write(e,n,a,r.source||"api");var c=mo(e,o,a,n);return c?H(function(){var m=Y(u,e,{family:t,breakpoint:a,tiers:c.writes.map(function(g){return g.tier.key}),from:Fn(e,o,a),to:n,cleared:c.cleared,source:r.source||"api"});return L("before-utility",m)?(c.writes.forEach(function(g){Un(e,o,g.tier,g.value)}),ee(e),L("after-utility",m),!0):(ee(e),!1)}):!1}function po(e,t,n){var r=et(t,"bareStyle");if(e=pe(e),!r||!e)return null;var o=e.getAttribute("class");h.forEach(function(u){Un(e,r,u,null)});var a=getComputedStyle(e).getPropertyValue(n);return o===null?e.removeAttribute("class"):e.setAttribute("class",o),a}function ee(e){var t=Zn(e);if(t){var n=z(t,".ge-classes");n&&(n.value=Gt(e).join(" ")),G(t,".ge-utilities").forEach(function(r){Bt(r)})}tt(e)}function go(e){return we(e,fo)}function tt(e){Wn(e),A!==W&&vo(e,K(A)),qo(e),Z("onRefresh",e)}function vo(e,t){go(e).forEach(function(n){var r=ae(n),o={};Nn(r).forEach(function(a){!a.preview||!Wt(n,a).length||Object.assign(o,a.preview(Dn(n,a,t),n,r))}),r==="column"&&Object.assign(o,Go(n,t)),Object.keys(V).forEach(function(a){var u=V[a];u.preview&&Object.assign(o,u.preview(n,r,t.key))}),Object.keys(o).length&&ho(n,o)})}function ho(e,t){var n=e.style,r={};Object.keys(t).forEach(function(o){r[o]=[n.getPropertyValue(o),n.getPropertyPriority(o)],n.setProperty(o,String(t[o]),"important")}),e.setAttribute(Ze,JSON.stringify(r))}function Wn(e){we(e,"["+Ze+"]").forEach(function(t){var n=t.style,r={};try{r=JSON.parse(t.getAttribute(Ze))||{}}catch(o){}Object.keys(r).forEach(function(o){var a=r[o];a&&a[0]?n.setProperty(o,a[0],a[1]):n.removeProperty(o)}),t.removeAttribute(Ze),pt(t)})}function bo(e){var t=ae(e),n=Nn(t).filter(function(u){return u.panel!==!1}).map(function(u){return Kn(e,u)});if(Object.keys(V).forEach(function(u){var c=V[u],m=c.panel?c.panel(e,t):null;m&&n.push(m)}),!n.length)return null;var r=I(v("div",{class:"ge-utilities"}),"ge-open",Ut);gn.set(r,e);var o=r.appendChild(v("a",{class:"ge-utilities-toggle"}));o.addEventListener("click",function(){Ut=!y(r,"ge-open"),er().forEach(function(u){_(u,".ge-utilities").forEach(function(c){I(c,"ge-open",Ut)})})});var a=r.appendChild(v("div",{class:"ge-utilities-body"}));return n.forEach(function(u){a.appendChild(u)}),Bt(r),r}function Kn(e,t){var n=v("label",{class:"ge-utility","data-ge-family":t.name});n.appendChild(v("span",{class:"ge-utility-label"},t.labelKey?p(t.labelKey):t.name));var r=n.appendChild(v("select",{class:"form-select form-select-sm"}));return r.addEventListener("change",function(){Kt(e,t.name,this.value,{source:"panel"})}),n.appendChild(v("small",{class:"ge-utility-note"})),n}function wo(e,t){var n=et(t,"utilityField");if(!n)return null;var r=Kn(e,n);return Bn(r,e),r}function Bt(e){var t=gn.get(e);G(e,".ge-utilities-toggle").forEach(function(n){n.textContent=p("utility.section",{view:p($e(A))})}),_(e,".ge-utility").forEach(function(n){Bn(n,t)})}function Bn(e,t){var n=se[e.getAttribute("data-ge-family")].family,r=T(e,"select"),o=n.choices?n.choices(t,ae(t)):n.values,a,u,c="";if(r.innerHTML="",A===W){a=ue(t,n,h[0]),u=p("utility.default");var m=Wt(t,n).filter(function(Le){return Le.tier!==h[0]});m.length&&(c=p("utility.varies",{breakpoints:m.map(function(Le){return Le.tier.key}).join(", ")}))}else{var g=K(A),w=Rn(t,n,g);a=ue(t,n,g),u=w?p("utility.inherit",{value:Vn(n,w.value),breakpoint:w.tier.key}):p("utility.default");var x=n.blank?n.blank(t,A):null;x&&a===null&&(u=x)}a!==null&&o.indexOf(a)===-1&&(o=o.concat([a])),r.appendChild(v("option",{value:""},u)),o.forEach(function(Le){r.appendChild(v("option",{value:Le},Vn(n,Le)))}),r.value=a===null?"":a;var be=T(e,".ge-utility-note");be.textContent=c,ln(be,c!=="")}function Vn(e,t){return e.label?e.label(t):t}var D={},S={},V={},Ue={},Gn=0;function yo(e){return Gn++,"ge-"+e+"-"+Gn+"-"+Math.random().toString(36).slice(2,6)}function Co(){var e=Oe();return e.appendChild(fe(P)),e}function Ae(e){return e?e.getAttribute("data-ge-container"):null}function Eo(){_(d,"[data-ge-container]").forEach(function(e){var t=Ae(e),n=D[t];if(!n){J("container:"+t,'unknown container type "'+t+'"');return}k(e,"ge-container ge-container-"+t),n.mark(e),T(e,".ge-tools-drawer")||_o(e,t,n)})}function xo(){_(d,"[data-ge-container]").forEach(function(e){var t=D[Ae(e)];t&&t.unmark(e),O(e,"ge-container ge-container-"+Ae(e)),mt(e)})}function Se(e,t){var n=v("div",{class:t});return e.insertBefore(n,e.firstChild),n}function nt(e,t){(t||[]).forEach(function(n){M(e,n.title||"",n.className||"",n.iconClass||"bi bi-wrench",n.on)})}function _o(e,t,n){var r=Se(e,"ge-tools-drawer ge-container-drawer");he(r),Be(r,e,l.container_classes),nt(r,l.container_tools),n.tools&&n.tools(r,e),M(r,p("tool.delete_container"),"ge-delete-container","bi bi-trash",function(){ve(t,e,p("confirm.delete_container"),function(o){Je(e,o)})}),n.addPane&&M(r,p(n.addPaneKey),"ge-add-pane","bi bi-plus-circle",function(){var o=n.addPane(e,{});$(n.paneKind,o,function(){},{parent:e,source:"tool",container:e})})}function ko(e,t,n,r,o){var a=Se(e,"ge-tools-drawer ge-pane-drawer");return he(a),Be(a,e,l.pane_classes),nt(a,n),M(a,p("tool.delete_pane"),"ge-delete-pane","bi bi-trash",function(){ve(t,e,r,function(u){o(u)})}),a}function qn(e){e&&we(e,"[data-bs-toggle], [data-bs-dismiss]").forEach(function(t){["toggle","dismiss"].forEach(function(n){var r=t.getAttribute("data-bs-"+n);r!==null&&(t.setAttribute("data-ge-bs-"+n,r),t.removeAttribute("data-bs-"+n))})})}function Xn(e){e&&we(e,"[data-ge-bs-toggle], [data-ge-bs-dismiss]").forEach(function(t){["toggle","dismiss"].forEach(function(n){var r=t.getAttribute("data-ge-bs-"+n);r!==null&&(t.setAttribute("data-bs-"+n,r),t.removeAttribute("data-ge-bs-"+n))})})}function Ao(e){if(!St.has(e)){var t=oe(e,"[data-bs-toggle], [data-ge-bs-toggle]");St.add(e),e.setAttribute("title",p("tool.rename")),e.addEventListener("dblclick",function(n){n.preventDefault(),n.stopPropagation(),qn(t),e.setAttribute("contenteditable","true"),e.focus(),window.getSelection().selectAllChildren(e)}),e.addEventListener("keydown",function(n){e.getAttribute("contenteditable")==="true"&&n.key==="Enter"&&(n.preventDefault(),e.blur())}),e.addEventListener("blur",function(){e.removeAttribute("contenteditable"),Xn(t)})}}function So(e){var t=T(e,".ge-pane-label");return t||(t=v("span",{class:"ge-pane-label"},e.textContent.trim()),e.innerHTML="",e.appendChild(t)),t}function To(e){_(e,".ge-pane-label").forEach(function(t){St.delete(t),yt(t)})}function Yn(e,t){var n=fe(t);return $("column",n,function(){e.appendChild(n)},{parent:e,source:"tool"})}function Oo(e,t){!l.add_column.picker||!e||Jn(e,function(){Lo(e,t)})}function Jn(e,t){var n=null,r=function(){window.clearTimeout(n),n=null};Q(e,"mouseenter mousedown",function(){n||X||(n=window.setTimeout(function(){n=null,t()},l.add_column.delay))}),Q(e,"mouseleave mouseup",r)}function Lo(e,t){te();var n=$t(t,de()),r=oe(e,".ge-tools-drawer");r&&k(r,"ge-picker-open"),X=e.appendChild(v("div",{class:"ge-size-picker"})),l.valid_col_sizes.forEach(function(o){var a=v("a",{class:"ge-size","data-ge-size":o,title:Mo(o)},F(o)?o:Ce(h[0],o));I(a,"ge-size-tight",F(o)&&o>n),I(a,"ge-size-flex",!F(o)),a.addEventListener("click",function(u){u.preventDefault(),u.stopPropagation(),te(),Yn(t,o)}),X.appendChild(a)}),On(e)}function Mo(e){return e==="equal"?p("tool.column_equal"):e==="auto"?p("tool.column_auto"):p("tool.column_size",{size:e})}function te(){if(!X)return!1;var e=oe(X,".ge-tools-drawer");return e&&O(e,"ge-picker-open"),X.remove(),X=null,!0}function zo(){_(d,".row").forEach(function(e){if(!T(e,".ge-tools-drawer")){var t=Se(e,"ge-tools-drawer");he(t),Be(t,e,l.row_classes),nt(t,l.row_tools),M(t,p("tool.delete_row"),"ge-delete-row","bi bi-trash",function(){ve("row",e,p("confirm.delete_row"),function(n){Je(e,n)})}),M(t,p("tool.add_column"),"ge-add-column","bi bi-plus-circle",function(){te()||Yn(e,Ve(e,de())?null:l.add_column.size)}),Oo(T(t,".ge-add-column"),e)}})}function Po(){_(d,".column").forEach(function(e){if(!T(e,".ge-tools-drawer")){var t=Se(e,"ge-tools-drawer");he(t),M(t,p("tool.column_narrower"),"ge-decrease-col-width","bi bi-dash-lg",function(n){jt(e,n.shiftKey?Ke(l.valid_col_sizes):rt(l.valid_col_sizes.filter(F),He(e),-1),"tool")}),M(t,p("tool.column_wider"),"ge-increase-col-width","bi bi-plus-lg",function(n){jt(e,n.shiftKey?jo(e):rt(l.valid_col_sizes.filter(F),He(e),1),"tool")}),M(t,p("tool.indent_decrease"),"ge-decrease-col-offset","bi bi-text-indent-right",function(n){yn(e,n.shiftKey?Ke(l.valid_col_offsets):rt(l.valid_col_offsets,We(e),-1),"tool")}),M(t,p("tool.indent_increase"),"ge-increase-col-offset","bi bi-text-indent-left",function(n){yn(e,n.shiftKey?Io(e):rt(l.valid_col_offsets,We(e),1),"tool")}),Be(t,e,l.col_classes),nt(t,l.col_tools),M(t,p("tool.delete_column"),"ge-delete-column","bi bi-trash",function(){ve("column",e,p("confirm.delete_column"),function(n){Sr(e,400,n,!0)})}),M(t,p("tool.add_row"),"ge-add-row","bi bi-plus-circle",function(){var n=Oe();$("row",n,function(){e.appendChild(n)},{parent:e,source:"tool"})})}})}function de(){return A===W?h[h.length-1]:K(A)}function Fe(e){var t=de();if(ot(e,t))return null;var n=Yt(e,t);return n===null?P:n}function He(e){var t=Fe(e);if(F(t))return t;var n=Math.round(Xe(e)/$n(e.parentElement)*P);return Math.min(Math.max(n,1),P)}function $n(e){var t=window.getComputedStyle(e);return e.clientWidth-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight)}function We(e){return at(e,de())||0}function rt(e,t,n){var r=e.indexOf(t);return r===-1?e.reduce(function(o,a){return Math.abs(a-t)<Math.abs(o-t)?a:o},e[0]):e[Math.min(Math.max(r+n,0),e.length-1)]}function Ke(e){return e.filter(F).reduce(function(t,n){return Math.min(t,n)},P)}function Vt(e){return e.filter(F).reduce(function(t,n){return Math.max(t,n)},0)}function jo(e){var t=$t(e.parentElement,de(),e)-We(e);return Math.min(Vt(l.valid_col_sizes),Math.max(t,1))}function Io(e){var t=$t(e.parentElement,de(),e)-He(e);return Math.min(Vt(l.valid_col_offsets),Math.max(t,0))}function he(e){return l.drag_handle==="drawer"?null:M(e,p("tool.move"),"ge-move","bi bi-arrows-move")}function M(e,t,n,r,o){var a=v("a",{title:t,class:n});return a.appendChild(v("i",{class:r})),e.appendChild(a),typeof o=="function"&&a.addEventListener("click",o),o&&typeof o=="object"&&Object.keys(o).forEach(function(u){Q(a,u,o[u])}),a}function Gt(e){return(e.getAttribute("class")||"").split(/\s+/).filter(function(t){return t!==""&&!No(t)})}function No(e){return e==="row"||e==="column"||/^(ge-|ui-)/.test(e)||/^col(-(sm|md|lg|xl|xxl))?(-auto)?$/.test(e)?!0:h.some(function(t){return new RegExp("^("+t.colPrefix+"|"+t.offsetPrefix+")\\d+$").test(e)})}function Ro(e,t){Gt(e).forEach(function(n){O(e,n)}),t.split(/\s+/).forEach(function(n){n!==""&&k(e,n)}),mt(e)}function Be(e,t,n){var r=Do(t,n||[]);pn.set(t,r),M(e,p("tool.settings"),"ge-settings","bi bi-gear-fill",function(){Fo(t,r,this)});var o=ae(t);return Object.keys(V).forEach(function(a){V[a].drawerTools&&V[a].drawerTools(e,t,o)}),Object.keys(S).forEach(function(a){S[a].drawerTools&&S[a].drawerTools(e,t,o)}),e.appendChild(r)}function Do(e,t){var n=v("div",{class:"ge-details"}),r=n.appendChild(v("div",{class:"ge-details-general"})),o=function(g){var w=v("label",{class:"ge-field"});return w.appendChild(v("span",{class:"ge-field-label"},g)),r.appendChild(w)},a=v("input",{class:"ge-id form-control form-control-sm",placeholder:p("tool.id_placeholder"),title:p("tool.id_title")});a.value=e.getAttribute("id")||"",o(p("panel.id")).appendChild(a),a.addEventListener("change",function(){this.value===""?e.removeAttribute("id"):e.setAttribute("id",this.value)});var u=v("input",{class:"ge-classes form-control form-control-sm",placeholder:p("tool.classes_placeholder"),title:p("tool.classes_title")});u.value=Gt(e).join(" "),o(p("panel.classes")).appendChild(u),u.addEventListener("change",function(){Ro(e,this.value),ee(e)});var c=r.appendChild(v("div",{class:"btn-group btn-group-sm ge-presets",role:"group"}));t.forEach(function(g){var w=y(e,g.cssClass),x=v("a",{role:"button",class:"btn btn-sm btn-outline-secondary",title:g.title?g.title:p("tool.toggle_class",{label:g.label}),"aria-pressed":w?"true":"false"});x.innerHTML=g.label,I(x,"active",w),x.addEventListener("click",function(){I(x,"active"),x.setAttribute("aria-pressed",y(x,"active")?"true":"false"),I(e,g.cssClass,y(x,"active")),ee(e)}),c.appendChild(x)});var m=bo(e);return m&&n.appendChild(m),n}var Qn=["offcanvas","popover","modal","inline"],ce={},U=null,qt=new WeakMap;function Uo(){return Qn.indexOf(l.settings_panel)!==-1?l.settings_panel:(J("settings_panel",'settings_panel "'+l.settings_panel+'" is not one of '+Qn.join(", ")+": using offcanvas"),"offcanvas")}function Zn(e){return e&&pn.get(e)||null}function er(){return U&&U.mode!=="inline"?[d,U.details]:[d]}function Fo(e,t,n){var r=Uo();if(r==="inline"){ln(t);return}var o=U&&U.details===t;ne(),o||Ho(r,e,t,n)}function Ho(e,t,n,r){var o=Wo(e),a=new AbortController;U={mode:e,node:t,details:n,home:n.parentElement,next:n.nextElementSibling,gear:r,listening:a},z(o,".ge-settings-title").textContent=p("panel.title",{kind:Ko(t)}),z(o,".ge-settings-body").appendChild(n),Pe(n),k(t,"ge-settings-target");var u={signal:a.signal};if(document.addEventListener("keydown",function(m){m.key==="Escape"&&ne()},u),e==="offcanvas"){var c=window.innerWidth<576;I(o,"offcanvas-end",!c),I(o,"offcanvas-bottom",c),O(o,"hiding"),o.getBoundingClientRect(),k(o,"show")}else e==="popover"?(Xt(o,r),Q(window,"scroll resize",function(){Xt(o,r)},u),window.ResizeObserver&&(U.observer=new window.ResizeObserver(function(){Xt(o,r)}),U.observer.observe(n)),Q(document,"mousedown touchstart",function(m){!o.contains(m.target)&&!r.contains(m.target)&&ne()},u)):nr(o)}function ne(){var e=U;if(e){U=null;var t=ce[e.mode];e.listening.abort(),e.observer&&e.observer.disconnect(),e.mode==="offcanvas"?(O(t,"show"),k(t,"hiding"),window.setTimeout(function(){O(t,"hiding")},300)):e.mode==="popover"?ye(t):rr(t),O(e.node,"ge-settings-target"),e.details.style.removeProperty("display"),pt(e.details),e.home&&ct(e.home)?e.next&&e.next.parentElement===e.home?e.home.insertBefore(e.details,e.next):e.home.appendChild(e.details):e.details.remove()}}function Wo(e){if(ce[e])return ce[e];var t=function(){return v("button",{type:"button",class:"btn-close ge-settings-close","aria-label":p("panel.close")})},n;return e==="offcanvas"?(n=q('<div class="offcanvas offcanvas-end ge-settings-panel ge-settings-offcanvas" tabindex="-1" role="dialog"><div class="offcanvas-header"><h5 class="offcanvas-title ge-settings-title"></h5></div><div class="offcanvas-body ge-settings-body"></div></div>'),z(n,".offcanvas-header").appendChild(t())):e==="popover"?(n=q('<div class="popover bs-popover-bottom ge-settings-panel ge-settings-popover" role="dialog"><div class="popover-arrow"></div><div class="popover-header"><span class="ge-settings-title"></span></div><div class="popover-body ge-settings-body"></div></div>'),z(n,".popover-header").appendChild(t()),ye(n)):(n=q('<div class="modal fade ge-settings-panel ge-settings-modal" tabindex="-1" role="dialog" aria-hidden="true"><div class="modal-dialog modal-dialog-centered modal-dialog-scrollable"><div class="modal-content"><div class="modal-header"><h5 class="modal-title ge-settings-title"></h5></div><div class="modal-body ge-settings-body"></div><div class="modal-footer"></div></div></div></div>'),z(n,".modal-header").appendChild(t()),z(n,".modal-footer").appendChild(v("button",{type:"button",class:"btn btn-primary ge-settings-close"},p("panel.done")))),Ye(n,"click",".ge-settings-close",function(r){r.preventDefault(),ne()}),ce[e]=document.body.appendChild(n),n}function tr(){ne(),Object.keys(ce).forEach(function(e){e==="modal"?bn(ce[e]):ce[e].remove()}),re&&(re.remove(),re=null),ce={}}function Xt(e,t){if(ct(t)){Pe(e);var n=t.getBoundingClientRect(),r=8,o=T(e,".popover-body");o.style.removeProperty("max-height");var a=Xe(e),u=ht(e),c=window.innerHeight-n.bottom-2*r,m=n.top-2*r,g=u<=c||c>=m,w=g?c:m;u>w&&(me(o,{"max-height":Math.max(120,w-(u-ht(o)))}),u=ht(e));var x=g?n.bottom+r:n.top-r-u,be=Math.max(r,Math.min(n.left+n.width/2-24,window.innerWidth-a-r));I(e,"bs-popover-bottom",g),I(e,"bs-popover-top",!g),me(e,{top:x+window.pageYOffset,left:be+window.pageXOffset}),me(T(e,".popover-arrow"),{left:Math.max(r,Math.min(n.left+n.width/2-be-8,a-24))})}}var re=null;function nr(e){var t=Et();if(!t){re=v("div",{class:"modal-backdrop fade show ge-settings-backdrop"}),re.addEventListener("click",function(){ne()}),document.body.appendChild(re),k(e,"show"),e.style.display="block",e.removeAttribute("aria-hidden");return}var n=t.getOrCreateInstance(e),r=qt.get(e);r||(r={wanted:null,busy:!1},qt.set(e,r),wn(e),e.addEventListener("hide.bs.modal",function(){r.wanted==="open"&&(r.wanted="closed",r.busy=!0)}),e.addEventListener("shown.bs.modal",function(){r.busy=!1,r.wanted==="closed"&&rr(e)}),e.addEventListener("hidden.bs.modal",function(){r.busy=!1,r.wanted==="open"?nr(e):U&&U.mode==="modal"&&ne()})),r.wanted="open",r.busy||(r.busy=!0,n.show())}function rr(e){var t=Et();if(!t){re&&(re.remove(),re=null),O(e,"show"),e.style.removeProperty("display"),e.setAttribute("aria-hidden","true");return}var n=qt.get(e)||{wanted:null,busy:!1};n.wanted="closed",!n.busy&&y(e,"show")&&(n.busy=!0,t.getOrCreateInstance(e).hide())}function Ko(e){var t=ae(e);if(D[t]&&D[t].labelKey)return p(D[t].labelKey);switch(t){case"row":return p("panel.kind_row");case"column":return p("panel.kind_column");case"text":return p("panel.kind_text");case"element":return p("panel.kind_element");case"section":return p("panel.kind_section");case"tab":return p("panel.kind_tab");case"accordion-item":return p("panel.kind_accordion_item");default:return t}}function Bo(){_(d,'.column, div[class*="col-"], div.col').forEach(function(e){k(e,"column"),!(Yo(e).length||or(e.parentElement))&&lt(e,h[0],P)})}function or(e){return y(e,"row")&&h.some(function(t){return je.some(function(n){return y(e,dn(t,n))})})}function Ve(e,t){if(!y(e,"row"))return null;for(var n=h.indexOf(t);n>=0;n--)for(var r=0;r<je.length;r++)if(y(e,dn(h[n],je[r])))return{tier:n,value:je[r]};return null}function ir(e,t){for(var n=h.indexOf(t);n>=0;n--){var r=Te(e,h[n]);if(r!==null)return{tier:n,size:r}}return null}function ot(e,t){var n=Ve(e.parentElement,t);if(!n)return null;var r=ir(e,t);return!r||n.tier>r.tier||n.tier===r.tier&&r.size==="equal"?n:null}function Vo(e){return e.value==="auto"?0:P/parseInt(e.value,10)}function Go(e,t){var n=ot(e,t);return n?{flex:"0 0 auto",width:n.value==="auto"?"auto":100/parseInt(n.value,10)+"%","max-width":"100%"}:or(e.parentElement)&&!ir(e,t)?{flex:"0 0 auto",width:"100%","max-width":"100%"}:{}}function qo(e){we(e,".row").forEach(function(t){var n=l.row_cols===!1?null:A===W?Ve(t,h[0])||null:Ve(t,K(A));n?t.setAttribute("data-ge-row-cols",ar(n.value)):t.removeAttribute("data-ge-row-cols")})}function ar(e){return e==="auto"?p("badge.row_cols_auto"):p("badge.row_cols",{count:e})}function Xo(){return{name:"row-cols",prefix:"row-cols",values:je,appliesTo:["row"],labelKey:"utility.row_cols"}}function Te(e,t){var n=sr(e,t.colPrefix);return n!==null?n:y(e,Ce(t,"auto"))?"auto":y(e,Ce(t,"equal"))?"equal":null}function it(e,t){return sr(e,t.offsetPrefix)}function Yt(e,t){return lr(e,t,Te)}function at(e,t){return lr(e,t,it)}function lr(e,t,n){for(var r=h.indexOf(t);r>=0;r--){var o=n(e,h[r]);if(o!==null)return o}return null}function sr(e,t){var n=new RegExp("(?:^|\\s)"+t+"(\\d+)(?:\\s|$)").exec(e.getAttribute("class")||"");return n?parseInt(n[1],10):null}function ur(e,t,n){var r=(e.getAttribute("class")||"").split(/\s+/).filter(function(o){return o!==""&&!new RegExp("^"+t+"\\d+$").test(o)});n!==null&&r.push(t+n),e.setAttribute("class",r.join(" "))}function lt(e,t,n){ur(e,t.colPrefix,null),un.forEach(function(r){O(e,Ce(t,r))}),n!=null&&k(e,Ce(t,n))}function Jt(e,t,n){ur(e,t.offsetPrefix,n||null)}function Yo(e){return h.filter(function(t){return Te(e,t)!==null})}function $t(e,t,n){var r=0;return G(e,".column").forEach(function(o){if(!(n&&o===n)){var a=ot(o,t),u=a?Vo(a):Yt(o,t);r+=(F(u)?u:0)+(at(o,t)||0)}}),P-r}function st(e){var t=e.size===null||e.size===void 0?null:e.size,n=e.offset===null||e.offset===void 0?0:e.offset;return n=Math.min(Math.max(n,0),Lr),t===null||!F(t)?{size:t,offset:n,refused:!1}:(t=Math.min(Math.max(t,1),P),t+n<=P?{size:t,offset:n,refused:!1}:e.leading==="offset"?{size:P-n,offset:n,refused:!1}:{size:null,offset:n,refused:!0})}function Ge(e){we(e,".column").forEach(function(t){me(t,{width:"",height:"",left:"",top:""}),pt(t)})}function dr(e){return"ge-"+e+"-"+Nr}function Qt(){return[".row",".ge-text-block",".ge-content","[data-ge-container]"].concat(Zt("blocks")).join(", ")}function Zt(e){return Object.keys(S).map(function(t){return S[t][e]||null}).filter(function(t){return t!==null})}function en(e,t){var n=!0;return Object.keys(S).forEach(function(r){var o=S[r];n&&o.accepts&&o.accepts(e,t)===!1&&(n=!1)}),n}function Jo(){return l.drag_handle==="drawer"?".ge-tools-drawer > a:not(.ge-text-info):not(.ge-element-info), .ge-details, input, textarea, button, select, option":"input, textarea, button, select, option"}function ut(e,t){var n=jr();if(e=Array.isArray(e)?e:e?[e]:[],!(!e.length||!n)){var r=l.drag_handle==="drawer",o=Jo(),a=0;e.forEach(function(u){var c=t.group?{name:dr(t.group)}:{name:dr(t.draggable+"-"+ ++a),pull:!1,put:!1};t.group&&t.accepts&&(c.put=function(m,g,w){return g.options.group.name===c.name&&t.accepts(m.el,w)}),kt.push(n.create(u,Object.assign({group:c,draggable:t.draggable,handle:r?".ge-tools-drawer":".ge-tools-drawer .ge-move",filter:function(m,g){return oe(m.target,o,u)?!0:!g||g.parentNode!==u},preventOnFilter:!1,forceFallback:!0,fallbackOnBody:!1,ghostClass:"ge-drag-placeholder",chosenClass:"ge-drag-chosen",dragClass:"ge-drag-helper",fallbackClass:"ge-drag-helper",animation:l.drag.animation,delay:l.drag.delay||l.drag.touch_delay,delayOnTouchOnly:!l.drag.delay,touchStartThreshold:l.drag.threshold,scroll:l.drag.scroll,onStart:Qo,onEnd:ei},t.options||{})))})}}function $o(){if(!jr()){J("sortable_missing",p("error.sortable_missing"));return}ut(_(d,".row"),{draggable:".column",group:"column"}),ut([d].concat(_(d,".column")),{draggable:Qt(),group:"block",accepts:en});var e=Zt("regions");e.length&&ut(_(d,e.join(", ")),{draggable:">"+Qt(),group:"block",accepts:en}),Z("onSortable",ut)}function Qo(e){var t=e.item,n=It(t),r=cr(t),o={from:n,canceled:!1};At.set(t,o),H(function(){var a=L("before-move",Y(r.kind,r.node,{parent:n.parent,source:"dragdrop",from:n}));a||(o.canceled=!0)})}function cr(e){var t=y(e,"ge-text-block")&&T(e,".ge-content")||e;return{kind:ae(t),node:t}}function Zo(e,t){var n=G(t.parent).filter(function(r){return r!==e&&!y(r,"ge-tools-drawer")});!n.length||t.index>=n.length?t.parent.appendChild(e):t.parent.insertBefore(e,n[t.index])}function ei(e){var t=e.item,n=At.get(t),r=n?n.from:It(t);if(At.delete(t),n&&n.canceled){Zo(t,r);return}var o=It(t);if(!(o.parent===r.parent&&o.index===r.index)){var a=oe(t,"[data-ge-container]"),u=D[Ae(a)];u&&u.afterPaneMove&&u.afterPaneMove(a,t,r);var c=cr(t);H(function(){L("after-move",Y(c.kind,c.node,{parent:o.parent,source:"dragdrop",from:r,to:o,container:a||void 0}))})}}function ti(){l.resize.enabled&&_(d,".column").forEach(function(e){if(!T(e,".ge-resize-handle")){var t=T(e,".ge-tools-drawer");t&&t.appendChild(v("span",{class:"ge-resize-size"})),ni().forEach(function(n){var r=v("span",{class:"ge-resize-handle ge-resize-"+n,"data-ge-edge":n});r.addEventListener("pointerdown",ri),e.appendChild(r)})}})}function ni(){return String(l.resize.handles).split(",").map(function(e){return e.trim()}).filter(function(e){return e==="e"||e==="w"})}function ri(e){var t=e.currentTarget,n=t.parentElement,r=t.getAttribute("data-ge-edge")==="w",o=e.pageX,a=Xe(n);if(e.preventDefault(),!ii(n))return;k(n,"ge-resizing"),e.pointerId!==void 0&&t.setPointerCapture&&t.setPointerCapture(e.pointerId);function u(g){var w=g.pageX-o;return Math.max(1,a+(r?-w:w))}function c(g){n.style.width=u(g)+"px",ai(n,u(g))}function m(g){t.removeEventListener("pointermove",c),sn(t,"pointerup pointercancel",m),O(n,"ge-resizing"),li(n,u(g))}t.addEventListener("pointermove",c),Q(t,"pointerup pointercancel",m)}function oi(){_(d,".ge-resize-handle").forEach(function(e){e.remove()}),_(d,".ge-resize-size").forEach(function(e){e.remove()}),Ge(d)}function fr(e,t){var n=Math.round(t/$n(e.parentElement)*P),r=mr(e),o=r?Fe(r):null,a=Qe.get(e),u=a?a.units:He(e),c=r&&F(o)?u+o-Ke(l.valid_col_sizes):P-We(e);return Math.min(Math.max(n,Ke(l.valid_col_sizes)),Math.max(c,Ke(l.valid_col_sizes)),Vt(l.valid_col_sizes))}function mr(e){return l.resize.balance!=="next"?null:Er(e,".column")[0]||null}function tn(e,t){var n=T(e,".ge-tools-drawer"),r=n?T(n,".ge-resize-size"):null;r&&(r.textContent=t)}function pr(e){return(A===W?h[0].colPrefix:de().colPrefix)+e}function ii(e){var t=Fe(e),n=H(function(){return L("before-resize",Y("column",e,{source:"dragdrop",from:t,to:null}))});if(!n)return!1;var r={from:t,units:He(e)};return Qe.set(e,r),tn(e,pr(r.units)),!0}function ai(e,t){tn(e,pr(fr(e,t)))}function li(e,t){var n=Qe.get(e),r=fr(e,t);if(Qe.delete(e),tn(e,""),Ge(e),!!n&&r!==n.units){var o=Mt(e,r);o&&H(function(){zt(e,o),si(e,r-n.units),ee(e),L("after-resize",Y("column",e,Pt({source:"dragdrop",from:n.from,to:o.size},o.cleared)))})}}function si(e,t){var n=mr(e);if(!(!n||!t)){var r=Fe(n);if(F(r)){var o=Mt(n,r-t);o&&(zt(n,o),ee(n))}}}function ui(){kt.forEach(function(e){e.destroy()}),kt=[]}function Oe(){return v("div",{class:"row"})}function dt(e,t,n){var r=null;if(Si.forEach(function(c){r===null&&n&&n[c]!==void 0&&(r=c)}),r===null)return e;var o=pe(n[r]);if(!o)return N(t+": "+r+" matches no element; the "+t+" is left detached"),e;var a=r==="appendTo"||r==="prependTo"?o:o.parentElement,u=function(){return $(t,e,function(){r==="appendTo"?o.appendChild(e):r==="prependTo"?o.insertBefore(e,o.firstChild):r==="insertBefore"?o.parentNode.insertBefore(e,o):wt(e,o)},{parent:a,source:n.source||"api"})};return Ne>0?(Ot(u),e):u()}function di(e,t){var n=Oe();return e!==void 0&&!Array.isArray(e)&&!(e&&e.row_cols)&&(N("createRow: the layout is an array of column sizes, as in [8, 4], or { row_cols, columns }. Making an empty row instead."),e=[]),e&&!Array.isArray(e)&&(n=De(e)),(Array.isArray(e)?e:[]).forEach(function(r){n.appendChild(fe(r))}),dt(n,"row",t)}function ci(e,t){t=t||{};var n=pe(t.appendTo||t.prependTo||null);e===void 0&&n&&Ve(n,de())?e=null:!F(e)&&un.indexOf(e)===-1&&(N("createColumn: no column size given, using "+P),e=P);var r=fe(e,t.offset);return t.content!==void 0&&r.appendChild(Ci(t.content)),dt(r,"column",t)}function fi(e,t){t=t||{};var n=D[e];return n?dt(n.create(t),e,t):(N('createContainer: no such container type "'+e+'"'),null)}function gr(e,t,n){e=pe(e),n=n||{};var r=D[Ae(e)];if(!r||Ae(e)!==t)return N("this is not a "+t+" container"),null;var o=r.addPane(e,n);return $(r.paneKind,o,function(){},{parent:e,source:"api",container:e})}function nn(){var e={};return Object.keys(l).forEach(function(t){var n=l[t];e[t]=Array.isArray(n)?n.slice():n}),Object.freeze(e)}function fe(e,t){var n=v("div",{class:"column"}),r=Mr(A)[0],o=st({size:e,offset:t||0,leading:"offset"});return lt(n,r,o.size===null?e:o.size),Jt(n,r,o.offset),n}function vr(e){if(!(!l.custom_filter||!l.custom_filter.length)){var t=typeof l.custom_filter=="string"||typeof l.custom_filter=="function"?[l.custom_filter]:l.custom_filter;Array.prototype.forEach.call(t,function(n){typeof n=="string"&&(n=window[n]),n(d,e)})}}function mi(){var e=[".row","[data-ge-container]"];return Object.keys(S).forEach(function(t){var n=S[t],r=typeof n.cuts=="function"?n.cuts():n.cuts;r&&e.push(r)}),e.join(", ")}function pi(e){_(d,".column > .ge-content, .column > .ge-text-block > .ge-content").forEach(function(t){if(!(y(t,"ge-rte-active")||!G(t,e).length)){var n=t.getAttribute("data-ge-content-type"),r=y(t.parentElement,"ge-text-block")?t.parentElement:t,o=[],a=[];for(Array.prototype.slice.call(t.childNodes).forEach(function(m){m.nodeType===1&&m.matches(e)?(o.push({text:a},{block:m}),a=[]):a.push(m)}),o.push({text:a});t.firstChild;)t.removeChild(t.firstChild);var u=!1,c=r;o.forEach(function(m){var g;if(m.block)g=m.block;else if(gi(m.text))u?(g=rn(n),m.text.forEach(function(w){g.appendChild(w)})):(m.text.forEach(function(w){t.appendChild(w)}),g=r,u=!0);else return;g!==c&&wt(g,c),c=g}),u||r.remove()}})}function gi(e){return e.some(function(t){return t.nodeType===1||t.nodeType===3&&/\S/.test(t.nodeValue)})}function vi(e){_(d,".column").forEach(function(t){var n=[];G(t).forEach(function(r){Me(r,".ge-tools-drawer, .ge-resize-handle")||(Me(r,".ge-content, .ge-text-block")||r.matches(e)?n=hr(n):n.push(r))}),hr(n)})}function hr(e){if(e.length){var t=wt(rn(),e[e.length-1]);e.forEach(function(n){t.appendChild(n)})}return[]}function rn(e){var t=v("div",{class:"ge-content"});return e&&(k(t,"ge-content-type-"+e),t.setAttribute("data-ge-content-type",e)),t}function hi(){_(d,".column > .ge-content").forEach(function(e){kr(e,v("div",{class:"ge-text-block"}))}),_(d,".ge-text-block").forEach(function(e){if(!T(e,".ge-tools-drawer")){var t=T(e,".ge-content"),n=t?t.getAttribute("data-ge-content-type"):null;n?ro(n)||yi(e,n):wi(e)}})}function bi(){_(d,".ge-text-block").forEach(function(e){yt(e)})}function wi(e){var t=T(e,".ge-content"),n=Se(e,"ge-tools-drawer ge-text-drawer ge-plain-drawer");k(e,"ge-plain-block"),he(n),Object.keys(S).forEach(function(r){S[r].plainTools&&S[r].plainTools(n,t)}),M(n,p("tool.delete_plain"),"ge-delete-plain","bi bi-trash",function(){ve("plain",t,p("confirm.delete_plain"),function(r){Je(e,function(){e.remove(),r()})})})}function yi(e,t){var n=T(e,".ge-content"),r=Se(e,"ge-tools-drawer ge-text-drawer");he(r),M(r,p("text.no_editor",{type:t}),"ge-text-info ge-text-missing","bi bi-exclamation-triangle"),M(r,p("tool.delete_text"),"ge-delete-text","bi bi-trash",function(){ve("text",n,p("confirm.delete_text"),function(o){Je(e,function(){e.remove(),o()})})})}function Ci(e){var t=Mn(),n=rn(t.length?t[0].type:null);return e&&e.nodeType?n.appendChild(e):ft(n,e),n}function br(e){A=e,Ct.forEach(function(t){I(d,"ge-layout-"+t,t===e)}),z(Ee,"button").textContent=p($e(e))}function on(e){return typeof e=="number"?(J("changeView-index","changeView("+e+"): layout modes are identified by breakpoint key now, so pass one of "+JSON.stringify(Ct)+". Numeric indexes still work, but they mean what they meant in 2.x ("+Or.join(", ")+") and will be dropped."),Or[e]||null):Ct.indexOf(e)===-1?null:e}function wr(e){var t=on(e);if(t===null){N("changeView("+JSON.stringify(e)+"): no such layout mode");return}var n=A;br(t),t!==n&&(er().forEach(function(r){_(r,".ge-utilities").forEach(function(o){Bt(o)})}),tt(d),Z("onViewChange",t),L("view-change",{canvas:d,breakpoint:t,from:n,to:t}))}function an(){return A}function yr(e,t,n){return function(){return Ue[e]?Ue[e].apply(null,arguments):(J("plugin:"+t,e+" needs the "+t+" plugin: include dist/plugins/grideditor."+n+".js after the editor"),null)}}var Cr={getHtml:jn,getPlainHtml:ao,init:function(){Ot(le)},reset:function(){Ot(zn)},deinit:ke,destroy:lo,changeView:wr,getView:an,createRow:di,createColumn:ci,createText:function(e,t){return Ue.createText?Ue.createText(e,t):(J("plugin:text","createText needs a text editor plugin: include dist/plugins/grideditor.tinymce.js, or another editor's, after the editor"),null)},createElement:yr("createElement","elements","elements"),createSection:yr("createSection","sections","sections"),createContainer:fi,addTab:function(e,t){return gr(e,"tabs",t)},addAccordionItem:function(e,t){return gr(e,"accordion",t)},setLocale:Rr,getUtility:Hn,setUtility:Kt};Object.keys(Cr).forEach(function(e){var t=!!(Tr[e]&&Tr[e].value);i[e]=function(){if(mn)return J("destroyed:"+e,p("warning.destroyed",{method:e})),e==="getHtml"?d.innerHTML:e==="getPlainHtml"?cn(d.innerHTML):t?null:i;var n=Cr[e].apply(i,arguments);return t?n:i}}),i.canvas=d,i.settings=nn(),xt.set(d,i),so(),i.settings=nn(),Wr(),le(),C._created.forEach(function(e){e(i)})}C._created=[];C.containers={};C.features={};C.utilities={};C.texts={};C.t=_t;C._plainHtml=cn;C.Sortable=null;C.bootstrap=null;C.version="7.0.0";C.locales={en:{"tool.move":"Move","tool.settings":"Settings","tool.add_row":"Add row","tool.delete_text":"Remove text","tool.delete_plain":"Remove content","tool.convert_type":"Edit as {editor} text","text.no_editor":'No text editor "{type}" is loaded: this text can be moved and deleted, not edited',"tool.add_column":`Add column
1
+ (()=>{function _(i,s){return i?Array.prototype.slice.call(i.querySelectorAll(s)):[]}function z(i,s){return i?i.querySelector(s):null}function we(i,s){if(!i)return[];var f=_(i,s);return i.nodeType===1&&i.matches(s)&&f.unshift(i),f}function G(i,s){return i?Array.prototype.filter.call(i.children,function(f){return!s||f.matches(s)}):[]}function T(i,s){return G(i,s)[0]||null}function oe(i,s,f){var l=i&&i.nodeType===1?i.closest(s):null;return l&&f&&l!==f&&!f.contains(l)?null:l}function Me(i,s){return!!i&&i.nodeType===1&&i.matches(s)}function ct(i){return!!i&&document.documentElement.contains(i)}function Er(i,s){for(var f=[],l=i.nextElementSibling;l;l=l.nextElementSibling)(!s||l.matches(s))&&f.push(l);return f}function xr(i,s){for(var f=[],l=i.parentElement;l&&l!==s;l=l.parentElement)f.push(l);return f}function Ei(i){var s=document.createElement("template");return s.innerHTML=i,Array.prototype.slice.call(s.content.childNodes)}function q(i){for(var s=Ei(i.trim()),f=0;f<s.length;f++)if(s[f].nodeType===1)return s[f];return null}function v(i,s,f){var l=document.createElement(i);return Object.keys(s||{}).forEach(function(d){var E=s[d];E!=null&&E!==!1&&l.setAttribute(d,E)}),f!=null&&(l.textContent=f),l}function ft(i,s){return i.innerHTML=s==null?"":String(s),i}function k(i,s){return ze(s).forEach(function(f){i.classList.add(f)}),i}function O(i,s){return ze(s).forEach(function(f){i.classList.remove(f)}),i}function I(i,s,f){return ze(s).forEach(function(l){f===void 0?i.classList.toggle(l):i.classList.toggle(l,!!f)}),i}function y(i,s){return!!i&&i.nodeType===1&&i.classList.contains(s)}function ze(i){return String(i||"").split(/\s+/).filter(Boolean)}function mt(i){return i.getAttribute("class")||i.removeAttribute("class"),i}function pt(i){return i.getAttribute("style")||i.removeAttribute("style"),i}function gt(i,s){return Object.keys(s).forEach(function(f){var l=s[f];l==null?i.removeAttribute(f):i.setAttribute(f,l)}),i}function me(i,s){return Object.keys(s).forEach(function(f){var l=s[f];typeof l=="number"&&!xi[f]&&(l=l+"px"),i.style.setProperty(f,l==null?"":String(l))}),i}var xi={opacity:!0,"z-index":!0,"flex-grow":!0,"flex-shrink":!0,order:!0},qe={};function _i(i){var s=i.nodeName;if(!qe[s]){var f=document.body.appendChild(document.createElement(s));qe[s]=getComputedStyle(f).display,f.remove(),qe[s]==="none"&&(qe[s]="block")}return qe[s]}function Pe(i){return i.style.removeProperty("display"),getComputedStyle(i).display==="none"&&(i.style.display=_i(i)),i}function ye(i){return i.style.display="none",i}function ln(i,s){return s===void 0&&(s=!vt(i)),s?Pe(i):ye(i)}function vt(i){return!!(i.offsetWidth||i.offsetHeight||i.getClientRects().length)}function Xe(i){return i.getBoundingClientRect().width}function ht(i){return i.getBoundingClientRect().height}function _r(i){var s=getComputedStyle(i);return i.clientHeight-parseFloat(s.paddingTop)-parseFloat(s.paddingBottom)}function bt(i){var s=i.getBoundingClientRect();return{top:s.top+window.pageYOffset,left:s.left+window.pageXOffset}}function wt(i,s){return s.parentNode.insertBefore(i,s.nextSibling),i}function yt(i){for(var s=i.parentNode;i.firstChild;)s.insertBefore(i.firstChild,i);i.remove()}function kr(i,s){return i.parentNode.insertBefore(s,i),s.appendChild(i),s}function Ye(i,s,f,l,d){var E=function(b){var j=oe(b.target,f,i);if(j&&i.contains(j))return l.call(j,b)};return ze(s).forEach(function(b){i.addEventListener(b,E,d)}),E}function Q(i,s,f,l){return ze(s).forEach(function(d){i.addEventListener(d,f,l)}),f}function sn(i,s,f,l){ze(s).forEach(function(d){i.removeEventListener(d,f,l)})}var ki=400;function Ar(i,s,f,l){f=f===void 0?ki:f;var d=function(){ye(i),l&&l()};if(!vt(i)||!i.animate||f<=0){window.setTimeout(d,0);return}var E=i.animate(s(getComputedStyle(i)),{duration:f,easing:"ease-in-out"}),b=!1,j=function(){b||(b=!0,d())};E.onfinish=j,E.oncancel=j}function Je(i,s,f){typeof s=="function"&&(f=s,s=void 0),i.style.overflow="hidden",Ar(i,function(l){return[{height:l.height,paddingTop:l.paddingTop,paddingBottom:l.paddingBottom,marginTop:l.marginTop,marginBottom:l.marginBottom},{height:"0px",paddingTop:"0px",paddingBottom:"0px",marginTop:"0px",marginBottom:"0px"}]},s,function(){i.style.removeProperty("overflow"),f&&f()})}function Sr(i,s,f,l){i.style.overflow="hidden",Ar(i,function(d){var E={opacity:d.opacity,height:d.height},b={opacity:0,height:"0px"};return l&&(E.width=d.width,b.width="0px"),[E,b]},s,function(){i.style.removeProperty("overflow"),f&&f()})}var Tr={getHtml:{value:!0},getPlainHtml:{value:!0},init:{},deinit:{},reset:{},destroy:{},changeView:{},getView:{value:!0},createRow:{value:!0},createColumn:{value:!0},createElement:{value:!0},createText:{value:!0},createSection:{value:!0},createContainer:{value:!0},addTab:{value:!0},addAccordionItem:{value:!0},setLocale:{},getUtility:{value:!0},setUtility:{value:!0}},Si=["appendTo","prependTo","insertAfter","insertBefore"],h=[{key:"xs",infix:"",colPrefix:"col-",offsetPrefix:"offset-",min:0,preview:400,labelKey:"view.xs"},{key:"sm",infix:"sm",colPrefix:"col-sm-",offsetPrefix:"offset-sm-",min:576,preview:576,labelKey:"view.sm"},{key:"md",infix:"md",colPrefix:"col-md-",offsetPrefix:"offset-md-",min:768,preview:768,labelKey:"view.md"},{key:"lg",infix:"lg",colPrefix:"col-lg-",offsetPrefix:"offset-lg-",min:992,preview:992,labelKey:"view.lg"},{key:"xl",infix:"xl",colPrefix:"col-xl-",offsetPrefix:"offset-xl-",min:1200,preview:1200,labelKey:"view.xl"},{key:"xxl",infix:"xxl",colPrefix:"col-xxl-",offsetPrefix:"offset-xxl-",min:1400,preview:null,labelKey:"view.xxl"}],W="all",Ti="view.all",Ct=[W].concat(h.map(function(i){return i.key})),Or=["lg","sm","xs"],P=12,Lr=11,un=["equal","auto"],je=["1","2","3","4","5","6","auto"];function dn(i,s){return"row-cols"+(i.infix?"-"+i.infix:"")+"-"+s}function F(i){return typeof i=="number"}function Ce(i,s){return s==="equal"?i.infix?"col-"+i.infix:"col":i.colPrefix+s}function K(i){for(var s=0;s<h.length;s++)if(h[s].key===i)return h[s];return null}function Mr(i){if(i===W)return[h[0]];var s=K(i);return s?[s]:[]}function $e(i){var s=K(i);return s?s.labelKey:Ti}var Ie={add_column:{size:12,picker:!0,delay:600},elements:{enabled:"auto",selector:"[data-ge-element]",auto:!1},resize:{enabled:!0,handles:"e",balance:"next"},drag:{delay:0,touch_delay:100,threshold:3,animation:150,scroll:!0}},zr={sortable_options:"drag",resizable_options:"resize"},Pr={},Oi=0,xt=new WeakMap;function _t(i,s,f){var l=C.locales,d=l[i.locale]||{},E=i.locale_strings||{},b=E[s];return b===void 0&&(b=d[s]),b===void 0&&(b=l.en[s]),b===void 0&&(Li("locale:"+s,'no string for "'+s+'" in any locale, showing the key'),b=s),b.replace(/\{(\w+)\}/g,function(j,ge){return f&&f[ge]!==void 0?f[ge]:j})}function N(i){window.console&&window.console.warn&&window.console.warn("grid-editor: "+i)}function Li(i,s){Pr[i]||(Pr[i]=!0,N(s))}function Mi(i,s){return _t({locale:"en"},i,s)}function zi(i){if(typeof i=="string"){var s=document.querySelector(i);if(!s)throw new TypeError("grid-editor: no element matches "+JSON.stringify(i));return s}if(i&&i.nodeType===1)return i;throw new TypeError("grid-editor: the target is an element or a selector, not "+(i===null?"null":typeof i))}function pe(i){return typeof i=="string"?document.querySelector(i):i&&i.nodeType===1?i:null}function jr(){return C.Sortable||window.Sortable||null}function Et(){var i=C.bootstrap||window.bootstrap;return i&&i.Modal?i.Modal:null}function cn(i){var s=document.implementation.createHTMLDocument("").body;s.innerHTML=i;var f=[];return _(s,"*").forEach(function(l){var d=!1;Array.prototype.slice.call(l.attributes).forEach(function(j){j.name.indexOf("data-ge-")===0&&(l.removeAttribute(j.name),d=!0)});var E=(l.getAttribute("class")||"").split(/\s+/).filter(Boolean),b=E.filter(function(j){return j!=="column"&&j.indexOf("ge-")!==0});b.length!==E.length&&(d=!0),b.length?l.setAttribute("class",b.join(" ")):l.removeAttribute("class"),d&&l.tagName==="DIV"&&!l.attributes.length&&f.push(l)}),f.forEach(function(l){yt(l)}),s.innerHTML}function C(i,s){var f=zi(i),l=xt.get(f);if(l)return Ir.has(f)||(Ir.add(f),N(Mi("warning.already_editing"))),l;if(!(this instanceof C))return new C(f,s);Pi(this,f,s||{})}var Ir=new WeakSet;C.create=function(i,s){return new C(i,s)};C.get=function(i){var s=pe(i);return s&&xt.get(s)||null};function Pi(i,s,f){var l=Object.assign({new_row_layouts:[[12],[6,6],[4,4,4],[3,3,3,3],[2,2,2,2,2,2],[2,8,2],[4,8],[8,4]],row_classes:[],col_classes:[],col_tools:[],row_tools:[],drag_handle:"tool",toolbar_drag:"auto",element_tools:[],element_classes:[],container_classes:[],pane_classes:[],container_tools:[],tab_tools:[],accordion_tools:[],plugins:null,row_cols:!0,utilities:{},elements:Ie.elements,custom_filter:"",valid_col_sizes:[1,2,3,4,5,6,7,8,9,10,11,12,"equal","auto"],valid_col_offsets:[0,1,2,3,4,5,6,7,8,9,10,11],add_column:Ie.add_column,layout_modes:Ct.slice(),default_view:W,resize:Ie.resize,source_textarea:"",edit_source:!0,locale:"en",locale_strings:{},callbacks:{},confirm_delete:!0,settings_panel:"offcanvas",drag:Ie.drag},f);Object.keys(Ie).forEach(function(e){l[e]=Object.assign({},Ie[e],l[e])}),Object.keys(zr).forEach(function(e){f&&f[e]!==void 0&&N(_t(l,"warning.setting_removed",{setting:e,replacement:zr[e]}))});var d,E,b,j,ge,Ee,B,A=l.default_view,R=null,X=null,xe=!1,_e=null,fn={},kt=[],Nr=++Oi,mn=!1,pn=new WeakMap,At=new WeakMap,Qe=new WeakMap,gn=new WeakMap,St=new WeakSet,vn=new AbortController;d=k(s,"ge-canvas");function J(e,t){fn[e]||(fn[e]=!0,N(t))}function p(e,t){return _t(l,e,t)}function Rr(e){l.locale=e,i.settings=nn(),hn(),tr(),E.remove(),xn(),zn()}var Ne=0,Tt=[];function Y(e,t,n){return Object.assign({kind:e,node:t,parent:t.parentElement,canvas:d,breakpoint:an(),source:"api"},n||{})}function L(e,t){var n=[e],r=e.replace(/^(before|after)-add-.+$/,"$1-add");r!==e&&n.push(r);var o=!1;return n.forEach(function(a){var u=new CustomEvent("grideditor:"+a,{detail:t,bubbles:!0,cancelable:!0});d.dispatchEvent(u)||(o=!0)}),n.forEach(function(a){var u=l.callbacks[a.replace(/-/g,"_")];typeof u=="function"&&u(t)===!1&&(o=!0)}),!o}function H(e){Ne++;try{return e()}finally{if(Ne--,Ne===0)for(;Tt.length;)Tt.shift()()}}function Ot(e){if(Ne===0){e();return}Tt.push(e)}function $(e,t,n,r){var o=Dr(e);return H(function(){var a=Y(e,t,r);return L("before-add-"+o,a)?(n(),le(),L("after-add-"+o,a),t):null})}function Dr(e){return C.containers[e]?"container":e}function Ur(e,t){if(!l.confirm_delete){t();return}var n=Et();if(!n){window.confirm(e)&&t();return}var r=Fr(),o=!1;z(r,".ge-confirm-message").textContent=e,z(r,".ge-confirm-ok").onclick=function(){o=!0,n.getInstance(r).hide()},ie.hidden=function(){o&&t()},ie.shown=function(){z(r,".ge-confirm-ok").focus()},n.getOrCreateInstance(r).show()}var ie={hidden:null,shown:null};function Fr(){return R||(R=q('<div class="modal fade ge-confirm" tabindex="-1" aria-hidden="true"><div class="modal-dialog modal-dialog-centered"><div class="modal-content"><div class="modal-header"><h5 class="modal-title"></h5><button type="button" class="btn-close" data-bs-dismiss="modal"></button></div><div class="modal-body"><p class="ge-confirm-message"></p></div><div class="modal-footer"><button type="button" class="btn btn-secondary ge-confirm-cancel" data-bs-dismiss="modal"></button><button type="button" class="btn btn-danger ge-confirm-ok"></button></div></div></div></div>'),document.body.appendChild(R),z(R,".modal-title").textContent=p("confirm.title"),z(R,".btn-close").setAttribute("aria-label",p("confirm.cancel")),z(R,".ge-confirm-cancel").textContent=p("confirm.cancel"),z(R,".ge-confirm-ok").textContent=p("confirm.ok"),wn(R),R.addEventListener("hidden.bs.modal",function(){ie.hidden&&ie.hidden()}),R.addEventListener("shown.bs.modal",function(){ie.shown&&ie.shown()}),R)}function hn(){R&&(ie.hidden=null,ie.shown=null,bn(R),R=null)}function bn(e){var t=Et(),n=t?t.getInstance(e):null,r=!1,o=function(){r||(r=!0,n&&n.dispose(),e.remove())};if(!n||!Lt.get(e)&&!y(e,"show")){o();return}e.addEventListener("hidden.bs.modal",o,{once:!0}),e.addEventListener("shown.bs.modal",function(){n.hide()},{once:!0}),n.hide()}var Lt=new WeakMap;function wn(e){Q(e,"show.bs.modal hide.bs.modal",function(){Lt.set(e,!0)}),Q(e,"shown.bs.modal hidden.bs.modal",function(){Lt.set(e,!1)})}function ve(e,t,n,r){H(function(){var o=Y(e,t,{source:"tool"});L("before-delete",o)&&Ur(n,function(){H(function(){r(function(){t.remove(),H(function(){le(),L("after-delete",o)})})})})})}function Mt(e,t,n){if(n=n||A,n!==W){var r=K(n),o=st({size:t,offset:at(e,r)||0});return o.refused||Te(e,r)===o.size?null:{writes:[{tier:r,size:o.size}],cleared:null,size:o.size}}var a=h.some(function(g){return st({size:t,offset:at(e,g)||0}).refused});if(a)return null;var u=h[0],c=[],m=[];return h.slice(1).forEach(function(g){var w=Te(e,g);w!==null&&(c.push({tier:g,size:null}),m.push({breakpoint:g.key,value:w}))}),Te(e,u)!==t&&c.unshift({tier:u,size:t}),c.length?{writes:c,cleared:m,size:t}:null}function zt(e,t){t.writes.forEach(function(n){lt(e,n.tier,n.size)}),Ge(e)}function Pt(e,t){return t&&(e.cleared=t),e}function jt(e,t,n,r){r=r||A;var o=Fe(e),a=Mt(e,t,r);return a?H(function(){var u=Y("column",e,Pt({source:n,breakpoint:r,from:o,to:a.size},a.cleared));return L("before-resize",u)?(zt(e,a),ee(e),L("after-resize",u),!0):(ee(e),!1)}):!1}function yn(e,t,n){var r=A===W,o=r?h[0]:K(A),a=We(e);t=Math.min(Math.max(t,0),Lr);var u=r?h.slice(1).filter(function(c){return it(e,c)!==null}):[];return(it(e,o)||0)===t&&!u.length?!1:H(function(){var c=Y("column",e,Pt({source:n,from:a,to:t},r?u.map(function(m){return{breakpoint:m.key,value:it(e,m)}}):null));return L("before-indent",c)?(Jt(e,o,t),u.forEach(function(m){Jt(e,m,0)}),(r?h:[o]).forEach(function(m){var g=Yt(e,m);if(F(g)){var w=st({size:g,offset:t,leading:"offset"});w.size!==g&&lt(e,m,w.size)}}),ee(e),L("after-indent",c),!0):!1})}function It(e){var t=e.parentElement;return{parent:t,index:G(t).filter(function(n){return!y(n,"ge-tools-drawer")}).indexOf(e)}}function ae(e){var t=null;return Object.keys(S).forEach(function(n){var r=S[n];!t&&r.kindOf&&(t=r.kindOf(e))}),t||(e.getAttribute("data-ge-container")?e.getAttribute("data-ge-container"):y(e,"ge-tab")?"tab":y(e,"ge-accordion-item")?"accordion-item":y(e,"row")?"row":y(e,"column")?"column":y(e,"ge-element")?"element":(y(e,"ge-text-block")&&(e=T(e,".ge-content")||e),y(e,"ge-content")?e.getAttribute("data-ge-content-type")?"text":"plain":"node"))}if(l.source_textarea){var Re=pe(l.source_textarea).value,Cn=v("div");Cn.innerHTML=Re,Re.length>0&&!Cn.querySelector(".row")&&(Re='<div class="row"><div class="col-lg-12">'+Re+"</div></div>"),ft(s,Re)}if(s.children.length&&!s.querySelector("div.row")){var Hr=G(s),En=q('<div class="row"><div class="col-lg-12"></div></div>');s.appendChild(En),Hr.forEach(function(e){En.firstChild.appendChild(e)})}function Wr(){B=v("textarea",{class:"ge-html-output"}),d.parentNode.insertBefore(B,d),xn();var e={signal:vn.signal};window.addEventListener("scroll",eo,e),Ye(d,"click",".ge-content",to,e),Ye(d,"click",".ge-popup-trigger, [data-ge-popup-target]",function(t){y(d,"ge-editing")&&t.preventDefault()},e)}function Kr(e){!Me(e,".ge-content")||!d.contains(e)||(Z("onContentReady",e),tt(e))}function xn(){E=v("div",{class:"ge-mainControls"}),B.parentNode.insertBefore(E,B),b=E.appendChild(v("div",{class:"ge-wrapper ge-top"})),j=b.appendChild(v("div",{class:"ge-addRowGroup btn-group"})),ge=v("div",{class:"ge-addContainerGroup btn-group ms-1"}),l.new_row_layouts.forEach(function(u){var c=!Array.isArray(u),m=v("a",{class:"btn btn-sm btn-primary",title:c?p("row.add_row_cols",{columns:u.columns,counts:Qr(u.row_cols)}):p("row.add",{layout:u.join("-")}),"data-ge-toolbar":"row","data-ge-layout":c?JSON.stringify(u):u.join(",")});m.addEventListener("click",function(){var x=De(u),be=$("row",x,function(){d.appendChild(x)},{parent:d,source:"tool"});be&&x.scrollIntoView&&x.scrollIntoView({behavior:"smooth"})}),j.appendChild(m),m.appendChild(q('<i class="bi bi-plus"></i>'));var g=c?Zr(u):u,w='<div class="row ge-row-icon">';g.forEach(function(x){w+='<div class="column '+Ce(h[0],x)+'"></div>'}),w+="</div>",m.appendChild(q(w))}),b.appendChild(ge),Object.keys(D).forEach(function(u){var c=D[u],m=_n(v("a",{class:"btn btn-sm btn-primary ge-add-container"}),p(c.labelKey),c.iconClass);gt(m,{"data-ge-toolbar":"container","data-ge-container-type":u}),m.addEventListener("click",function(){var g=Oe(),w=g.appendChild(fe(P)),x=w.appendChild(c.create({}));$(u,x,function(){d.appendChild(g)},{parent:d,source:"tool"})}),ge.appendChild(m)});var e=[];Object.keys(S).forEach(function(u){(S[u].toolbar||[]).forEach(function(c,m){var g=Br(u,c,m);c.align==="end"?e.push(g):ge.appendChild(g)})}),Ee=q('<div class="dropdown pull-right ge-layout-mode"><button type="button" class="btn btn-sm btn-primary dropdown-toggle" data-bs-toggle="dropdown"></button><div class="dropdown-menu" role="menu"></div></div>'),Ye(Ee,"click","a",function(){wr(this.getAttribute("data-ge-view"))}),b.appendChild(Ee),l.layout_modes.forEach(function(u){z(Ee,".dropdown-menu").appendChild(v("a",{class:"dropdown-item","data-ge-view":u,title:p($e(u))},p($e(u))))}),z(Ee,"button").textContent=p($e(A));var t=b.appendChild(v("div",{class:"btn-group pull-right"}));if(l.edit_source){var n=q('<button type="button" class="btn btn-sm btn-primary gm-edit-mode"><i class="bi bi-code-slash"></i></button>');n.setAttribute("title",p("tool.edit_source")),I(n,"active btn-danger",xe),n.addEventListener("click",function(){xe?Pn():oo(),I(n,"active btn-danger",xe)}),t.appendChild(n)}var r=q('<button type="button" class="btn btn-sm btn-primary gm-preview"><i class="bi bi-eye-fill"></i></button>'),o=function(){y(r,"active")||k(d,"ge-editing")};if(r.setAttribute("title",p("tool.preview")),r.addEventListener("mouseenter",function(){O(d,"ge-editing")}),r.addEventListener("click",function(){I(r,"active btn-danger"),o()}),r.addEventListener("mouseleave",o),t.appendChild(r),e.length){var a=b.appendChild(v("div",{class:"pull-right ge-toolbar-end"}));e.forEach(function(u){a.appendChild(u)})}Gr()}function _n(e,t,n){return e.setAttribute("title",t),n?(e.appendChild(v("i",{class:n})),e):(e.appendChild(q('<i class="bi bi-plus"></i>')),e.appendChild(v("span",{},t)),e)}function Br(e,t,n){var r=t.iconClass||(t.align==="end"?"bi bi-plus":null),o=typeof t.label=="function"?t.label():t.label||p(t.labelKey),a=_n(v("a",{class:"btn btn-sm btn-primary ge-add-container ge-add-feature"}),o,r);return k(a,t.className||""),gt(a,{"data-ge-toolbar":"feature","data-ge-feature":e,"data-ge-item":n}),a.addEventListener("click",function(){var u=t.create(),c=t.inColumn?Nt(u):u,m=$(t.kind,u,function(){d.appendChild(c)},{parent:d,source:t.source||"tool"});m&&t.inColumn&&c.scrollIntoView&&c.scrollIntoView({behavior:"smooth"})}),a}function Vr(){return l.toolbar_drag==="auto"?l.drag_handle==="drawer":!!l.toolbar_drag}function Gr(){var e=_(E,"[data-ge-toolbar]");e.forEach(function(t){O(t,"ge-palette-button"),t.removeEventListener("pointerdown",kn)}),Vr()&&e.forEach(function(t){k(t,"ge-palette-button"),t.addEventListener("pointerdown",kn)})}function kn(e){var t=e.currentTarget,n=e.pageX,r=e.pageY,o=null;if(e.button)return;function a(m){return Math.abs(m.pageX-n)+Math.abs(m.pageY-r)>l.drag.threshold}function u(m){if(!o){if(!a(m))return;o=k(t.cloneNode(!0),"ge-toolbar-helper"),document.body.appendChild(o),k(d,"ge-dropping")}me(o,{left:m.pageX-14,top:m.pageY-14}),Xr(m.pageX,m.pageY)}function c(m){if(document.removeEventListener("pointermove",u),sn(document,"pointerup pointercancel",c),!!o){o.remove(),O(d,"ge-dropping"),Rt();var g=function(x){x.target!==t&&!t.contains(x.target)||(x.preventDefault(),x.stopImmediatePropagation())};window.addEventListener("click",g,{capture:!0,once:!0}),window.setTimeout(function(){window.removeEventListener("click",g,{capture:!0})},0);var w=An(m.pageX,m.pageY);w&&Yr(t,w)}}document.addEventListener("pointermove",u),Q(document,"pointerup pointercancel",c)}function An(e,t){var n=e-window.scrollX,r=t-window.scrollY,o=document.elementFromPoint(n,r);if(!o)return null;var a=oe(o,[".column",".ge-canvas"].concat(Zt("regions")).join(", "));if(!a||a!==d&&!d.contains(a))return null;var u=null;return G(a,Qt()).forEach(function(c){if(!u){var m=c.getBoundingClientRect();r<m.top+m.height/2&&(u=c)}}),{region:a,before:u}}function qr(e,t){var n=S[e.getAttribute("data-ge-feature")].toolbar[parseInt(e.getAttribute("data-ge-item"),10)],r=n.create(),o=r;if(n.inColumn)Me(t.region,".column")||(o=Nt(r));else if(!en(t.region,r)){var a=t.region===d?[]:xr(t.region,d).reverse().concat([t.region]),u=a[0]||null;t={region:d,before:u?u.nextElementSibling:null}}return $(n.kind,r,function(){t.before?t.before.parentNode.insertBefore(o,t.before):t.region.appendChild(o)},{parent:t.region,source:n.source||"dragdrop"})}function Nt(e){var t=Oe();return t.appendChild(fe(P)).appendChild(e),t}function Xr(e,t){var n=An(e,t);if(!n)return Rt();_e||(_e=v("div",{class:"ge-drop-marker"})),n.before?n.before.parentNode.insertBefore(_e,n.before):n.region.appendChild(_e)}function Rt(){_e&&_e.remove()}function Yr(e,t){if(e.getAttribute("data-ge-toolbar")==="feature")return qr(e,t);var n=e.getAttribute("data-ge-toolbar")==="container",r=e.getAttribute("data-ge-container-type"),o=n?D[r].create({}):$r(e.getAttribute("data-ge-layout")),a=o;return n&&!Me(t.region,".column")&&(a=Nt(o)),$(n?r:"row",o,function(){t.before?t.before.parentNode.insertBefore(a,t.before):t.region.appendChild(a)},{parent:t.region,source:"dragdrop"})}function Jr(){for(var e=[],t=1;t<=P;t++)e.push(String(t));return{name:"col",values:e.concat(un),appliesTo:["column"],labelKey:"utility.col_width",className:function(n,r){return Ce(K(n),Dt(r))},choices:function(){return l.valid_col_sizes.map(String)},label:function(n){return n==="equal"?p("utility.col_equal"):n==="auto"?p("utility.col_auto"):n},write:function(n,r,o,a){return jt(n,r===null?null:Dt(r),a,o)},blank:function(n,r){var o=r===W?null:ot(n,K(r));return o?p("utility.col_from_row",{count:ar(o.value)}):null}}}function Dt(e){return/^\d+$/.test(String(e))?parseInt(e,10):e}function $r(e){return/^\s*\{/.test(e||"")?De(JSON.parse(e)):De((e||"").split(",").filter(function(t){return t!==""}).map(Dt))}function De(e){var t=Oe();if(Array.isArray(e))return e.forEach(function(r){t.appendChild(fe(r))}),t;Object.keys(e.row_cols||{}).forEach(function(r){var o=e.row_cols[r],a=K(r);a&&je.indexOf(String(o))!==-1&&k(t,dn(a,o))});for(var n=0;n<(e.columns||0);n++)t.appendChild(fe(null));return t}function Qr(e){return h.filter(function(t){return e&&e[t.key]!==void 0}).map(function(t){return(t.infix?t.key+": ":"")+e[t.key]}).join(", ")}function Zr(e){var t=1;return Object.keys(e.row_cols||{}).forEach(function(n){var r=e.row_cols[n];r!=="auto"&&(t=Math.max(t,parseInt(r,10)||1))}),Array.apply(null,Array(Math.min(t,e.columns||t))).map(function(){return"equal"})}function eo(){var e=window.pageYOffset;e>bt(E).top&&e<bt(d).top+_r(d)?y(b,"ge-top")&&(me(b,{left:bt(b).left,width:Xe(b)}),O(b,"ge-top"),k(b,"ge-fixed")):y(b,"ge-fixed")&&(me(b,{left:"",width:""}),O(b,"ge-fixed"),k(b,"ge-top"))}function to(){var e=this;if(!e.getAttribute("data-ge-content-type")&&!te()&&vt(e)){var t=Mn();t.length&&(t.length===1?Sn(e,t[0]):no(e,t))}}function Sn(e,t){return t.available&&!t.available()?(t.missingKey&&console.error(p(t.missingKey)),!1):H(function(){var n=Y("plain",e,{source:"tool",from:"plain",to:t.type});if(!L("before-convert",n))return!1;k(e,"ge-content-type-"+t.type),e.setAttribute("data-ge-content-type",t.type);var r=e.parentElement;return y(r,"ge-text-block")&&(O(r,"ge-plain-block"),G(r,".ge-tools-drawer").forEach(function(o){o.remove()})),L("after-convert",n),t.edit(e),!0})}function no(e,t){var n=y(e.parentElement,"ge-text-block")?e.parentElement:null;n&&Tn(T(n,".ge-tools-drawer"),t.map(function(r){return{label:r.label,title:p("tool.convert_type",{editor:r.label}),attributes:{"data-ge-content-type":r.type},choose:function(){Sn(e,r)}}}),"ge-text-picker ge-convert-picker",n)}function Tn(e,t,n,r){if(te(),!!e){var o=oe(e,".ge-tools-drawer");o&&k(o,"ge-picker-open"),X=e.appendChild(k(v("div",{class:"ge-size-picker"}),n||"")),t.forEach(function(a){var u=gt(v("a",{class:"ge-size ge-size-flex"}),a.attributes||{});u.setAttribute("title",a.title||a.label),u.textContent=a.label,u.addEventListener("click",function(c){c.preventDefault(),c.stopPropagation(),te(),a.choose()}),X.appendChild(u)}),On(r||e)}}function On(e){e.addEventListener("mouseleave",function(){window.setTimeout(function(){X&&!X.matches(":hover")&&te()},400)},{once:!0})}function Ln(){var e={},t=[];return Object.keys(S).forEach(function(n){var r=S[n];r.textTypes&&(r.textTypes()||[]).forEach(function(o){if(e[o.type]){e[o.type]!==n&&J("text-type:"+o.type,'the "'+n+'" plugin declares the text type "'+o.type+'", which the "'+e[o.type]+'" plugin already declares: ignored');return}e[o.type]=n,t.push(o)})}),t}function Mn(){return Ln().filter(function(e){return e.offered!==!1})}function ro(e){return Ln().some(function(t){return t.type===e})}function zn(){ke(),le()}function oo(){ke(),B.style.height=.8*document.documentElement.clientHeight+"px",B.value=d.innerHTML,Pe(B),ye(d),xe=!0,Z("onSourceOpen",B)}function Pn(){Z("onSourceClose",B),xe=!1,ft(d,B.value),Pe(d),le(),ye(B)}function le(){U&&!ct(U.node)&&ne(),vr(!0),k(d,"ge-editing"),I(d,"ge-drag-drawer",l.drag_handle==="drawer"),Bo();var e=mi();pi(e),vi(e),hi(),zo(),Po(),Eo(),Z("onInit"),$o(),ti(),br(A),tt(d)}function ke(){ne(),O(d,"ge-editing ge-drag-drawer ge-dropping"),Z("onBeforeDeinit"),te(),Rt(),_(d,".ge-tools-drawer").forEach(function(e){e.remove()}),bi(),Z("onDeinit"),Wn(d),_(d,"[data-ge-row-cols]").forEach(function(e){e.removeAttribute("data-ge-row-cols")}),xo(),ui(),oi(),vr(!1)}function jn(){ke(),Ge(d);var e=d.innerHTML;return le(),e}function io(e){ke(),Ge(e);var t=e.outerHTML;return le(),t}function ao(){return cn(jn())}function lo(){xe&&Pn(),ke(),hn(),tr(),E.remove(),B.remove(),vn.abort(),xt.delete(d),mn=!0}function so(){var e=uo();Ft("grid",{},Jr()),l.row_cols!==!1&&Ft("grid",{},Xo());var t=function(r){return!l.plugins||l.plugins.indexOf(r)!==-1},n=function(r,o){return o.always===!0||t(r)};Object.keys(C.containers).forEach(function(r){t(r)&&(D[r]=C.containers[r](e))}),Object.keys(C.features).forEach(function(r){var o=C.features[r];n(r,o)&&(S[r]=o(e))}),Object.keys(C.utilities).forEach(function(r){t(r)&&(V[r]=C.utilities[r](e),(V[r].families||[]).forEach(function(o){Ft(r,V[r],o)}))}),Object.keys(S).forEach(function(r){var o=S[r].methods||{};Object.keys(o).forEach(function(a){Ue[a]=o[a]})}),(l.plugins||[]).forEach(function(r){D[r]||S[r]||V[r]||J("plugin:"+r,'the "'+r+'" plugin is not loaded: include dist/plugins/grideditor.'+r+".js after the editor")})}function Z(e,t){[D,S,V].forEach(function(n){Object.keys(n).forEach(function(r){n[r][e]&&n[r][e](t)})})}function uo(){return{canvas:d,settings:l,t:p,warn:N,containerId:yo,defaultRegion:Co,createTool:M,createMoveTool:he,addSettingsTool:Be,deleteNode:ve,place:dt,createPaneControls:ko,makeLabelEditable:Ao,labelIn:So,unwrapLabels:To,suspendToggles:qn,resumeToggles:Xn,emit:L,payloadFor:Y,operate:H,kindOf:ae,view:an,viewTiers:function(){return Mr(A).map(function(e){return e.key})},breakpoints:h.map(function(e){return e.key}),getUtility:Hn,setUtility:Kt,utilityField:wo,bareStyle:po,rowFromLayout:De,nodeHtml:io,textReady:Kr,attachPicker:Jn,openPicker:Tn,closePicker:te,detailsOf:Zn,drawerOf:co,toolbarItems:function(e){return E?_(E,'[data-ge-toolbar="feature"][data-ge-feature="'+e+'"]'):[]}}}function co(e){if(y(e,"ge-content")){var t=e.parentElement;return y(t,"ge-text-block")?T(t,".ge-tools-drawer"):null}return T(e,".ge-tools-drawer")}var se={},fo=".row, .column, .ge-content, .ge-element, [data-ge-container]",Ze="data-ge-preview",Ut=!1;function Ft(e,t,n){var r=n.name||n.prefix;if(se[r]){N('the "'+e+'" plugin declares the utility "'+r+'", which the "'+se[r].plugin+'" plugin already declared: ignored');return}se[r]={plugin:e,family:Object.assign({},n,{name:r,values:n.values.map(String),appliesTo:n.appliesTo||t.appliesTo||["row","column"]})}}function et(e,t){return se[e]?se[e].family:(J("utility:"+e,t+"("+JSON.stringify(e)+"): no loaded plugin declares that utility"),null)}function In(e,t){return t==="plain"&&(t="text"),e.appliesTo.indexOf(t)!==-1?!0:!!D[t]&&e.appliesTo.indexOf("container")!==-1}function Nn(e){return Object.keys(se).map(function(t){return se[t].family}).filter(function(t){return In(t,e)})}function Ht(e,t,n){return e.className?e.className(t.key,n):e.prefix+(t.infix?"-"+t.infix:"")+"-"+n}function ue(e,t,n){for(var r=(e.getAttribute("class")||"").split(/\s+/),o=0;o<t.values.length;o++)if(r.indexOf(Ht(t,n,t.values[o]))!==-1)return t.values[o];return null}function Rn(e,t,n){for(var r=h.indexOf(n)-1;r>=0;r--){var o=ue(e,t,h[r]);if(o!==null)return{tier:h[r],value:o}}return null}function Dn(e,t,n){var r=ue(e,t,n);if(r!==null)return r;var o=Rn(e,t,n);return o?o.value:null}function Wt(e,t){return h.map(function(n){return{tier:n,value:ue(e,t,n)}}).filter(function(n){return n.value!==null})}function Un(e,t,n,r){t.values.forEach(function(o){O(e,Ht(t,n,o))}),r!==null&&k(e,Ht(t,n,r)),mt(e)}function Fn(e,t,n){return n===W?ue(e,t,h[0]):Dn(e,t,K(n))}function mo(e,t,n,r){if(n!==W){var o=K(n);return ue(e,t,o)===r?null:{writes:[{tier:o,value:r}],cleared:[]}}var a=[],u=[];return Wt(e,t).forEach(function(c){c.tier!==h[0]&&(a.push({tier:c.tier,value:null}),u.push({breakpoint:c.tier.key,value:c.value}))}),ue(e,t,h[0])!==r&&a.unshift({tier:h[0],value:r}),a.length?{writes:a,cleared:u}:null}function Hn(e,t,n){e=pe(e);var r=et(t,"getUtility");if(!r||!e)return null;var o=n===void 0?A:on(n);return o===null?(N("getUtility("+JSON.stringify(n)+"): no such layout mode"),null):Fn(e,r,o)}function Kt(e,t,n,r){r=typeof r=="string"?{view:r}:r||{},e=pe(e);var o=et(t,"setUtility");if(!o||!e)return!1;var a=r.view===void 0?A:on(r.view);if(a===null)return N("setUtility("+JSON.stringify(r.view)+"): no such layout mode"),!1;if(n=n==null||n===""?null:String(n),n!==null&&o.values.indexOf(n)===-1)return N("setUtility: "+JSON.stringify(n)+' is not a value of "'+t+'", which takes '+JSON.stringify(o.values)),!1;var u=ae(e);if(!In(o,u))return N('setUtility: "'+t+'" does not apply to a '+u),!1;if(o.write)return o.write(e,n,a,r.source||"api");var c=mo(e,o,a,n);return c?H(function(){var m=Y(u,e,{family:t,breakpoint:a,tiers:c.writes.map(function(g){return g.tier.key}),from:Fn(e,o,a),to:n,cleared:c.cleared,source:r.source||"api"});return L("before-utility",m)?(c.writes.forEach(function(g){Un(e,o,g.tier,g.value)}),ee(e),L("after-utility",m),!0):(ee(e),!1)}):!1}function po(e,t,n){var r=et(t,"bareStyle");if(e=pe(e),!r||!e)return null;var o=e.getAttribute("class");h.forEach(function(u){Un(e,r,u,null)});var a=getComputedStyle(e).getPropertyValue(n);return o===null?e.removeAttribute("class"):e.setAttribute("class",o),a}function ee(e){var t=Zn(e);if(t){var n=z(t,".ge-classes");n&&(n.value=Gt(e).join(" ")),G(t,".ge-utilities").forEach(function(r){Bt(r)})}tt(e)}function go(e){return we(e,fo)}function tt(e){Wn(e),A!==W&&vo(e,K(A)),qo(e),Z("onRefresh",e)}function vo(e,t){go(e).forEach(function(n){var r=ae(n),o={};Nn(r).forEach(function(a){!a.preview||!Wt(n,a).length||Object.assign(o,a.preview(Dn(n,a,t),n,r))}),r==="column"&&Object.assign(o,Go(n,t)),Object.keys(V).forEach(function(a){var u=V[a];u.preview&&Object.assign(o,u.preview(n,r,t.key))}),Object.keys(o).length&&ho(n,o)})}function ho(e,t){var n=e.style,r={};Object.keys(t).forEach(function(o){r[o]=[n.getPropertyValue(o),n.getPropertyPriority(o)],n.setProperty(o,String(t[o]),"important")}),e.setAttribute(Ze,JSON.stringify(r))}function Wn(e){we(e,"["+Ze+"]").forEach(function(t){var n=t.style,r={};try{r=JSON.parse(t.getAttribute(Ze))||{}}catch(o){}Object.keys(r).forEach(function(o){var a=r[o];a&&a[0]?n.setProperty(o,a[0],a[1]):n.removeProperty(o)}),t.removeAttribute(Ze),pt(t)})}function bo(e){var t=ae(e),n=Nn(t).filter(function(u){return u.panel!==!1}).map(function(u){return Kn(e,u)});if(Object.keys(V).forEach(function(u){var c=V[u],m=c.panel?c.panel(e,t):null;m&&n.push(m)}),!n.length)return null;var r=I(v("div",{class:"ge-utilities"}),"ge-open",Ut);gn.set(r,e);var o=r.appendChild(v("a",{class:"ge-utilities-toggle"}));o.addEventListener("click",function(){Ut=!y(r,"ge-open"),er().forEach(function(u){_(u,".ge-utilities").forEach(function(c){I(c,"ge-open",Ut)})})});var a=r.appendChild(v("div",{class:"ge-utilities-body"}));return n.forEach(function(u){a.appendChild(u)}),Bt(r),r}function Kn(e,t){var n=v("label",{class:"ge-utility","data-ge-family":t.name});n.appendChild(v("span",{class:"ge-utility-label"},t.labelKey?p(t.labelKey):t.name));var r=n.appendChild(v("select",{class:"form-select form-select-sm"}));return r.addEventListener("change",function(){Kt(e,t.name,this.value,{source:"panel"})}),n.appendChild(v("small",{class:"ge-utility-note"})),n}function wo(e,t){var n=et(t,"utilityField");if(!n)return null;var r=Kn(e,n);return Bn(r,e),r}function Bt(e){var t=gn.get(e);G(e,".ge-utilities-toggle").forEach(function(n){n.textContent=p("utility.section",{view:p($e(A))})}),_(e,".ge-utility").forEach(function(n){Bn(n,t)})}function Bn(e,t){var n=se[e.getAttribute("data-ge-family")].family,r=T(e,"select"),o=n.choices?n.choices(t,ae(t)):n.values,a,u,c="";if(r.innerHTML="",A===W){a=ue(t,n,h[0]),u=p("utility.default");var m=Wt(t,n).filter(function(Le){return Le.tier!==h[0]});m.length&&(c=p("utility.varies",{breakpoints:m.map(function(Le){return Le.tier.key}).join(", ")}))}else{var g=K(A),w=Rn(t,n,g);a=ue(t,n,g),u=w?p("utility.inherit",{value:Vn(n,w.value),breakpoint:w.tier.key}):p("utility.default");var x=n.blank?n.blank(t,A):null;x&&a===null&&(u=x)}a!==null&&o.indexOf(a)===-1&&(o=o.concat([a])),r.appendChild(v("option",{value:""},u)),o.forEach(function(Le){r.appendChild(v("option",{value:Le},Vn(n,Le)))}),r.value=a===null?"":a;var be=T(e,".ge-utility-note");be.textContent=c,ln(be,c!=="")}function Vn(e,t){return e.label?e.label(t):t}var D={},S={},V={},Ue={},Gn=0;function yo(e){return Gn++,"ge-"+e+"-"+Gn+"-"+Math.random().toString(36).slice(2,6)}function Co(){var e=Oe();return e.appendChild(fe(P)),e}function Ae(e){return e?e.getAttribute("data-ge-container"):null}function Eo(){_(d,"[data-ge-container]").forEach(function(e){var t=Ae(e),n=D[t];if(!n){J("container:"+t,'unknown container type "'+t+'"');return}k(e,"ge-container ge-container-"+t),n.mark(e),T(e,".ge-tools-drawer")||_o(e,t,n)})}function xo(){_(d,"[data-ge-container]").forEach(function(e){var t=D[Ae(e)];t&&t.unmark(e),O(e,"ge-container ge-container-"+Ae(e)),mt(e)})}function Se(e,t){var n=v("div",{class:t});return e.insertBefore(n,e.firstChild),n}function nt(e,t){(t||[]).forEach(function(n){M(e,n.title||"",n.className||"",n.iconClass||"bi bi-wrench",n.on)})}function _o(e,t,n){var r=Se(e,"ge-tools-drawer ge-container-drawer");he(r),Be(r,e,l.container_classes),nt(r,l.container_tools),n.tools&&n.tools(r,e),M(r,p("tool.delete_container"),"ge-delete-container","bi bi-trash",function(){ve(t,e,p("confirm.delete_container"),function(o){Je(e,o)})}),n.addPane&&M(r,p(n.addPaneKey),"ge-add-pane","bi bi-plus-circle",function(){var o=n.addPane(e,{});$(n.paneKind,o,function(){},{parent:e,source:"tool",container:e})})}function ko(e,t,n,r,o){var a=Se(e,"ge-tools-drawer ge-pane-drawer");return he(a),Be(a,e,l.pane_classes),nt(a,n),M(a,p("tool.delete_pane"),"ge-delete-pane","bi bi-trash",function(){ve(t,e,r,function(u){o(u)})}),a}function qn(e){e&&we(e,"[data-bs-toggle], [data-bs-dismiss]").forEach(function(t){["toggle","dismiss"].forEach(function(n){var r=t.getAttribute("data-bs-"+n);r!==null&&(t.setAttribute("data-ge-bs-"+n,r),t.removeAttribute("data-bs-"+n))})})}function Xn(e){e&&we(e,"[data-ge-bs-toggle], [data-ge-bs-dismiss]").forEach(function(t){["toggle","dismiss"].forEach(function(n){var r=t.getAttribute("data-ge-bs-"+n);r!==null&&(t.setAttribute("data-bs-"+n,r),t.removeAttribute("data-ge-bs-"+n))})})}function Ao(e){if(!St.has(e)){var t=oe(e,"[data-bs-toggle], [data-ge-bs-toggle]");St.add(e),e.setAttribute("title",p("tool.rename")),e.addEventListener("dblclick",function(n){n.preventDefault(),n.stopPropagation(),qn(t),e.setAttribute("contenteditable","true"),e.focus(),window.getSelection().selectAllChildren(e)}),e.addEventListener("keydown",function(n){e.getAttribute("contenteditable")==="true"&&n.key==="Enter"&&(n.preventDefault(),e.blur())}),e.addEventListener("blur",function(){e.removeAttribute("contenteditable"),Xn(t)})}}function So(e){var t=T(e,".ge-pane-label");return t||(t=v("span",{class:"ge-pane-label"},e.textContent.trim()),e.innerHTML="",e.appendChild(t)),t}function To(e){_(e,".ge-pane-label").forEach(function(t){St.delete(t),yt(t)})}function Yn(e,t){var n=fe(t);return $("column",n,function(){e.appendChild(n)},{parent:e,source:"tool"})}function Oo(e,t){!l.add_column.picker||!e||Jn(e,function(){Lo(e,t)})}function Jn(e,t){var n=null,r=function(){window.clearTimeout(n),n=null};Q(e,"mouseenter mousedown",function(){n||X||(n=window.setTimeout(function(){n=null,t()},l.add_column.delay))}),Q(e,"mouseleave mouseup",r)}function Lo(e,t){te();var n=$t(t,de()),r=oe(e,".ge-tools-drawer");r&&k(r,"ge-picker-open"),X=e.appendChild(v("div",{class:"ge-size-picker"})),l.valid_col_sizes.forEach(function(o){var a=v("a",{class:"ge-size","data-ge-size":o,title:Mo(o)},F(o)?o:Ce(h[0],o));I(a,"ge-size-tight",F(o)&&o>n),I(a,"ge-size-flex",!F(o)),a.addEventListener("click",function(u){u.preventDefault(),u.stopPropagation(),te(),Yn(t,o)}),X.appendChild(a)}),On(e)}function Mo(e){return e==="equal"?p("tool.column_equal"):e==="auto"?p("tool.column_auto"):p("tool.column_size",{size:e})}function te(){if(!X)return!1;var e=oe(X,".ge-tools-drawer");return e&&O(e,"ge-picker-open"),X.remove(),X=null,!0}function zo(){_(d,".row").forEach(function(e){if(!T(e,".ge-tools-drawer")){var t=Se(e,"ge-tools-drawer");he(t),Be(t,e,l.row_classes),nt(t,l.row_tools),M(t,p("tool.delete_row"),"ge-delete-row","bi bi-trash",function(){ve("row",e,p("confirm.delete_row"),function(n){Je(e,n)})}),M(t,p("tool.add_column"),"ge-add-column","bi bi-plus-circle",function(){te()||Yn(e,Ve(e,de())?null:l.add_column.size)}),Oo(T(t,".ge-add-column"),e)}})}function Po(){_(d,".column").forEach(function(e){if(!T(e,".ge-tools-drawer")){var t=Se(e,"ge-tools-drawer");he(t),M(t,p("tool.column_narrower"),"ge-decrease-col-width","bi bi-dash-lg",function(n){jt(e,n.shiftKey?Ke(l.valid_col_sizes):rt(l.valid_col_sizes.filter(F),He(e),-1),"tool")}),M(t,p("tool.column_wider"),"ge-increase-col-width","bi bi-plus-lg",function(n){jt(e,n.shiftKey?jo(e):rt(l.valid_col_sizes.filter(F),He(e),1),"tool")}),M(t,p("tool.indent_decrease"),"ge-decrease-col-offset","bi bi-text-indent-right",function(n){yn(e,n.shiftKey?Ke(l.valid_col_offsets):rt(l.valid_col_offsets,We(e),-1),"tool")}),M(t,p("tool.indent_increase"),"ge-increase-col-offset","bi bi-text-indent-left",function(n){yn(e,n.shiftKey?Io(e):rt(l.valid_col_offsets,We(e),1),"tool")}),Be(t,e,l.col_classes),nt(t,l.col_tools),M(t,p("tool.delete_column"),"ge-delete-column","bi bi-trash",function(){ve("column",e,p("confirm.delete_column"),function(n){Sr(e,400,n,!0)})}),M(t,p("tool.add_row"),"ge-add-row","bi bi-plus-circle",function(){var n=Oe();$("row",n,function(){e.appendChild(n)},{parent:e,source:"tool"})})}})}function de(){return A===W?h[h.length-1]:K(A)}function Fe(e){var t=de();if(ot(e,t))return null;var n=Yt(e,t);return n===null?P:n}function He(e){var t=Fe(e);if(F(t))return t;var n=Math.round(Xe(e)/$n(e.parentElement)*P);return Math.min(Math.max(n,1),P)}function $n(e){var t=window.getComputedStyle(e);return e.clientWidth-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight)}function We(e){return at(e,de())||0}function rt(e,t,n){var r=e.indexOf(t);return r===-1?e.reduce(function(o,a){return Math.abs(a-t)<Math.abs(o-t)?a:o},e[0]):e[Math.min(Math.max(r+n,0),e.length-1)]}function Ke(e){return e.filter(F).reduce(function(t,n){return Math.min(t,n)},P)}function Vt(e){return e.filter(F).reduce(function(t,n){return Math.max(t,n)},0)}function jo(e){var t=$t(e.parentElement,de(),e)-We(e);return Math.min(Vt(l.valid_col_sizes),Math.max(t,1))}function Io(e){var t=$t(e.parentElement,de(),e)-He(e);return Math.min(Vt(l.valid_col_offsets),Math.max(t,0))}function he(e){return l.drag_handle==="drawer"?null:M(e,p("tool.move"),"ge-move","bi bi-arrows-move")}function M(e,t,n,r,o){var a=v("a",{title:t,class:n});return a.appendChild(v("i",{class:r})),e.appendChild(a),typeof o=="function"&&a.addEventListener("click",o),o&&typeof o=="object"&&Object.keys(o).forEach(function(u){Q(a,u,o[u])}),a}function Gt(e){return(e.getAttribute("class")||"").split(/\s+/).filter(function(t){return t!==""&&!No(t)})}function No(e){return e==="row"||e==="column"||/^(ge-|ui-)/.test(e)||/^col(-(sm|md|lg|xl|xxl))?(-auto)?$/.test(e)?!0:h.some(function(t){return new RegExp("^("+t.colPrefix+"|"+t.offsetPrefix+")\\d+$").test(e)})}function Ro(e,t){Gt(e).forEach(function(n){O(e,n)}),t.split(/\s+/).forEach(function(n){n!==""&&k(e,n)}),mt(e)}function Be(e,t,n){var r=Do(t,n||[]);pn.set(t,r),M(e,p("tool.settings"),"ge-settings","bi bi-gear-fill",function(){Fo(t,r,this)});var o=ae(t);return Object.keys(V).forEach(function(a){V[a].drawerTools&&V[a].drawerTools(e,t,o)}),Object.keys(S).forEach(function(a){S[a].drawerTools&&S[a].drawerTools(e,t,o)}),e.appendChild(r)}function Do(e,t){var n=v("div",{class:"ge-details"}),r=n.appendChild(v("div",{class:"ge-details-general"})),o=function(g){var w=v("label",{class:"ge-field"});return w.appendChild(v("span",{class:"ge-field-label"},g)),r.appendChild(w)},a=v("input",{class:"ge-id form-control form-control-sm",placeholder:p("tool.id_placeholder"),title:p("tool.id_title")});a.value=e.getAttribute("id")||"",o(p("panel.id")).appendChild(a),a.addEventListener("change",function(){this.value===""?e.removeAttribute("id"):e.setAttribute("id",this.value)});var u=v("input",{class:"ge-classes form-control form-control-sm",placeholder:p("tool.classes_placeholder"),title:p("tool.classes_title")});u.value=Gt(e).join(" "),o(p("panel.classes")).appendChild(u),u.addEventListener("change",function(){Ro(e,this.value),ee(e)});var c=r.appendChild(v("div",{class:"btn-group btn-group-sm ge-presets",role:"group"}));t.forEach(function(g){var w=y(e,g.cssClass),x=v("a",{role:"button",class:"btn btn-sm btn-outline-secondary",title:g.title?g.title:p("tool.toggle_class",{label:g.label}),"aria-pressed":w?"true":"false"});x.innerHTML=g.label,I(x,"active",w),x.addEventListener("click",function(){I(x,"active"),x.setAttribute("aria-pressed",y(x,"active")?"true":"false"),I(e,g.cssClass,y(x,"active")),ee(e)}),c.appendChild(x)});var m=bo(e);return m&&n.appendChild(m),n}var Qn=["offcanvas","popover","modal","inline"],ce={},U=null,qt=new WeakMap;function Uo(){return Qn.indexOf(l.settings_panel)!==-1?l.settings_panel:(J("settings_panel",'settings_panel "'+l.settings_panel+'" is not one of '+Qn.join(", ")+": using offcanvas"),"offcanvas")}function Zn(e){return e&&pn.get(e)||null}function er(){return U&&U.mode!=="inline"?[d,U.details]:[d]}function Fo(e,t,n){var r=Uo();if(r==="inline"){ln(t);return}var o=U&&U.details===t;ne(),o||Ho(r,e,t,n)}function Ho(e,t,n,r){var o=Wo(e),a=new AbortController;U={mode:e,node:t,details:n,home:n.parentElement,next:n.nextElementSibling,gear:r,listening:a},z(o,".ge-settings-title").textContent=p("panel.title",{kind:Ko(t)}),z(o,".ge-settings-body").appendChild(n),Pe(n),k(t,"ge-settings-target");var u={signal:a.signal};if(document.addEventListener("keydown",function(m){m.key==="Escape"&&ne()},u),e==="offcanvas"){var c=window.innerWidth<576;I(o,"offcanvas-end",!c),I(o,"offcanvas-bottom",c),O(o,"hiding"),o.getBoundingClientRect(),k(o,"show")}else e==="popover"?(Xt(o,r),Q(window,"scroll resize",function(){Xt(o,r)},u),window.ResizeObserver&&(U.observer=new window.ResizeObserver(function(){Xt(o,r)}),U.observer.observe(n)),Q(document,"mousedown touchstart",function(m){!o.contains(m.target)&&!r.contains(m.target)&&ne()},u)):nr(o)}function ne(){var e=U;if(e){U=null;var t=ce[e.mode];e.listening.abort(),e.observer&&e.observer.disconnect(),e.mode==="offcanvas"?(O(t,"show"),k(t,"hiding"),window.setTimeout(function(){O(t,"hiding")},300)):e.mode==="popover"?ye(t):rr(t),O(e.node,"ge-settings-target"),e.details.style.removeProperty("display"),pt(e.details),e.home&&ct(e.home)?e.next&&e.next.parentElement===e.home?e.home.insertBefore(e.details,e.next):e.home.appendChild(e.details):e.details.remove()}}function Wo(e){if(ce[e])return ce[e];var t=function(){return v("button",{type:"button",class:"btn-close ge-settings-close","aria-label":p("panel.close")})},n;return e==="offcanvas"?(n=q('<div class="offcanvas offcanvas-end ge-settings-panel ge-settings-offcanvas" tabindex="-1" role="dialog"><div class="offcanvas-header"><h5 class="offcanvas-title ge-settings-title"></h5></div><div class="offcanvas-body ge-settings-body"></div></div>'),z(n,".offcanvas-header").appendChild(t())):e==="popover"?(n=q('<div class="popover bs-popover-bottom ge-settings-panel ge-settings-popover" role="dialog"><div class="popover-arrow"></div><div class="popover-header"><span class="ge-settings-title"></span></div><div class="popover-body ge-settings-body"></div></div>'),z(n,".popover-header").appendChild(t()),ye(n)):(n=q('<div class="modal fade ge-settings-panel ge-settings-modal" tabindex="-1" role="dialog" aria-hidden="true"><div class="modal-dialog modal-dialog-centered modal-dialog-scrollable"><div class="modal-content"><div class="modal-header"><h5 class="modal-title ge-settings-title"></h5></div><div class="modal-body ge-settings-body"></div><div class="modal-footer"></div></div></div></div>'),z(n,".modal-header").appendChild(t()),z(n,".modal-footer").appendChild(v("button",{type:"button",class:"btn btn-primary ge-settings-close"},p("panel.done")))),Ye(n,"click",".ge-settings-close",function(r){r.preventDefault(),ne()}),ce[e]=document.body.appendChild(n),n}function tr(){ne(),Object.keys(ce).forEach(function(e){e==="modal"?bn(ce[e]):ce[e].remove()}),re&&(re.remove(),re=null),ce={}}function Xt(e,t){if(ct(t)){Pe(e);var n=t.getBoundingClientRect(),r=8,o=T(e,".popover-body");o.style.removeProperty("max-height");var a=Xe(e),u=ht(e),c=window.innerHeight-n.bottom-2*r,m=n.top-2*r,g=u<=c||c>=m,w=g?c:m;u>w&&(me(o,{"max-height":Math.max(120,w-(u-ht(o)))}),u=ht(e));var x=g?n.bottom+r:n.top-r-u,be=Math.max(r,Math.min(n.left+n.width/2-24,window.innerWidth-a-r));I(e,"bs-popover-bottom",g),I(e,"bs-popover-top",!g),me(e,{top:x+window.pageYOffset,left:be+window.pageXOffset}),me(T(e,".popover-arrow"),{left:Math.max(r,Math.min(n.left+n.width/2-be-8,a-24))})}}var re=null;function nr(e){var t=Et();if(!t){re=v("div",{class:"modal-backdrop fade show ge-settings-backdrop"}),re.addEventListener("click",function(){ne()}),document.body.appendChild(re),k(e,"show"),e.style.display="block",e.removeAttribute("aria-hidden");return}var n=t.getOrCreateInstance(e),r=qt.get(e);r||(r={wanted:null,busy:!1},qt.set(e,r),wn(e),e.addEventListener("hide.bs.modal",function(){r.wanted==="open"&&(r.wanted="closed",r.busy=!0)}),e.addEventListener("shown.bs.modal",function(){r.busy=!1,r.wanted==="closed"&&rr(e)}),e.addEventListener("hidden.bs.modal",function(){r.busy=!1,r.wanted==="open"?nr(e):U&&U.mode==="modal"&&ne()})),r.wanted="open",r.busy||(r.busy=!0,n.show())}function rr(e){var t=Et();if(!t){re&&(re.remove(),re=null),O(e,"show"),e.style.removeProperty("display"),e.setAttribute("aria-hidden","true");return}var n=qt.get(e)||{wanted:null,busy:!1};n.wanted="closed",!n.busy&&y(e,"show")&&(n.busy=!0,t.getOrCreateInstance(e).hide())}function Ko(e){var t=ae(e);if(D[t]&&D[t].labelKey)return p(D[t].labelKey);switch(t){case"row":return p("panel.kind_row");case"column":return p("panel.kind_column");case"text":return p("panel.kind_text");case"element":return p("panel.kind_element");case"section":return p("panel.kind_section");case"tab":return p("panel.kind_tab");case"accordion-item":return p("panel.kind_accordion_item");default:return t}}function Bo(){_(d,'.column, div[class*="col-"], div.col').forEach(function(e){k(e,"column"),!(Yo(e).length||or(e.parentElement))&&lt(e,h[0],P)})}function or(e){return y(e,"row")&&h.some(function(t){return je.some(function(n){return y(e,dn(t,n))})})}function Ve(e,t){if(!y(e,"row"))return null;for(var n=h.indexOf(t);n>=0;n--)for(var r=0;r<je.length;r++)if(y(e,dn(h[n],je[r])))return{tier:n,value:je[r]};return null}function ir(e,t){for(var n=h.indexOf(t);n>=0;n--){var r=Te(e,h[n]);if(r!==null)return{tier:n,size:r}}return null}function ot(e,t){var n=Ve(e.parentElement,t);if(!n)return null;var r=ir(e,t);return!r||n.tier>r.tier||n.tier===r.tier&&r.size==="equal"?n:null}function Vo(e){return e.value==="auto"?0:P/parseInt(e.value,10)}function Go(e,t){var n=ot(e,t);return n?{flex:"0 0 auto",width:n.value==="auto"?"auto":100/parseInt(n.value,10)+"%","max-width":"100%"}:or(e.parentElement)&&!ir(e,t)?{flex:"0 0 auto",width:"100%","max-width":"100%"}:{}}function qo(e){we(e,".row").forEach(function(t){var n=l.row_cols===!1?null:A===W?Ve(t,h[0])||null:Ve(t,K(A));n?t.setAttribute("data-ge-row-cols",ar(n.value)):t.removeAttribute("data-ge-row-cols")})}function ar(e){return e==="auto"?p("badge.row_cols_auto"):p("badge.row_cols",{count:e})}function Xo(){return{name:"row-cols",prefix:"row-cols",values:je,appliesTo:["row"],labelKey:"utility.row_cols"}}function Te(e,t){var n=sr(e,t.colPrefix);return n!==null?n:y(e,Ce(t,"auto"))?"auto":y(e,Ce(t,"equal"))?"equal":null}function it(e,t){return sr(e,t.offsetPrefix)}function Yt(e,t){return lr(e,t,Te)}function at(e,t){return lr(e,t,it)}function lr(e,t,n){for(var r=h.indexOf(t);r>=0;r--){var o=n(e,h[r]);if(o!==null)return o}return null}function sr(e,t){var n=new RegExp("(?:^|\\s)"+t+"(\\d+)(?:\\s|$)").exec(e.getAttribute("class")||"");return n?parseInt(n[1],10):null}function ur(e,t,n){var r=(e.getAttribute("class")||"").split(/\s+/).filter(function(o){return o!==""&&!new RegExp("^"+t+"\\d+$").test(o)});n!==null&&r.push(t+n),e.setAttribute("class",r.join(" "))}function lt(e,t,n){ur(e,t.colPrefix,null),un.forEach(function(r){O(e,Ce(t,r))}),n!=null&&k(e,Ce(t,n))}function Jt(e,t,n){ur(e,t.offsetPrefix,n||null)}function Yo(e){return h.filter(function(t){return Te(e,t)!==null})}function $t(e,t,n){var r=0;return G(e,".column").forEach(function(o){if(!(n&&o===n)){var a=ot(o,t),u=a?Vo(a):Yt(o,t);r+=(F(u)?u:0)+(at(o,t)||0)}}),P-r}function st(e){var t=e.size===null||e.size===void 0?null:e.size,n=e.offset===null||e.offset===void 0?0:e.offset;return n=Math.min(Math.max(n,0),Lr),t===null||!F(t)?{size:t,offset:n,refused:!1}:(t=Math.min(Math.max(t,1),P),t+n<=P?{size:t,offset:n,refused:!1}:e.leading==="offset"?{size:P-n,offset:n,refused:!1}:{size:null,offset:n,refused:!0})}function Ge(e){we(e,".column").forEach(function(t){me(t,{width:"",height:"",left:"",top:""}),pt(t)})}function dr(e){return"ge-"+e+"-"+Nr}function Qt(){return[".row",".ge-text-block",".ge-content","[data-ge-container]"].concat(Zt("blocks")).join(", ")}function Zt(e){return Object.keys(S).map(function(t){return S[t][e]||null}).filter(function(t){return t!==null})}function en(e,t){var n=!0;return Object.keys(S).forEach(function(r){var o=S[r];n&&o.accepts&&o.accepts(e,t)===!1&&(n=!1)}),n}function Jo(){return l.drag_handle==="drawer"?".ge-tools-drawer > a:not(.ge-text-info):not(.ge-element-info), .ge-details, input, textarea, button, select, option":"input, textarea, button, select, option"}function ut(e,t){var n=jr();if(e=Array.isArray(e)?e:e?[e]:[],!(!e.length||!n)){var r=l.drag_handle==="drawer",o=Jo(),a=0;e.forEach(function(u){var c=t.group?{name:dr(t.group)}:{name:dr(t.draggable+"-"+ ++a),pull:!1,put:!1};t.group&&t.accepts&&(c.put=function(m,g,w){return g.options.group.name===c.name&&t.accepts(m.el,w)}),kt.push(n.create(u,Object.assign({group:c,draggable:t.draggable,handle:r?".ge-tools-drawer":".ge-tools-drawer .ge-move",filter:function(m,g){return oe(m.target,o,u)?!0:!g||g.parentNode!==u},preventOnFilter:!1,forceFallback:!0,fallbackOnBody:!1,ghostClass:"ge-drag-placeholder",chosenClass:"ge-drag-chosen",dragClass:"ge-drag-helper",fallbackClass:"ge-drag-helper",animation:l.drag.animation,delay:l.drag.delay||l.drag.touch_delay,delayOnTouchOnly:!l.drag.delay,touchStartThreshold:l.drag.threshold,scroll:l.drag.scroll,onStart:Qo,onEnd:ei},t.options||{})))})}}function $o(){if(!jr()){J("sortable_missing",p("error.sortable_missing"));return}ut(_(d,".row"),{draggable:".column",group:"column"}),ut([d].concat(_(d,".column")),{draggable:Qt(),group:"block",accepts:en});var e=Zt("regions");e.length&&ut(_(d,e.join(", ")),{draggable:">"+Qt(),group:"block",accepts:en}),Z("onSortable",ut)}function Qo(e){var t=e.item,n=It(t),r=cr(t),o={from:n,canceled:!1};At.set(t,o),H(function(){var a=L("before-move",Y(r.kind,r.node,{parent:n.parent,source:"dragdrop",from:n}));a||(o.canceled=!0)})}function cr(e){var t=y(e,"ge-text-block")&&T(e,".ge-content")||e;return{kind:ae(t),node:t}}function Zo(e,t){var n=G(t.parent).filter(function(r){return r!==e&&!y(r,"ge-tools-drawer")});!n.length||t.index>=n.length?t.parent.appendChild(e):t.parent.insertBefore(e,n[t.index])}function ei(e){var t=e.item,n=At.get(t),r=n?n.from:It(t);if(At.delete(t),n&&n.canceled){Zo(t,r);return}var o=It(t);if(!(o.parent===r.parent&&o.index===r.index)){var a=oe(t,"[data-ge-container]"),u=D[Ae(a)];u&&u.afterPaneMove&&u.afterPaneMove(a,t,r);var c=cr(t);H(function(){L("after-move",Y(c.kind,c.node,{parent:o.parent,source:"dragdrop",from:r,to:o,container:a||void 0}))})}}function ti(){l.resize.enabled&&_(d,".column").forEach(function(e){if(!T(e,".ge-resize-handle")){var t=T(e,".ge-tools-drawer");t&&t.appendChild(v("span",{class:"ge-resize-size"})),ni().forEach(function(n){var r=v("span",{class:"ge-resize-handle ge-resize-"+n,"data-ge-edge":n});r.addEventListener("pointerdown",ri),e.appendChild(r)})}})}function ni(){return String(l.resize.handles).split(",").map(function(e){return e.trim()}).filter(function(e){return e==="e"||e==="w"})}function ri(e){var t=e.currentTarget,n=t.parentElement,r=t.getAttribute("data-ge-edge")==="w",o=e.pageX,a=Xe(n);if(e.preventDefault(),!ii(n))return;k(n,"ge-resizing"),e.pointerId!==void 0&&t.setPointerCapture&&t.setPointerCapture(e.pointerId);function u(g){var w=g.pageX-o;return Math.max(1,a+(r?-w:w))}function c(g){n.style.width=u(g)+"px",ai(n,u(g))}function m(g){t.removeEventListener("pointermove",c),sn(t,"pointerup pointercancel",m),O(n,"ge-resizing"),li(n,u(g))}t.addEventListener("pointermove",c),Q(t,"pointerup pointercancel",m)}function oi(){_(d,".ge-resize-handle").forEach(function(e){e.remove()}),_(d,".ge-resize-size").forEach(function(e){e.remove()}),Ge(d)}function fr(e,t){var n=Math.round(t/$n(e.parentElement)*P),r=mr(e),o=r?Fe(r):null,a=Qe.get(e),u=a?a.units:He(e),c=r&&F(o)?u+o-Ke(l.valid_col_sizes):P-We(e);return Math.min(Math.max(n,Ke(l.valid_col_sizes)),Math.max(c,Ke(l.valid_col_sizes)),Vt(l.valid_col_sizes))}function mr(e){return l.resize.balance!=="next"?null:Er(e,".column")[0]||null}function tn(e,t){var n=T(e,".ge-tools-drawer"),r=n?T(n,".ge-resize-size"):null;r&&(r.textContent=t)}function pr(e){return(A===W?h[0].colPrefix:de().colPrefix)+e}function ii(e){var t=Fe(e),n=H(function(){return L("before-resize",Y("column",e,{source:"dragdrop",from:t,to:null}))});if(!n)return!1;var r={from:t,units:He(e)};return Qe.set(e,r),tn(e,pr(r.units)),!0}function ai(e,t){tn(e,pr(fr(e,t)))}function li(e,t){var n=Qe.get(e),r=fr(e,t);if(Qe.delete(e),tn(e,""),Ge(e),!!n&&r!==n.units){var o=Mt(e,r);o&&H(function(){zt(e,o),si(e,r-n.units),ee(e),L("after-resize",Y("column",e,Pt({source:"dragdrop",from:n.from,to:o.size},o.cleared)))})}}function si(e,t){var n=mr(e);if(!(!n||!t)){var r=Fe(n);if(F(r)){var o=Mt(n,r-t);o&&(zt(n,o),ee(n))}}}function ui(){kt.forEach(function(e){e.destroy()}),kt=[]}function Oe(){return v("div",{class:"row"})}function dt(e,t,n){var r=null;if(Si.forEach(function(c){r===null&&n&&n[c]!==void 0&&(r=c)}),r===null)return e;var o=pe(n[r]);if(!o)return N(t+": "+r+" matches no element; the "+t+" is left detached"),e;var a=r==="appendTo"||r==="prependTo"?o:o.parentElement,u=function(){return $(t,e,function(){r==="appendTo"?o.appendChild(e):r==="prependTo"?o.insertBefore(e,o.firstChild):r==="insertBefore"?o.parentNode.insertBefore(e,o):wt(e,o)},{parent:a,source:n.source||"api"})};return Ne>0?(Ot(u),e):u()}function di(e,t){var n=Oe();return e!==void 0&&!Array.isArray(e)&&!(e&&e.row_cols)&&(N("createRow: the layout is an array of column sizes, as in [8, 4], or { row_cols, columns }. Making an empty row instead."),e=[]),e&&!Array.isArray(e)&&(n=De(e)),(Array.isArray(e)?e:[]).forEach(function(r){n.appendChild(fe(r))}),dt(n,"row",t)}function ci(e,t){t=t||{};var n=pe(t.appendTo||t.prependTo||null);e===void 0&&n&&Ve(n,de())?e=null:!F(e)&&un.indexOf(e)===-1&&(N("createColumn: no column size given, using "+P),e=P);var r=fe(e,t.offset);return t.content!==void 0&&r.appendChild(Ci(t.content)),dt(r,"column",t)}function fi(e,t){t=t||{};var n=D[e];return n?dt(n.create(t),e,t):(N('createContainer: no such container type "'+e+'"'),null)}function gr(e,t,n){e=pe(e),n=n||{};var r=D[Ae(e)];if(!r||Ae(e)!==t)return N("this is not a "+t+" container"),null;var o=r.addPane(e,n);return $(r.paneKind,o,function(){},{parent:e,source:"api",container:e})}function nn(){var e={};return Object.keys(l).forEach(function(t){var n=l[t];e[t]=Array.isArray(n)?n.slice():n}),Object.freeze(e)}function fe(e,t){var n=v("div",{class:"column"}),r=Mr(A)[0],o=st({size:e,offset:t||0,leading:"offset"});return lt(n,r,o.size===null?e:o.size),Jt(n,r,o.offset),n}function vr(e){if(!(!l.custom_filter||!l.custom_filter.length)){var t=typeof l.custom_filter=="string"||typeof l.custom_filter=="function"?[l.custom_filter]:l.custom_filter;Array.prototype.forEach.call(t,function(n){typeof n=="string"&&(n=window[n]),n(d,e)})}}function mi(){var e=[".row","[data-ge-container]"];return Object.keys(S).forEach(function(t){var n=S[t],r=typeof n.cuts=="function"?n.cuts():n.cuts;r&&e.push(r)}),e.join(", ")}function pi(e){_(d,".column > .ge-content, .column > .ge-text-block > .ge-content").forEach(function(t){if(!(y(t,"ge-rte-active")||!G(t,e).length)){var n=t.getAttribute("data-ge-content-type"),r=y(t.parentElement,"ge-text-block")?t.parentElement:t,o=[],a=[];for(Array.prototype.slice.call(t.childNodes).forEach(function(m){m.nodeType===1&&m.matches(e)?(o.push({text:a},{block:m}),a=[]):a.push(m)}),o.push({text:a});t.firstChild;)t.removeChild(t.firstChild);var u=!1,c=r;o.forEach(function(m){var g;if(m.block)g=m.block;else if(gi(m.text))u?(g=rn(n),m.text.forEach(function(w){g.appendChild(w)})):(m.text.forEach(function(w){t.appendChild(w)}),g=r,u=!0);else return;g!==c&&wt(g,c),c=g}),u||r.remove()}})}function gi(e){return e.some(function(t){return t.nodeType===1||t.nodeType===3&&/\S/.test(t.nodeValue)})}function vi(e){_(d,".column").forEach(function(t){var n=[];G(t).forEach(function(r){Me(r,".ge-tools-drawer, .ge-resize-handle")||(Me(r,".ge-content, .ge-text-block")||r.matches(e)?n=hr(n):n.push(r))}),hr(n)})}function hr(e){if(e.length){var t=wt(rn(),e[e.length-1]);e.forEach(function(n){t.appendChild(n)})}return[]}function rn(e){var t=v("div",{class:"ge-content"});return e&&(k(t,"ge-content-type-"+e),t.setAttribute("data-ge-content-type",e)),t}function hi(){_(d,".column > .ge-content").forEach(function(e){kr(e,v("div",{class:"ge-text-block"}))}),_(d,".ge-text-block").forEach(function(e){if(!T(e,".ge-tools-drawer")){var t=T(e,".ge-content"),n=t?t.getAttribute("data-ge-content-type"):null;n?ro(n)||yi(e,n):wi(e)}})}function bi(){_(d,".ge-text-block").forEach(function(e){yt(e)})}function wi(e){var t=T(e,".ge-content"),n=Se(e,"ge-tools-drawer ge-text-drawer ge-plain-drawer");k(e,"ge-plain-block"),he(n),Object.keys(S).forEach(function(r){S[r].plainTools&&S[r].plainTools(n,t)}),M(n,p("tool.delete_plain"),"ge-delete-plain","bi bi-trash",function(){ve("plain",t,p("confirm.delete_plain"),function(r){Je(e,function(){e.remove(),r()})})})}function yi(e,t){var n=T(e,".ge-content"),r=Se(e,"ge-tools-drawer ge-text-drawer");he(r),M(r,p("text.no_editor",{type:t}),"ge-text-info ge-text-missing","bi bi-exclamation-triangle"),M(r,p("tool.delete_text"),"ge-delete-text","bi bi-trash",function(){ve("text",n,p("confirm.delete_text"),function(o){Je(e,function(){e.remove(),o()})})})}function Ci(e){var t=Mn(),n=rn(t.length?t[0].type:null);return e&&e.nodeType?n.appendChild(e):ft(n,e),n}function br(e){A=e,Ct.forEach(function(t){I(d,"ge-layout-"+t,t===e)}),z(Ee,"button").textContent=p($e(e))}function on(e){return typeof e=="number"?(J("changeView-index","changeView("+e+"): layout modes are identified by breakpoint key now, so pass one of "+JSON.stringify(Ct)+". Numeric indexes still work, but they mean what they meant in 2.x ("+Or.join(", ")+") and will be dropped."),Or[e]||null):Ct.indexOf(e)===-1?null:e}function wr(e){var t=on(e);if(t===null){N("changeView("+JSON.stringify(e)+"): no such layout mode");return}var n=A;br(t),t!==n&&(er().forEach(function(r){_(r,".ge-utilities").forEach(function(o){Bt(o)})}),tt(d),Z("onViewChange",t),L("view-change",{canvas:d,breakpoint:t,from:n,to:t}))}function an(){return A}function yr(e,t,n){return function(){return Ue[e]?Ue[e].apply(null,arguments):(J("plugin:"+t,e+" needs the "+t+" plugin: include dist/plugins/grideditor."+n+".js after the editor"),null)}}var Cr={getHtml:jn,getPlainHtml:ao,init:function(){Ot(le)},reset:function(){Ot(zn)},deinit:ke,destroy:lo,changeView:wr,getView:an,createRow:di,createColumn:ci,createText:function(e,t){return Ue.createText?Ue.createText(e,t):(J("plugin:text","createText needs a text editor plugin: include dist/plugins/grideditor.tinymce.js, or another editor's, after the editor"),null)},createElement:yr("createElement","elements","elements"),createSection:yr("createSection","sections","sections"),createContainer:fi,addTab:function(e,t){return gr(e,"tabs",t)},addAccordionItem:function(e,t){return gr(e,"accordion",t)},setLocale:Rr,getUtility:Hn,setUtility:Kt};Object.keys(Cr).forEach(function(e){var t=!!(Tr[e]&&Tr[e].value);i[e]=function(){if(mn)return J("destroyed:"+e,p("warning.destroyed",{method:e})),e==="getHtml"?d.innerHTML:e==="getPlainHtml"?cn(d.innerHTML):t?null:i;var n=Cr[e].apply(i,arguments);return t?n:i}}),i.canvas=d,i.settings=nn(),xt.set(d,i),so(),i.settings=nn(),Wr(),le(),C._created.forEach(function(e){e(i)})}C._created=[];C.containers={};C.features={};C.utilities={};C.texts={};C.t=_t;C._plainHtml=cn;C.Sortable=null;C.bootstrap=null;C.version="7.1.0";C.locales={en:{"tool.move":"Move","tool.settings":"Settings","tool.add_row":"Add row","tool.delete_text":"Remove text","tool.delete_plain":"Remove content","tool.convert_type":"Edit as {editor} text","text.no_editor":'No text editor "{type}" is loaded: this text can be moved and deleted, not edited',"tool.add_column":`Add column
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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/js/register.js", "../../src/js/dom.js", "../../src/js/text/grideditor.text.js", "../../src/js/plugins/grideditor.tinymce.js"],
4
- "sourcesContent": ["/**\n * What a plugin's or a locale's classic script imports in place of the\n * editor: the GridEditor the page already loaded.\n *\n * The build points `import { GridEditor } from '../grideditor.js'` here for\n * the classic scripts, so each registers on the editor the page has rather\n * than bringing its own. Loaded before the editor there is nothing to\n * register on, and saying so is better than a TypeError three calls later.\n */\nvar GridEditor = window.GridEditor;\n\nif (!GridEditor || typeof GridEditor.get !== 'function') {\n throw new Error('grid-editor: load grideditor.js (or grideditor.bundle.min.js) before its plugins, ' +\n 'its locales and grideditor.jquery.js');\n}\n\nexport { GridEditor };\nexport default GridEditor;\n", "/**\n * The DOM, the way grid-editor uses it.\n *\n * Small helpers over the browser's own API, for the core and the shipped\n * plugins. Not a public API: a plugin of a host's own is free to write its\n * DOM code however it likes, and this file makes no promise to it.\n *\n * Stateless on purpose. The build puts a copy of this file in each plugin's\n * classic script, so anything kept here would be kept once per copy; a\n * module that needs to remember something about a node keeps its own\n * WeakMap.\n */\n\n/** Every element under `root` matching `selector`, as an array. */\nexport function all(root, selector) {\n return root ? Array.prototype.slice.call(root.querySelectorAll(selector)) : [];\n}\n\n/** The first element under `root` matching `selector`, or null. */\nexport function one(root, selector) {\n return root ? root.querySelector(selector) : null;\n}\n\n/** `root` itself when it matches, then every element under it that does. */\nexport function selfAndAll(root, selector) {\n if (!root) { return []; }\n\n var found = all(root, selector);\n if (root.nodeType === 1 && root.matches(selector)) { found.unshift(root); }\n return found;\n}\n\n/** The element children of `node`, those matching `selector` if one is given. */\nexport function children(node, selector) {\n if (!node) { return []; }\n\n return Array.prototype.filter.call(node.children, function(each) {\n return !selector || each.matches(selector);\n });\n}\n\n/** The first element child matching `selector`, or null. */\nexport function child(node, selector) {\n return children(node, selector)[0] || null;\n}\n\n/** The nearest ancestor-or-self matching `selector` below `stopAt`, or null. */\nexport function closest(node, selector, stopAt) {\n var found = node && node.nodeType === 1 ? node.closest(selector) : null;\n\n if (found && stopAt && found !== stopAt && !stopAt.contains(found)) { return null; }\n return found;\n}\n\n/** Whether `node` is an element matching `selector`. */\nexport function is(node, selector) {\n return !!node && node.nodeType === 1 && node.matches(selector);\n}\n\n/** Whether `node` is in the document. */\nexport function attached(node) {\n return !!node && document.documentElement.contains(node);\n}\n\n/** The element siblings after `node` that match `selector`. */\nexport function nextAll(node, selector) {\n var found = [];\n\n for (var next = node.nextElementSibling; next; next = next.nextElementSibling) {\n if (!selector || next.matches(selector)) { found.push(next); }\n }\n return found;\n}\n\n/** The ancestors of `node` up to, and not including, `stop`, nearest first. */\nexport function parentsUntil(node, stop) {\n var found = [];\n\n for (var parent = node.parentElement; parent && parent !== stop; parent = parent.parentElement) {\n found.push(parent);\n }\n return found;\n}\n\n/**\n * The nodes the html parses into, detached. Parsed the way innerHTML parses,\n * so a <script> in it never runs, here or once it is in the page.\n */\nexport function parse(html) {\n var template = document.createElement('template');\n template.innerHTML = html;\n return Array.prototype.slice.call(template.content.childNodes);\n}\n\n/** The one element the html is, detached. */\nexport function create(html) {\n var nodes = parse(html.trim());\n\n for (var i = 0; i < nodes.length; i++) {\n if (nodes[i].nodeType === 1) { return nodes[i]; }\n }\n return null;\n}\n\n/** An element of `tag`, with `attributes` and `text`. */\nexport function element(tag, attributes, text) {\n var node = document.createElement(tag);\n\n Object.keys(attributes || {}).forEach(function(name) {\n var value = attributes[name];\n if (value !== null && value !== undefined && value !== false) { node.setAttribute(name, value); }\n });\n if (text !== undefined && text !== null) { node.textContent = text; }\n\n return node;\n}\n\n/** Replace what `node` holds with `html`. A <script> in it does not run. */\nexport function setHtml(node, html) {\n node.innerHTML = html === undefined || html === null ? '' : String(html);\n return node;\n}\n\n/** Add one or several space separated classes. */\nexport function addClass(node, names) {\n split(names).forEach(function(name) { node.classList.add(name); });\n return node;\n}\n\nexport function removeClass(node, names) {\n split(names).forEach(function(name) { node.classList.remove(name); });\n return node;\n}\n\n/** Each class on, or off, or flipped when `on` is not given. */\nexport function toggleClass(node, names, state) {\n split(names).forEach(function(name) {\n if (state === undefined) {\n node.classList.toggle(name);\n } else {\n node.classList.toggle(name, !!state);\n }\n });\n return node;\n}\n\nexport function hasClass(node, name) {\n return !!node && node.nodeType === 1 && node.classList.contains(name);\n}\n\nfunction split(names) {\n return String(names || '').split(/\\s+/).filter(Boolean);\n}\n\n/** Take the class attribute off when there is nothing left in it. */\nexport function dropEmptyClass(node) {\n if (!node.getAttribute('class')) { node.removeAttribute('class'); }\n return node;\n}\n\n/** Take the style attribute off when there is nothing left in it. */\nexport function dropEmptyStyle(node) {\n if (!node.getAttribute('style')) { node.removeAttribute('style'); }\n return node;\n}\n\n/** Set attributes; a null or undefined value takes the attribute off. */\nexport function attr(node, attributes) {\n Object.keys(attributes).forEach(function(name) {\n var value = attributes[name];\n\n if (value === null || value === undefined) {\n node.removeAttribute(name);\n } else {\n node.setAttribute(name, value);\n }\n });\n return node;\n}\n\n/**\n * Inline styles, by css property name. A number is pixels for the properties\n * that take a length, as jQuery had it; an empty string takes one off.\n */\nexport function css(node, styles) {\n Object.keys(styles).forEach(function(property) {\n var value = styles[property];\n\n if (typeof value === 'number' && !UNITLESS[property]) { value = value + 'px'; }\n node.style.setProperty(property, value === null || value === undefined ? '' : String(value));\n });\n return node;\n}\n\nvar UNITLESS = { opacity: true, 'z-index': true, 'flex-grow': true, 'flex-shrink': true, order: true };\n\n/** What an element of this tag shows as when nothing hides it. */\nvar defaultDisplays = {};\n\nfunction defaultDisplay(node) {\n var tag = node.nodeName;\n\n if (!defaultDisplays[tag]) {\n var probe = document.body.appendChild(document.createElement(tag));\n defaultDisplays[tag] = getComputedStyle(probe).display;\n probe.remove();\n if (defaultDisplays[tag] === 'none') { defaultDisplays[tag] = 'block'; }\n }\n return defaultDisplays[tag];\n}\n\n/** Show a node: its inline display:none off, and a display of its own if a stylesheet hides it. */\nexport function show(node) {\n node.style.removeProperty('display');\n if (getComputedStyle(node).display === 'none') { node.style.display = defaultDisplay(node); }\n return node;\n}\n\nexport function hide(node) {\n node.style.display = 'none';\n return node;\n}\n\n/** Show or hide; flip when `on` is not given. */\nexport function toggle(node, state) {\n if (state === undefined) { state = !visible(node); }\n return state ? show(node) : hide(node);\n}\n\n/** Whether a node takes up room: what jQuery's :visible meant. */\nexport function visible(node) {\n return !!(node.offsetWidth || node.offsetHeight || node.getClientRects().length);\n}\n\n/** The border box's width, fractions included. */\nexport function outerWidth(node) {\n return node.getBoundingClientRect().width;\n}\n\nexport function outerHeight(node) {\n return node.getBoundingClientRect().height;\n}\n\n/** The content box's height, which is what jQuery's height() gave. */\nexport function contentHeight(node) {\n var style = getComputedStyle(node);\n return node.clientHeight - parseFloat(style.paddingTop) - parseFloat(style.paddingBottom);\n}\n\n/** Where a node is on the page, not in the window. */\nexport function offset(node) {\n var box = node.getBoundingClientRect();\n return { top: box.top + window.pageYOffset, left: box.left + window.pageXOffset };\n}\n\n/** Its index among its parent's element children, those matching `selector` if given. */\nexport function indexIn(node, selector) {\n return children(node.parentElement, selector).indexOf(node);\n}\n\n/** Put `node` right after `reference`. */\nexport function insertAfter(node, reference) {\n reference.parentNode.insertBefore(node, reference.nextSibling);\n return node;\n}\n\n/** Replace `node` with what it holds. */\nexport function unwrap(node) {\n var parent = node.parentNode;\n\n while (node.firstChild) { parent.insertBefore(node.firstChild, node); }\n node.remove();\n}\n\n/** Put `node` inside `wrapper`, where `node` was. */\nexport function wrap(node, wrapper) {\n node.parentNode.insertBefore(wrapper, node);\n wrapper.appendChild(node);\n return wrapper;\n}\n\n/**\n * Listen on `root` for `types` (space separated) on descendants that match\n * `selector`, with `this` the matched element, as jQuery's delegated\n * handlers had it. Hands back the listener, for removeEventListener; a\n * signal in `options` removes it too.\n */\nexport function delegate(root, types, selector, handler, options) {\n var listener = function(event) {\n var match = closest(event.target, selector, root);\n if (match && root.contains(match)) { return handler.call(match, event); }\n return undefined;\n };\n\n split(types).forEach(function(type) { root.addEventListener(type, listener, options); });\n return listener;\n}\n\n/** Listen for several space separated event types with one handler. */\nexport function on(target, types, handler, options) {\n split(types).forEach(function(type) { target.addEventListener(type, handler, options); });\n return handler;\n}\n\nexport function off(target, types, handler, options) {\n split(types).forEach(function(type) { target.removeEventListener(type, handler, options); });\n}\n\n/** A mouse event of `type` sent to `node`, the way a pointer would. */\nexport function fire(node, type) {\n node.dispatchEvent(new MouseEvent(type, { bubbles: type !== 'mouseenter' && type !== 'mouseleave' }));\n}\n\n/* ------------------------------------------------------------------\n * Taking a node away, visibly.\n *\n * The durations are the ones 6.x had through jQuery: 400 ms unless the\n * caller says otherwise. `done` runs once the node is out of sight, which is\n * when the caller removes it; a node that is already out of sight is done at\n * once, on the next task, as jQuery had it.\n * ------------------------------------------------------------------ */\n\nvar DEFAULT_DURATION = 400;\n\nfunction animateAway(node, frames, duration, done) {\n duration = duration === undefined ? DEFAULT_DURATION : duration;\n\n var finish = function() {\n hide(node);\n if (done) { done(); }\n };\n\n if (!visible(node) || !node.animate || duration <= 0) {\n window.setTimeout(finish, 0);\n return;\n }\n\n var animation = node.animate(frames(getComputedStyle(node)), {\n duration: duration,\n easing: 'ease-in-out',\n });\n var called = false;\n var once = function() {\n if (called) { return; }\n called = true;\n finish();\n };\n\n animation.onfinish = once;\n animation.oncancel = once;\n}\n\n/** Fold a node up to nothing, then hide it. */\nexport function slideUp(node, duration, done) {\n if (typeof duration === 'function') {\n done = duration;\n duration = undefined;\n }\n\n node.style.overflow = 'hidden';\n animateAway(node, function(style) {\n return [\n {\n height: style.height,\n paddingTop: style.paddingTop,\n paddingBottom: style.paddingBottom,\n marginTop: style.marginTop,\n marginBottom: style.marginBottom,\n },\n { height: '0px', paddingTop: '0px', paddingBottom: '0px', marginTop: '0px', marginBottom: '0px' },\n ];\n }, duration, function() {\n node.style.removeProperty('overflow');\n if (done) { done(); }\n });\n}\n\n/** Fade a node out, then hide it. */\nexport function fadeOut(node, duration, done) {\n animateAway(node, function(style) {\n return [{ opacity: style.opacity }, { opacity: 0 }];\n }, duration, done);\n}\n\n/** Fade and fold a node, in height and, with `width`, sideways too, then hide it. */\nexport function shrinkAway(node, duration, done, width) {\n node.style.overflow = 'hidden';\n animateAway(node, function(style) {\n var from = { opacity: style.opacity, height: style.height };\n var to = { opacity: 0, height: '0px' };\n\n if (width) {\n from.width = style.width;\n to.width = '0px';\n }\n return [from, to];\n }, duration, function() {\n node.style.removeProperty('overflow');\n if (done) { done(); }\n });\n}\n", "/**\n * Text for grid-editor: what the text editor plugins share.\n *\n * Not a file a page loads. The build puts it at the top of each text editor\n * plugin - grideditor.tinymce.js, grideditor.ckeditor.js,\n * grideditor.summernote.js - and whichever of them loads first installs it:\n * a page with two editors has one of these.\n *\n * It is a feature plugin, `text`, that the `plugins` setting does not choose\n * (content_types does), and it is everything a text is to the editor: the\n * text block's drawer, the Text buttons in the toolbar, createText, opening\n * an editor on a click and closing it again with the host's attributes put\n * back, and making the host's plain content a text through the core's\n * `textTypes` hook.\n *\n * Each editor registers under GridEditor.texts, which is this file's own\n * registry and not a contract: an editor of a host's own is a feature plugin\n * of its own, as example/custom_editor.html shows.\n */\nimport { GridEditor } from '../grideditor.js';\nimport * as dom from '../dom.js';\n\n// However many editors a page loads, each with a copy of this file in its\n// classic script: the first one installs it\nif (!GridEditor.features.text) {\n\n Object.assign(GridEditor.locales.en, {\n 'text.add': 'Text',\n 'text.add_type': 'Text ({editor})',\n 'panel.editor': 'Editor',\n 'panel.kind_text': 'Text',\n });\n\n /**\n * What a content area's attributes were before its editor opened, and\n * once it had: the two readings closeText plays the host's changes\n * back from. Shared by every editor on the page, like the nodes.\n */\n var readBefore = new WeakMap();\n var readReady = new WeakMap();\n\n /** What a text editor puts on a content area while it is open, whenever it likes. */\n var EDITOR_CLASS = /^(mce-|cke|note-)|^(active|ge-rte-active)$/;\n var EDITOR_ATTRIBUTE = /^(data-mce-|contenteditable$|spellcheck$)/;\n\n function attributesOf(element) {\n var found = {};\n Array.prototype.slice.call(element.attributes).forEach(function(attribute) {\n found[attribute.name] = attribute.value;\n });\n return found;\n }\n\n function classesIn(value) {\n return (value || '').split(/\\s+/).filter(function(name) {\n return name !== '' && !EDITOR_CLASS.test(name);\n });\n }\n\n /** The host's markup, with what changed from `ready` to `open` played back onto it. */\n function restoreAttributes(block, before, ready, open) {\n var result = Object.assign({}, before);\n\n Object.keys(Object.assign({}, ready, open)).forEach(function(name) {\n if (name === 'class' || EDITOR_ATTRIBUTE.test(name) || ready[name] === open[name]) { return; }\n\n if (open[name] === undefined) {\n delete result[name];\n } else {\n result[name] = open[name];\n }\n });\n\n var readyClasses = classesIn(ready['class']);\n var openClasses = classesIn(open['class']);\n var classes = classesIn(before['class']).filter(function(name) {\n return openClasses.indexOf(name) !== -1 || readyClasses.indexOf(name) === -1;\n });\n openClasses.forEach(function(name) {\n if (readyClasses.indexOf(name) === -1 && classes.indexOf(name) === -1) { classes.push(name); }\n });\n\n // In the host's order, class where it was: getHtml should not\n // shuffle a node's attributes because it was edited\n if (classes.length) { result['class'] = classes.join(' '); } else { delete result['class']; }\n\n Object.keys(attributesOf(block)).forEach(function(name) { block.removeAttribute(name); });\n Object.keys(result).forEach(function(name) { block.setAttribute(name, result[name]); });\n }\n\n function textFeature(ge) {\n\n var settings = ge.settings;\n var TEXTS = {};\n var warned = {};\n\n Object.keys(GridEditor.texts).forEach(function(type) {\n TEXTS[type] = GridEditor.texts[type](ge);\n });\n\n // Every editor loaded, in the order the page loaded them, unless the\n // host names the ones it wants\n if (!Array.isArray(settings.content_types)) { settings.content_types = Object.keys(TEXTS); }\n if (!Array.isArray(settings.text_tools)) { settings.text_tools = []; }\n if (!Array.isArray(settings.text_classes)) { settings.text_classes = []; }\n\n /** The text editors this editor offers, in content_types order: the ones loaded. */\n function offeredTexts() {\n return settings.content_types.filter(function(type) { return !!TEXTS[type]; });\n }\n\n /** What a text editor is called: its plugin's label, or its type. */\n function textLabel(type) {\n var text = TEXTS[type];\n return text && text.labelKey ? ge.t(text.labelKey) : type;\n }\n\n /** A detached content area of `type`, holding `content` or the editor's initial content. */\n function makeText(type, content) {\n var text = TEXTS[type];\n var block = dom.element('div', {\n 'class': 'ge-content ge-content-type-' + type,\n 'data-ge-content-type': type,\n });\n\n if (content && content.nodeType) {\n block.appendChild(content);\n } else {\n dom.setHtml(block, content !== undefined ? content : (text && text.initialContent) || '');\n }\n return block;\n }\n\n /**\n * createText(type?, options?): a content area of a text editor's,\n * detached unless a placement is given. The type is the first one\n * offered by default. `options.content` is its html.\n */\n function apiCreateText(type, options) {\n if (type && typeof type === 'object') {\n options = type;\n type = undefined;\n }\n options = options || {};\n type = type || offeredTexts()[0];\n\n if (!type || !TEXTS[type]) {\n if (!warned['createText:' + type]) {\n warned['createText:' + type] = true;\n ge.warn('createText: no text editor \"' + type + '\" is loaded; ' +\n 'load its plugin and name it in content_types');\n }\n return null;\n }\n\n return ge.place(makeText(type, options.content), 'text', options);\n }\n\n /** Whether a content area is a text of one of the editors loaded here. */\n function isOurs(block) {\n return !!TEXTS[block.getAttribute('data-ge-content-type')];\n }\n\n /** Open the editor on a text, once: until it is closed again. */\n function startText(block) {\n if (dom.hasClass(block, 'ge-rte-active')) { return; }\n\n // A content area nobody can see - a tab that is not the open one,\n // a closed accordion item - has no geometry for an editor to lay\n // its toolbar out against, and nothing anyone can type into\n if (!dom.visible(block)) { return; }\n\n // The attribute: it is markup, and the drawer reads it the same way\n var text = TEXTS[block.getAttribute('data-ge-content-type')];\n if (!text) { return; }\n\n // Not marked active, so the next click tries again: the library\n // may be loaded by then\n if (text.available && !text.available()) {\n if (text.missingKey) { console.error(ge.t(text.missingKey)); }\n return;\n }\n\n readBefore.set(block, attributesOf(block));\n readReady.delete(block);\n dom.addClass(block, 'ge-rte-active');\n text.start([block]);\n }\n\n function onClick() {\n startText(this);\n }\n\n /**\n * Close the text editor on one content area, and leave the content\n * area's own attributes as the host left them.\n *\n * An editor adds attributes of its own while it is open, and takes\n * them off again, more or less: CKEditor leaves aria-readonly behind.\n * tinyMCE does worse, and puts back every attribute as it was when it\n * opened, so an id, a class or a plugin's attribute given while it was\n * open is lost. So the attributes are read three times - before the\n * editor opens, once it has opened, and before it closes - and what\n * changed between the second and the third, the host's doing, is\n * played back onto the first, the host's markup. What the editor did\n * is left out either way.\n */\n function closeText(block) {\n var text = TEXTS[block.getAttribute('data-ge-content-type')];\n var before = readBefore.get(block);\n var open = before ? attributesOf(block) : null;\n\n // Every content area is told, as in 5.x: one whose editor never\n // started is the plugin's to ignore\n if (text) { text.stop([block]); }\n\n // After stop, not before: an editor that restores the class\n // attribute it snapshotted would put ge-rte-active back\n dom.removeClass(block, 'ge-rte-active');\n\n if (before) {\n restoreAttributes(block, before, readReady.get(block) || before, open);\n readBefore.delete(block);\n readReady.delete(block);\n }\n }\n\n function createTextControls(textBlock) {\n var block = dom.child(textBlock, '.ge-content');\n var type = block.getAttribute('data-ge-content-type');\n var drawer = dom.element('div', { 'class': 'ge-tools-drawer ge-text-drawer' });\n textBlock.insertBefore(drawer, textBlock.firstChild);\n\n ge.createMoveTool(drawer);\n\n var details = ge.addSettingsTool(drawer, block, settings.text_classes);\n\n // Which editor edits it, first in its settings: something to\n // know about it, not something to do with it\n var general = dom.child(details, '.ge-details-general');\n var editor = dom.element('div', { 'class': 'ge-field ge-text-editor' });\n editor.appendChild(dom.element('span', { 'class': 'ge-field-label' }, ge.t('panel.editor')));\n editor.appendChild(dom.element('span', { 'class': 'ge-field-value' }, textLabel(type)));\n general.insertBefore(editor, general.firstChild);\n\n settings.text_tools.forEach(function(hostTool) {\n ge.createTool(drawer, hostTool.title || '', hostTool.className || '',\n hostTool.iconClass || 'bi bi-wrench', hostTool.on);\n });\n\n ge.createTool(drawer, ge.t('tool.delete_text'), 'ge-delete-text', 'bi bi-trash', function() {\n ge.deleteNode('text', block, ge.t('confirm.delete_text'), function(removed) {\n // Its editor lets go first: removed while open, it would\n // be left behind, attached to nothing\n closeText(block);\n dom.slideUp(textBlock, function() {\n textBlock.remove();\n removed();\n });\n });\n });\n }\n\n /** A drawer for each text of ours in a text block that has none yet. */\n function markTexts() {\n dom.all(ge.canvas, '.ge-text-block').forEach(function(textBlock) {\n if (dom.child(textBlock, '.ge-tools-drawer')) { return; }\n\n var block = dom.child(textBlock, '.ge-content');\n if (!block || !isOurs(block)) { return; }\n\n createTextControls(textBlock);\n });\n }\n\n var texts = offeredTexts();\n var clicks = null; // The delegated click listener, while editing\n\n return {\n methods: {\n createText: apiCreateText,\n },\n\n /**\n * The types this plugin edits, for the core: every editor loaded\n * is the owner of its texts, and the ones offered are what the\n * host's plain content can be made.\n */\n textTypes: function() {\n var offered = offeredTexts();\n var others = Object.keys(TEXTS).filter(function(type) { return offered.indexOf(type) === -1; });\n\n return offered.concat(others).map(function(type) {\n var text = TEXTS[type];\n\n return {\n type: type,\n label: textLabel(type),\n offered: offered.indexOf(type) !== -1,\n available: text.available ? function() { return text.available(); } : null,\n missingKey: text.missingKey,\n edit: function(block) {\n var textBlock = block.parentElement;\n if (dom.hasClass(textBlock, 'ge-text-block') && !dom.child(textBlock, '.ge-tools-drawer')) {\n createTextControls(textBlock);\n }\n\n startText(block);\n },\n };\n });\n },\n\n // A text block of each editor offered. Like a container, it goes\n // into a row of its own when clicked, or where it is dropped\n toolbar: texts.map(function(type) {\n return {\n label: function() {\n return texts.length > 1 ? ge.t('text.add_type', { editor: textLabel(type) }) : ge.t('text.add');\n },\n iconClass: TEXTS[type].iconClass,\n className: 'ge-add-text-button',\n kind: 'text',\n inColumn: true,\n create: function() { return makeText(type); },\n };\n }),\n\n onInit: function() {\n markTexts();\n\n if (clicks) { ge.canvas.removeEventListener('click', clicks); }\n clicks = dom.delegate(ge.canvas, 'click', '.ge-content', onClick);\n },\n\n // While the drawers and the text blocks are still there, as the\n // editors left them\n onBeforeDeinit: function() {\n dom.all(ge.canvas, '.ge-content').forEach(function(block) {\n if (isOurs(block)) { closeText(block); }\n });\n },\n\n onDeinit: function() {\n if (clicks) { ge.canvas.removeEventListener('click', clicks); }\n clicks = null;\n },\n\n // The first time only: an undo says ready again, and by then the\n // host may have changed the content area itself\n onContentReady: function(area) {\n if (readBefore.has(area) && !readReady.has(area)) {\n readReady.set(area, attributesOf(area));\n }\n },\n };\n }\n\n // Whatever the plugins setting says: content_types chooses the editors\n textFeature.always = true;\n\n GridEditor.features.text = textFeature;\n\n}\n", "/**\n * tinyMCE for grid-editor's content areas.\n *\n * A text editor plugin: load this file after the editor, and tinyMCE 6\n * after or before it, and a text of the tinymce type is edited with an\n * inline tinyMCE. What it can ask the editor for is the handle its\n * factory is called with, described in docs/plugins.md.\n *\n * <script src=\"tinymce/tinymce.min.js\"></script>\n * <script src=\"dist/grideditor.min.js\"></script>\n * <script src=\"dist/plugins/grideditor.tinymce.min.js\"></script>\n *\n * Up to 5.x the main bundle carried a copy of this file; since 6.0 it is\n * loaded on its own, like every plugin. It imports what every text editor\n * shares - text blocks, the Text button, createText, making the host's plain\n * content a text - from src/js/text/grideditor.text.js, which the build puts\n * in its classic script, installed once however many editors a page loads.\n */\nimport { GridEditor } from '../grideditor.js';\nimport * as dom from '../dom.js';\nimport '../text/grideditor.text.js';\n\nObject.assign(GridEditor.locales.en, {\n 'text.tinymce': 'tinyMCE',\n 'warning.oninit_removed': 'tinyMCE\\'s oninit option was removed in 7.0 and is ignored: use init_instance_callback.',\n});\n\n// tinyMCE snapshots the target element's attributes when an inline editor is\n// created and restores them on remove(), so this has to run *after* remove()\n// to keep the grid editor's own class and tinyMCE's leftovers off the element.\nfunction cleanUp(contentArea) {\n dom.removeClass(contentArea, 'active ge-rte-active');\n ['id', 'style', 'spellcheck', 'contenteditable', 'data-mce-style'].forEach(function(name) {\n contentArea.removeAttribute(name);\n });\n}\n\nvar INITIAL_CONTENT = '<p>Lorem ipsum dolores</p>';\n\n// What this file remembers about a content area: its editor, and whether a\n// deinit came before that editor was ready\nvar editors = new WeakMap();\nvar pendingRemove = new WeakSet();\n\n// Said once per page, however many editors are on it\nvar warnedOninit = false;\n\nGridEditor.texts.tinymce = function(ge) {\n return {\n labelKey: 'text.tinymce',\n initialContent: INITIAL_CONTENT,\n missingKey: 'error.tinymce_missing',\n\n available: function() { return !!window.tinymce; },\n\n start: function(contentAreas) {\n var settings = ge.settings;\n var userConfig = (settings.tinymce && settings.tinymce.config) ? settings.tinymce.config : {};\n\n // 'oninit' was the pre-6 name for init_instance_callback, honoured\n // through 6.x and gone in 7.0\n if (userConfig.oninit && !warnedOninit) {\n warnedOninit = true;\n ge.warn(ge.t('warning.oninit_removed'));\n }\n\n contentAreas.forEach(function(contentArea) {\n if (dom.hasClass(contentArea, 'active')) { return; }\n\n if (contentArea.innerHTML == INITIAL_CONTENT) {\n contentArea.innerHTML = '';\n }\n dom.addClass(contentArea, 'active');\n\n var configuration = Object.assign({\n // tinyMCE's own \"Upgrade\" badge in the menubar. Off by\n // default because an inline editor here is a column of\n // someone's page, not tinyMCE's own interface; a host that\n // wants it back passes promotion: true.\n promotion: false,\n }, userConfig, {\n target: contentArea,\n inline: true,\n init_instance_callback: function(editor) {\n // deinit ran before this init finished, so tear it down again\n if (pendingRemove.has(contentArea)) {\n pendingRemove.delete(contentArea);\n editor.remove();\n // deinit already ran and cannot clean up after this\n // late remove(), so do it here instead\n cleanUp(contentArea);\n return;\n }\n\n editors.set(contentArea, editor);\n\n // The editor rewrote what is inside this content area\n // while it took it over, so whatever the grid editor\n // had in there is gone. Saying so lets it put its own\n // furniture back.\n ge.textReady(contentArea);\n\n // Undo and redo rewrite it too, from snapshots that\n // leave out whatever is marked data-mce-bogus - an\n // element's drawer among them - so it goes back in\n // after each of those as well\n editor.on('Undo Redo', function() {\n ge.textReady(contentArea);\n });\n\n // The inline toolbar is laid out against the element's\n // geometry at the moment tinyMCE draws it, and an\n // element that has just appeared - a tab pane, an\n // accordion body, a column whose width is still\n // settling - may not have its own width yet. Asking\n // for the ui again once the browser has laid the frame\n // out measures it as it now is, instead of leaving a\n // toolbar wrapped into a narrow column.\n window.requestAnimationFrame(function() {\n if (editor.removed || !editor.ui || !editor.ui.show) { return; }\n\n editor.ui.show();\n });\n\n // And again whenever the user comes back to this\n // editor: by then the element may have been resized,\n // hidden and shown again - a tab switched away from\n // and back, a column made narrower - and the toolbar\n // is only ever as right as its last measurement.\n editor.on('focus', function() {\n window.requestAnimationFrame(function() {\n if (editor.removed || !editor.ui || !editor.ui.show) { return; }\n\n editor.ui.show();\n });\n });\n\n // Bring focus to text field\n editor.focus();\n\n // Call the original callback, if one was passed in the config\n if (userConfig.init_instance_callback) {\n userConfig.init_instance_callback.call(this, editor);\n }\n }\n });\n // We always edit the element we were handed, so a selector in the\n // user config would only fight with target\n delete configuration.selector;\n delete configuration.oninit;\n\n window.tinymce.init(configuration);\n });\n },\n\n stop: function(contentAreas) {\n contentAreas.filter(function(contentArea) {\n return dom.hasClass(contentArea, 'active');\n }).forEach(function(contentArea) {\n var editor = editors.get(contentArea);\n\n if (editor) {\n editors.delete(contentArea);\n editor.remove();\n } else {\n // tinymce.init() is asynchronous, so the editor may not exist\n // yet. Leave a note for init_instance_callback to remove it.\n pendingRemove.add(contentArea);\n }\n\n cleanUp(contentArea);\n });\n },\n };\n};\n"],
4
+ "sourcesContent": ["/**\n * What a plugin's or a locale's classic script imports in place of the\n * editor: the GridEditor the page already loaded.\n *\n * The build points `import { GridEditor } from '../grideditor.js'` here for\n * the classic scripts, so each registers on the editor the page has rather\n * than bringing its own. Loaded before the editor there is nothing to\n * register on, and saying so is better than a TypeError three calls later.\n */\nvar GridEditor = window.GridEditor;\n\nif (!GridEditor || typeof GridEditor.get !== 'function') {\n throw new Error('grid-editor: load grideditor.js (or grideditor.bundle.min.js) before its plugins, ' +\n 'its locales and grideditor.jquery.js');\n}\n\nexport { GridEditor };\nexport default GridEditor;\n", "/**\n * The DOM, the way grid-editor uses it.\n *\n * Small helpers over the browser's own API, for the core and the shipped\n * plugins. Not a public API: a plugin of a host's own is free to write its\n * DOM code however it likes, and this file makes no promise to it.\n *\n * Stateless on purpose. The build puts a copy of this file in each plugin's\n * classic script, so anything kept here would be kept once per copy; a\n * module that needs to remember something about a node keeps its own\n * WeakMap.\n */\n\n/** Every element under `root` matching `selector`, as an array. */\nexport function all(root, selector) {\n return root ? Array.prototype.slice.call(root.querySelectorAll(selector)) : [];\n}\n\n/** The first element under `root` matching `selector`, or null. */\nexport function one(root, selector) {\n return root ? root.querySelector(selector) : null;\n}\n\n/** `root` itself when it matches, then every element under it that does. */\nexport function selfAndAll(root, selector) {\n if (!root) { return []; }\n\n var found = all(root, selector);\n if (root.nodeType === 1 && root.matches(selector)) { found.unshift(root); }\n return found;\n}\n\n/** The element children of `node`, those matching `selector` if one is given. */\nexport function children(node, selector) {\n if (!node) { return []; }\n\n return Array.prototype.filter.call(node.children, function(each) {\n return !selector || each.matches(selector);\n });\n}\n\n/** The first element child matching `selector`, or null. */\nexport function child(node, selector) {\n return children(node, selector)[0] || null;\n}\n\n/** The nearest ancestor-or-self matching `selector` below `stopAt`, or null. */\nexport function closest(node, selector, stopAt) {\n var found = node && node.nodeType === 1 ? node.closest(selector) : null;\n\n if (found && stopAt && found !== stopAt && !stopAt.contains(found)) { return null; }\n return found;\n}\n\n/** Whether `node` is an element matching `selector`. */\nexport function is(node, selector) {\n return !!node && node.nodeType === 1 && node.matches(selector);\n}\n\n/** Whether `node` is in the document. */\nexport function attached(node) {\n return !!node && document.documentElement.contains(node);\n}\n\n/** The element siblings after `node` that match `selector`. */\nexport function nextAll(node, selector) {\n var found = [];\n\n for (var next = node.nextElementSibling; next; next = next.nextElementSibling) {\n if (!selector || next.matches(selector)) { found.push(next); }\n }\n return found;\n}\n\n/** The ancestors of `node` up to, and not including, `stop`, nearest first. */\nexport function parentsUntil(node, stop) {\n var found = [];\n\n for (var parent = node.parentElement; parent && parent !== stop; parent = parent.parentElement) {\n found.push(parent);\n }\n return found;\n}\n\n/**\n * The nodes the html parses into, detached. Parsed the way innerHTML parses,\n * so a <script> in it never runs, here or once it is in the page.\n */\nexport function parse(html) {\n var template = document.createElement('template');\n template.innerHTML = html;\n return Array.prototype.slice.call(template.content.childNodes);\n}\n\n/** The one element the html is, detached. */\nexport function create(html) {\n var nodes = parse(html.trim());\n\n for (var i = 0; i < nodes.length; i++) {\n if (nodes[i].nodeType === 1) { return nodes[i]; }\n }\n return null;\n}\n\n/** An element of `tag`, with `attributes` and `text`. */\nexport function element(tag, attributes, text) {\n var node = document.createElement(tag);\n\n Object.keys(attributes || {}).forEach(function(name) {\n var value = attributes[name];\n if (value !== null && value !== undefined && value !== false) { node.setAttribute(name, value); }\n });\n if (text !== undefined && text !== null) { node.textContent = text; }\n\n return node;\n}\n\n/** Replace what `node` holds with `html`. A <script> in it does not run. */\nexport function setHtml(node, html) {\n node.innerHTML = html === undefined || html === null ? '' : String(html);\n return node;\n}\n\n/** Add one or several space separated classes. */\nexport function addClass(node, names) {\n split(names).forEach(function(name) { node.classList.add(name); });\n return node;\n}\n\nexport function removeClass(node, names) {\n split(names).forEach(function(name) { node.classList.remove(name); });\n return node;\n}\n\n/** Each class on, or off, or flipped when `on` is not given. */\nexport function toggleClass(node, names, state) {\n split(names).forEach(function(name) {\n if (state === undefined) {\n node.classList.toggle(name);\n } else {\n node.classList.toggle(name, !!state);\n }\n });\n return node;\n}\n\nexport function hasClass(node, name) {\n return !!node && node.nodeType === 1 && node.classList.contains(name);\n}\n\nfunction split(names) {\n return String(names || '').split(/\\s+/).filter(Boolean);\n}\n\n/** Take the class attribute off when there is nothing left in it. */\nexport function dropEmptyClass(node) {\n if (!node.getAttribute('class')) { node.removeAttribute('class'); }\n return node;\n}\n\n/** Take the style attribute off when there is nothing left in it. */\nexport function dropEmptyStyle(node) {\n if (!node.getAttribute('style')) { node.removeAttribute('style'); }\n return node;\n}\n\n/** Set attributes; a null or undefined value takes the attribute off. */\nexport function attr(node, attributes) {\n Object.keys(attributes).forEach(function(name) {\n var value = attributes[name];\n\n if (value === null || value === undefined) {\n node.removeAttribute(name);\n } else {\n node.setAttribute(name, value);\n }\n });\n return node;\n}\n\n/**\n * Inline styles, by css property name. A number is pixels for the properties\n * that take a length, as jQuery had it; an empty string takes one off.\n */\nexport function css(node, styles) {\n Object.keys(styles).forEach(function(property) {\n var value = styles[property];\n\n if (typeof value === 'number' && !UNITLESS[property]) { value = value + 'px'; }\n node.style.setProperty(property, value === null || value === undefined ? '' : String(value));\n });\n return node;\n}\n\nvar UNITLESS = { opacity: true, 'z-index': true, 'flex-grow': true, 'flex-shrink': true, order: true };\n\n/** What an element of this tag shows as when nothing hides it. */\nvar defaultDisplays = {};\n\nfunction defaultDisplay(node) {\n var tag = node.nodeName;\n\n if (!defaultDisplays[tag]) {\n var probe = document.body.appendChild(document.createElement(tag));\n defaultDisplays[tag] = getComputedStyle(probe).display;\n probe.remove();\n if (defaultDisplays[tag] === 'none') { defaultDisplays[tag] = 'block'; }\n }\n return defaultDisplays[tag];\n}\n\n/** Show a node: its inline display:none off, and a display of its own if a stylesheet hides it. */\nexport function show(node) {\n node.style.removeProperty('display');\n if (getComputedStyle(node).display === 'none') { node.style.display = defaultDisplay(node); }\n return node;\n}\n\nexport function hide(node) {\n node.style.display = 'none';\n return node;\n}\n\n/** Show or hide; flip when `on` is not given. */\nexport function toggle(node, state) {\n if (state === undefined) { state = !visible(node); }\n return state ? show(node) : hide(node);\n}\n\n/** Whether a node takes up room: what jQuery's :visible meant. */\nexport function visible(node) {\n return !!(node.offsetWidth || node.offsetHeight || node.getClientRects().length);\n}\n\n/** The border box's width, fractions included. */\nexport function outerWidth(node) {\n return node.getBoundingClientRect().width;\n}\n\nexport function outerHeight(node) {\n return node.getBoundingClientRect().height;\n}\n\n/** The content box's height, which is what jQuery's height() gave. */\nexport function contentHeight(node) {\n var style = getComputedStyle(node);\n return node.clientHeight - parseFloat(style.paddingTop) - parseFloat(style.paddingBottom);\n}\n\n/** Where a node is on the page, not in the window. */\nexport function offset(node) {\n var box = node.getBoundingClientRect();\n return { top: box.top + window.pageYOffset, left: box.left + window.pageXOffset };\n}\n\n/** Its index among its parent's element children, those matching `selector` if given. */\nexport function indexIn(node, selector) {\n return children(node.parentElement, selector).indexOf(node);\n}\n\n/** Put `node` right after `reference`. */\nexport function insertAfter(node, reference) {\n reference.parentNode.insertBefore(node, reference.nextSibling);\n return node;\n}\n\n/** Replace `node` with what it holds. */\nexport function unwrap(node) {\n var parent = node.parentNode;\n\n while (node.firstChild) { parent.insertBefore(node.firstChild, node); }\n node.remove();\n}\n\n/** Put `node` inside `wrapper`, where `node` was. */\nexport function wrap(node, wrapper) {\n node.parentNode.insertBefore(wrapper, node);\n wrapper.appendChild(node);\n return wrapper;\n}\n\n/**\n * Listen on `root` for `types` (space separated) on descendants that match\n * `selector`, with `this` the matched element, as jQuery's delegated\n * handlers had it. Hands back the listener, for removeEventListener; a\n * signal in `options` removes it too.\n */\nexport function delegate(root, types, selector, handler, options) {\n var listener = function(event) {\n var match = closest(event.target, selector, root);\n if (match && root.contains(match)) { return handler.call(match, event); }\n return undefined;\n };\n\n split(types).forEach(function(type) { root.addEventListener(type, listener, options); });\n return listener;\n}\n\n/** Listen for several space separated event types with one handler. */\nexport function on(target, types, handler, options) {\n split(types).forEach(function(type) { target.addEventListener(type, handler, options); });\n return handler;\n}\n\nexport function off(target, types, handler, options) {\n split(types).forEach(function(type) { target.removeEventListener(type, handler, options); });\n}\n\n/** A mouse event of `type` sent to `node`, the way a pointer would. */\nexport function fire(node, type) {\n node.dispatchEvent(new MouseEvent(type, { bubbles: type !== 'mouseenter' && type !== 'mouseleave' }));\n}\n\n/* ------------------------------------------------------------------\n * Taking a node away, visibly.\n *\n * The durations are the ones 6.x had through jQuery: 400 ms unless the\n * caller says otherwise. `done` runs once the node is out of sight, which is\n * when the caller removes it; a node that is already out of sight is done at\n * once, on the next task, as jQuery had it.\n * ------------------------------------------------------------------ */\n\nvar DEFAULT_DURATION = 400;\n\nfunction animateAway(node, frames, duration, done) {\n duration = duration === undefined ? DEFAULT_DURATION : duration;\n\n var finish = function() {\n hide(node);\n if (done) { done(); }\n };\n\n if (!visible(node) || !node.animate || duration <= 0) {\n window.setTimeout(finish, 0);\n return;\n }\n\n var animation = node.animate(frames(getComputedStyle(node)), {\n duration: duration,\n easing: 'ease-in-out',\n });\n var called = false;\n var once = function() {\n if (called) { return; }\n called = true;\n finish();\n };\n\n animation.onfinish = once;\n animation.oncancel = once;\n}\n\n/** Fold a node up to nothing, then hide it. */\nexport function slideUp(node, duration, done) {\n if (typeof duration === 'function') {\n done = duration;\n duration = undefined;\n }\n\n node.style.overflow = 'hidden';\n animateAway(node, function(style) {\n return [\n {\n height: style.height,\n paddingTop: style.paddingTop,\n paddingBottom: style.paddingBottom,\n marginTop: style.marginTop,\n marginBottom: style.marginBottom,\n },\n { height: '0px', paddingTop: '0px', paddingBottom: '0px', marginTop: '0px', marginBottom: '0px' },\n ];\n }, duration, function() {\n node.style.removeProperty('overflow');\n if (done) { done(); }\n });\n}\n\n/** Fade a node out, then hide it. */\nexport function fadeOut(node, duration, done) {\n animateAway(node, function(style) {\n return [{ opacity: style.opacity }, { opacity: 0 }];\n }, duration, done);\n}\n\n/** Fade and fold a node, in height and, with `width`, sideways too, then hide it. */\nexport function shrinkAway(node, duration, done, width) {\n node.style.overflow = 'hidden';\n animateAway(node, function(style) {\n var from = { opacity: style.opacity, height: style.height };\n var to = { opacity: 0, height: '0px' };\n\n if (width) {\n from.width = style.width;\n to.width = '0px';\n }\n return [from, to];\n }, duration, function() {\n node.style.removeProperty('overflow');\n if (done) { done(); }\n });\n}\n", "/**\n * Text for grid-editor: what the text editor plugins share.\n *\n * Not a file a page loads. The build puts it at the top of each text editor\n * plugin - grideditor.tinymce.js, grideditor.ckeditor.js,\n * grideditor.summernote.js - and whichever of them loads first installs it:\n * a page with two editors has one of these.\n *\n * It is a feature plugin, `text`, that the `plugins` setting does not choose\n * (content_types does), and it is everything a text is to the editor: the\n * text block's drawer, the Text buttons in the toolbar, createText, opening\n * an editor on a click and closing it again with the host's attributes put\n * back, and making the host's plain content a text through the core's\n * `textTypes` hook.\n *\n * Each editor registers under GridEditor.texts, which is this file's own\n * registry and not a contract: an editor of a host's own is a feature plugin\n * of its own, as example/custom_editor.html shows.\n */\nimport { GridEditor } from '../grideditor.js';\nimport * as dom from '../dom.js';\n\n// However many editors a page loads, each with a copy of this file in its\n// classic script: the first one installs it\nif (!GridEditor.features.text) {\n\n Object.assign(GridEditor.locales.en, {\n 'text.add': 'Text',\n 'text.add_type': 'Text ({editor})',\n 'panel.editor': 'Editor',\n 'panel.kind_text': 'Text',\n });\n\n /**\n * What a content area's attributes were before its editor opened, and\n * once it had: the two readings closeText plays the host's changes\n * back from. Shared by every editor on the page, like the nodes.\n */\n var readBefore = new WeakMap();\n var readReady = new WeakMap();\n\n /** What a text editor puts on a content area while it is open, whenever it likes. */\n var EDITOR_CLASS = /^(mce-|cke|note-)|^(active|ge-rte-active)$/;\n var EDITOR_ATTRIBUTE = /^(data-mce-|contenteditable$|spellcheck$)/;\n\n function attributesOf(element) {\n var found = {};\n Array.prototype.slice.call(element.attributes).forEach(function(attribute) {\n found[attribute.name] = attribute.value;\n });\n return found;\n }\n\n function classesIn(value) {\n return (value || '').split(/\\s+/).filter(function(name) {\n return name !== '' && !EDITOR_CLASS.test(name);\n });\n }\n\n /** The host's markup, with what changed from `ready` to `open` played back onto it. */\n function restoreAttributes(block, before, ready, open) {\n var result = Object.assign({}, before);\n\n Object.keys(Object.assign({}, ready, open)).forEach(function(name) {\n if (name === 'class' || EDITOR_ATTRIBUTE.test(name) || ready[name] === open[name]) { return; }\n\n if (open[name] === undefined) {\n delete result[name];\n } else {\n result[name] = open[name];\n }\n });\n\n var readyClasses = classesIn(ready['class']);\n var openClasses = classesIn(open['class']);\n var classes = classesIn(before['class']).filter(function(name) {\n return openClasses.indexOf(name) !== -1 || readyClasses.indexOf(name) === -1;\n });\n openClasses.forEach(function(name) {\n if (readyClasses.indexOf(name) === -1 && classes.indexOf(name) === -1) { classes.push(name); }\n });\n\n // In the host's order, class where it was: getHtml should not\n // shuffle a node's attributes because it was edited\n if (classes.length) { result['class'] = classes.join(' '); } else { delete result['class']; }\n\n Object.keys(attributesOf(block)).forEach(function(name) { block.removeAttribute(name); });\n Object.keys(result).forEach(function(name) { block.setAttribute(name, result[name]); });\n }\n\n function textFeature(ge) {\n\n var settings = ge.settings;\n var TEXTS = {};\n var warned = {};\n\n Object.keys(GridEditor.texts).forEach(function(type) {\n TEXTS[type] = GridEditor.texts[type](ge);\n });\n\n // Every editor loaded, in the order the page loaded them, unless the\n // host names the ones it wants\n if (!Array.isArray(settings.content_types)) { settings.content_types = Object.keys(TEXTS); }\n if (!Array.isArray(settings.text_tools)) { settings.text_tools = []; }\n if (!Array.isArray(settings.text_classes)) { settings.text_classes = []; }\n\n /** The text editors this editor offers, in content_types order: the ones loaded. */\n function offeredTexts() {\n return settings.content_types.filter(function(type) { return !!TEXTS[type]; });\n }\n\n /** What a text editor is called: its plugin's label, or its type. */\n function textLabel(type) {\n var text = TEXTS[type];\n return text && text.labelKey ? ge.t(text.labelKey) : type;\n }\n\n /** A detached content area of `type`, holding `content` or the editor's initial content. */\n function makeText(type, content) {\n var text = TEXTS[type];\n var block = dom.element('div', {\n 'class': 'ge-content ge-content-type-' + type,\n 'data-ge-content-type': type,\n });\n\n if (content && content.nodeType) {\n block.appendChild(content);\n } else {\n dom.setHtml(block, content !== undefined ? content : (text && text.initialContent) || '');\n }\n return block;\n }\n\n /**\n * createText(type?, options?): a content area of a text editor's,\n * detached unless a placement is given. The type is the first one\n * offered by default. `options.content` is its html.\n */\n function apiCreateText(type, options) {\n if (type && typeof type === 'object') {\n options = type;\n type = undefined;\n }\n options = options || {};\n type = type || offeredTexts()[0];\n\n if (!type || !TEXTS[type]) {\n if (!warned['createText:' + type]) {\n warned['createText:' + type] = true;\n ge.warn('createText: no text editor \"' + type + '\" is loaded; ' +\n 'load its plugin and name it in content_types');\n }\n return null;\n }\n\n return ge.place(makeText(type, options.content), 'text', options);\n }\n\n /** Whether a content area is a text of one of the editors loaded here. */\n function isOurs(block) {\n return !!TEXTS[block.getAttribute('data-ge-content-type')];\n }\n\n /** Open the editor on a text, once: until it is closed again. */\n function startText(block) {\n if (dom.hasClass(block, 'ge-rte-active')) { return; }\n\n // A content area nobody can see - a tab that is not the open one,\n // a closed accordion item - has no geometry for an editor to lay\n // its toolbar out against, and nothing anyone can type into\n if (!dom.visible(block)) { return; }\n\n // The attribute: it is markup, and the drawer reads it the same way\n var text = TEXTS[block.getAttribute('data-ge-content-type')];\n if (!text) { return; }\n\n // Not marked active, so the next click tries again: the library\n // may be loaded by then\n if (text.available && !text.available()) {\n if (text.missingKey) { console.error(ge.t(text.missingKey)); }\n return;\n }\n\n readBefore.set(block, attributesOf(block));\n readReady.delete(block);\n dom.addClass(block, 'ge-rte-active');\n text.start([block]);\n }\n\n function onClick() {\n startText(this);\n }\n\n /**\n * Close the text editor on one content area, and leave the content\n * area's own attributes as the host left them.\n *\n * An editor adds attributes of its own while it is open, and takes\n * them off again, more or less: CKEditor leaves aria-readonly behind.\n * tinyMCE does worse, and puts back every attribute as it was when it\n * opened, so an id, a class or a plugin's attribute given while it was\n * open is lost. So the attributes are read three times - before the\n * editor opens, once it has opened, and before it closes - and what\n * changed between the second and the third, the host's doing, is\n * played back onto the first, the host's markup. What the editor did\n * is left out either way.\n */\n function closeText(block) {\n var text = TEXTS[block.getAttribute('data-ge-content-type')];\n var before = readBefore.get(block);\n var open = before ? attributesOf(block) : null;\n\n // Every content area is told, as in 5.x: one whose editor never\n // started is the plugin's to ignore\n if (text) { text.stop([block]); }\n\n // After stop, not before: an editor that restores the class\n // attribute it snapshotted would put ge-rte-active back\n dom.removeClass(block, 'ge-rte-active');\n\n if (before) {\n restoreAttributes(block, before, readReady.get(block) || before, open);\n readBefore.delete(block);\n readReady.delete(block);\n }\n }\n\n function createTextControls(textBlock) {\n var block = dom.child(textBlock, '.ge-content');\n var type = block.getAttribute('data-ge-content-type');\n var drawer = dom.element('div', { 'class': 'ge-tools-drawer ge-text-drawer' });\n textBlock.insertBefore(drawer, textBlock.firstChild);\n\n ge.createMoveTool(drawer);\n\n var details = ge.addSettingsTool(drawer, block, settings.text_classes);\n\n // Which editor edits it, first in its settings: something to\n // know about it, not something to do with it\n var general = dom.child(details, '.ge-details-general');\n var editor = dom.element('div', { 'class': 'ge-field ge-text-editor' });\n editor.appendChild(dom.element('span', { 'class': 'ge-field-label' }, ge.t('panel.editor')));\n editor.appendChild(dom.element('span', { 'class': 'ge-field-value' }, textLabel(type)));\n general.insertBefore(editor, general.firstChild);\n\n settings.text_tools.forEach(function(hostTool) {\n ge.createTool(drawer, hostTool.title || '', hostTool.className || '',\n hostTool.iconClass || 'bi bi-wrench', hostTool.on);\n });\n\n ge.createTool(drawer, ge.t('tool.delete_text'), 'ge-delete-text', 'bi bi-trash', function() {\n ge.deleteNode('text', block, ge.t('confirm.delete_text'), function(removed) {\n // Its editor lets go first: removed while open, it would\n // be left behind, attached to nothing\n closeText(block);\n dom.slideUp(textBlock, function() {\n textBlock.remove();\n removed();\n });\n });\n });\n }\n\n /** A drawer for each text of ours in a text block that has none yet. */\n function markTexts() {\n dom.all(ge.canvas, '.ge-text-block').forEach(function(textBlock) {\n if (dom.child(textBlock, '.ge-tools-drawer')) { return; }\n\n var block = dom.child(textBlock, '.ge-content');\n if (!block || !isOurs(block)) { return; }\n\n createTextControls(textBlock);\n });\n }\n\n var texts = offeredTexts();\n var clicks = null; // The delegated click listener, while editing\n\n return {\n methods: {\n createText: apiCreateText,\n },\n\n /**\n * The types this plugin edits, for the core: every editor loaded\n * is the owner of its texts, and the ones offered are what the\n * host's plain content can be made.\n */\n textTypes: function() {\n var offered = offeredTexts();\n var others = Object.keys(TEXTS).filter(function(type) { return offered.indexOf(type) === -1; });\n\n return offered.concat(others).map(function(type) {\n var text = TEXTS[type];\n\n return {\n type: type,\n label: textLabel(type),\n offered: offered.indexOf(type) !== -1,\n available: text.available ? function() { return text.available(); } : null,\n missingKey: text.missingKey,\n edit: function(block) {\n var textBlock = block.parentElement;\n if (dom.hasClass(textBlock, 'ge-text-block') && !dom.child(textBlock, '.ge-tools-drawer')) {\n createTextControls(textBlock);\n }\n\n startText(block);\n },\n };\n });\n },\n\n // A text block of each editor offered. Like a container, it goes\n // into a row of its own when clicked, or where it is dropped\n toolbar: texts.map(function(type) {\n return {\n label: function() {\n return texts.length > 1 ? ge.t('text.add_type', { editor: textLabel(type) }) : ge.t('text.add');\n },\n iconClass: TEXTS[type].iconClass,\n className: 'ge-add-text-button',\n kind: 'text',\n inColumn: true,\n create: function() { return makeText(type); },\n };\n }),\n\n onInit: function() {\n markTexts();\n\n if (clicks) { ge.canvas.removeEventListener('click', clicks); }\n clicks = dom.delegate(ge.canvas, 'click', '.ge-content', onClick);\n },\n\n // While the drawers and the text blocks are still there, as the\n // editors left them\n onBeforeDeinit: function() {\n dom.all(ge.canvas, '.ge-content').forEach(function(block) {\n if (isOurs(block)) { closeText(block); }\n });\n },\n\n onDeinit: function() {\n if (clicks) { ge.canvas.removeEventListener('click', clicks); }\n clicks = null;\n },\n\n // The first time only: an undo says ready again, and by then the\n // host may have changed the content area itself\n onContentReady: function(area) {\n if (readBefore.has(area) && !readReady.has(area)) {\n readReady.set(area, attributesOf(area));\n }\n },\n };\n }\n\n // Whatever the plugins setting says: content_types chooses the editors\n textFeature.always = true;\n\n GridEditor.features.text = textFeature;\n\n}\n", "/**\n * tinyMCE for grid-editor's content areas.\n *\n * A text editor plugin: load this file after the editor, and tinyMCE 7\n * after or before it, and a text of the tinymce type is edited with an\n * inline tinyMCE. What it can ask the editor for is the handle its\n * factory is called with, described in docs/plugins.md.\n *\n * <script src=\"tinymce/tinymce.min.js\"></script>\n * <script src=\"dist/grideditor.min.js\"></script>\n * <script src=\"dist/plugins/grideditor.tinymce.min.js\"></script>\n *\n * Up to 5.x the main bundle carried a copy of this file; since 6.0 it is\n * loaded on its own, like every plugin. It imports what every text editor\n * shares - text blocks, the Text button, createText, making the host's plain\n * content a text - from src/js/text/grideditor.text.js, which the build puts\n * in its classic script, installed once however many editors a page loads.\n */\nimport { GridEditor } from '../grideditor.js';\nimport * as dom from '../dom.js';\nimport '../text/grideditor.text.js';\n\nObject.assign(GridEditor.locales.en, {\n 'text.tinymce': 'tinyMCE',\n 'warning.oninit_removed': 'tinyMCE\\'s oninit option was removed in 7.0 and is ignored: use init_instance_callback.',\n});\n\n// tinyMCE snapshots the target element's attributes when an inline editor is\n// created and restores them on remove(), so this has to run *after* remove()\n// to keep the grid editor's own class and tinyMCE's leftovers off the element.\nfunction cleanUp(contentArea) {\n dom.removeClass(contentArea, 'active ge-rte-active');\n ['id', 'style', 'spellcheck', 'contenteditable', 'data-mce-style'].forEach(function(name) {\n contentArea.removeAttribute(name);\n });\n}\n\nvar INITIAL_CONTENT = '<p>Lorem ipsum dolores</p>';\n\n// What this file remembers about a content area: its editor, and whether a\n// deinit came before that editor was ready\nvar editors = new WeakMap();\nvar pendingRemove = new WeakSet();\n\n// Said once per page, however many editors are on it\nvar warnedOninit = false;\n\nGridEditor.texts.tinymce = function(ge) {\n return {\n labelKey: 'text.tinymce',\n initialContent: INITIAL_CONTENT,\n missingKey: 'error.tinymce_missing',\n\n available: function() { return !!window.tinymce; },\n\n start: function(contentAreas) {\n var settings = ge.settings;\n var userConfig = (settings.tinymce && settings.tinymce.config) ? settings.tinymce.config : {};\n\n // 'oninit' was the pre-6 name for init_instance_callback, honoured\n // through 6.x and gone in 7.0\n if (userConfig.oninit && !warnedOninit) {\n warnedOninit = true;\n ge.warn(ge.t('warning.oninit_removed'));\n }\n\n contentAreas.forEach(function(contentArea) {\n if (dom.hasClass(contentArea, 'active')) { return; }\n\n if (contentArea.innerHTML == INITIAL_CONTENT) {\n contentArea.innerHTML = '';\n }\n dom.addClass(contentArea, 'active');\n\n var configuration = Object.assign({\n // tinyMCE's own \"Upgrade\" badge in the menubar. Off by\n // default because an inline editor here is a column of\n // someone's page, not tinyMCE's own interface; a host that\n // wants it back passes promotion: true.\n promotion: false,\n }, userConfig, {\n target: contentArea,\n inline: true,\n init_instance_callback: function(editor) {\n // deinit ran before this init finished, so tear it down again\n if (pendingRemove.has(contentArea)) {\n pendingRemove.delete(contentArea);\n editor.remove();\n // deinit already ran and cannot clean up after this\n // late remove(), so do it here instead\n cleanUp(contentArea);\n return;\n }\n\n editors.set(contentArea, editor);\n\n // The editor rewrote what is inside this content area\n // while it took it over, so whatever the grid editor\n // had in there is gone. Saying so lets it put its own\n // furniture back.\n ge.textReady(contentArea);\n\n // Undo and redo rewrite it too, from snapshots that\n // leave out whatever is marked data-mce-bogus - an\n // element's drawer among them - so it goes back in\n // after each of those as well\n editor.on('Undo Redo', function() {\n ge.textReady(contentArea);\n });\n\n // The inline toolbar is laid out against the element's\n // geometry at the moment tinyMCE draws it, and an\n // element that has just appeared - a tab pane, an\n // accordion body, a column whose width is still\n // settling - may not have its own width yet. Asking\n // for the ui again once the browser has laid the frame\n // out measures it as it now is, instead of leaving a\n // toolbar wrapped into a narrow column.\n window.requestAnimationFrame(function() {\n if (editor.removed || !editor.ui || !editor.ui.show) { return; }\n\n editor.ui.show();\n });\n\n // And again whenever the user comes back to this\n // editor: by then the element may have been resized,\n // hidden and shown again - a tab switched away from\n // and back, a column made narrower - and the toolbar\n // is only ever as right as its last measurement.\n editor.on('focus', function() {\n window.requestAnimationFrame(function() {\n if (editor.removed || !editor.ui || !editor.ui.show) { return; }\n\n editor.ui.show();\n });\n });\n\n // Bring focus to text field\n editor.focus();\n\n // Call the original callback, if one was passed in the config\n if (userConfig.init_instance_callback) {\n userConfig.init_instance_callback.call(this, editor);\n }\n }\n });\n // We always edit the element we were handed, so a selector in the\n // user config would only fight with target\n delete configuration.selector;\n delete configuration.oninit;\n\n window.tinymce.init(configuration);\n });\n },\n\n stop: function(contentAreas) {\n contentAreas.filter(function(contentArea) {\n return dom.hasClass(contentArea, 'active');\n }).forEach(function(contentArea) {\n var editor = editors.get(contentArea);\n\n if (editor) {\n editors.delete(contentArea);\n editor.remove();\n } else {\n // tinymce.init() is asynchronous, so the editor may not exist\n // yet. Leave a note for init_instance_callback to remove it.\n pendingRemove.add(contentArea);\n }\n\n cleanUp(contentArea);\n });\n },\n };\n};\n"],
5
5
  "mappings": "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",
6
6
  "names": ["GridEditor", "all", "root", "selector", "children", "node", "selector", "each", "child", "closest", "stopAt", "found", "element", "tag", "attributes", "text", "node", "name", "value", "setHtml", "html", "addClass", "names", "split", "removeClass", "hasClass", "node", "name", "split", "names", "hide", "node", "visible", "node", "delegate", "root", "types", "selector", "handler", "options", "listener", "event", "match", "closest", "split", "type", "DEFAULT_DURATION", "animateAway", "node", "frames", "duration", "done", "finish", "hide", "visible", "animation", "called", "once", "slideUp", "style", "GridEditor", "attributesOf", "element", "found", "attribute", "classesIn", "value", "name", "EDITOR_CLASS", "restoreAttributes", "block", "before", "ready", "open", "result", "EDITOR_ATTRIBUTE", "readyClasses", "openClasses", "classes", "textFeature", "ge", "settings", "TEXTS", "warned", "type", "offeredTexts", "textLabel", "text", "makeText", "content", "setHtml", "apiCreateText", "options", "isOurs", "startText", "hasClass", "visible", "readBefore", "readReady", "addClass", "onClick", "closeText", "removeClass", "createTextControls", "textBlock", "child", "drawer", "details", "general", "editor", "hostTool", "removed", "slideUp", "markTexts", "all", "texts", "clicks", "offered", "others", "delegate", "area", "GridEditor", "cleanUp", "contentArea", "removeClass", "name", "INITIAL_CONTENT", "editors", "pendingRemove", "warnedOninit", "ge", "contentAreas", "settings", "userConfig", "hasClass", "addClass", "configuration", "editor"]
7
7
  }