2&&void 0!==arguments[2]?arguments[2]:{};(0,o.bindAll)(this,'setPosition','onStart','onDrag','onEnd','getPosition','getGuidesStatic','renderGuide','getGuidesTarget');var a=r.target,c=r.event,u=r.mode,p=r.dragger,f=void 0===p?{}:p,d=a.getEl(),h=s({doc:d.ownerDocument,onStart:this.onStart,onEnd:this.onEnd,onDrag:this.onDrag,getPosition:this.getPosition,setPosition:this.setPosition,guidesStatic:function(){return n.guidesStatic},guidesTarget:function(){return n.guidesTarget}},f);this.setupGuides(),this.opts=r,this.editor=t,this.em=t.getModel(),this.target=a,this.isTran='translate'==u,this.guidesContainer=this.getGuidesContainer(),this.guidesTarget=this.getGuidesTarget(),this.guidesStatic=this.getGuidesStatic();var g=this.dragger;return g?g.setOptions(h):(g=new i.Z(h),this.dragger=g),c&&g.start(c),this.toggleDrag(1),this.em.trigger("".concat(l,":start"),this.getEventOpts()),g},getEventOpts:function(){return{mode:this.opts.mode,target:this.target,guidesTarget:this.guidesTarget,guidesStatic:this.guidesStatic}},stop:function(){this.toggleDrag()},setupGuides:function(){(this.guides||[]).forEach((function(t){var e=t.guide;e&&e.parentNode.removeChild(e)})),this.guides=[]},getGuidesContainer:function(){var t=this,e=this.guidesEl;if(!e){var n=this.editor,r=this.em,i=this.opts,a=n.getConfig().stylePrefix,s=document.createElement('div'),l=document.createElement('div'),c="");(e=document.createElement('div')).className="".concat(a,"guides"),s.className="".concat(a,"guide-info ").concat(a,"guide-info__x"),l.className="".concat(a,"guide-info ").concat(a,"guide-info__y"),s.innerHTML=c,l.innerHTML=c,e.appendChild(s),e.appendChild(l),n.Canvas.getGlobalToolsEl().appendChild(e),this.guidesEl=e,this.elGuideInfoX=s,this.elGuideInfoY=l,this.elGuideInfoContentX=s.querySelector(".".concat(a,"guide-info__content")),this.elGuideInfoContentY=l.querySelector(".".concat(a,"guide-info__content")),r.on('canvas:update frame:scroll',(0,o.debounce)((function(){t.updateGuides(),i.debug&&t.guides.forEach((function(e){return t.renderGuide(e)}))}),200))}return e},getGuidesStatic:function(){var t=this,e=[],n=this.target.getEl(),r=n.parentNode,i=void 0===r?{}:r;return(0,o.each)(i.children,(function(r){return e=e.concat(n!==r?t.getElementGuides(r):[])})),e.concat(this.getElementGuides(i))},getGuidesTarget:function(){return this.getElementGuides(this.target.getEl())},updateGuides:function(t){var e,n,r=this;(t||this.guides).forEach((function(t){var i=t.origin,a=e===i?n:r.getElementPos(i);e=i,n=a,(0,o.each)(r.getGuidePosUpdate(t,a),(function(e,n){return t[n]=e})),t.originRect=a}))},getGuidePosUpdate:function(t,e){var n={},r=e.top,o=e.height,i=e.left,a=e.width;switch(t.type){case't':n.y=r;break;case'b':n.y=r+o;break;case'l':n.x=i;break;case'r':n.x=i+a;break;case'x':n.x=i+a/2;break;case'y':n.y=r+o/2}return n},renderGuide:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.guide||document.createElement('div'),n='px',r=t.active?2:1,o=e.children[0];return e.style="position: absolute; background-color: ".concat(t.active?'green':'red',";"),e.children.length||((o=document.createElement('div')).style='position: absolute; color: red; padding: 5px; top: 0; left: 0;',e.appendChild(o)),t.y?(e.style.width='100%',e.style.height="".concat(r).concat(n),e.style.top="".concat(t.y).concat(n),e.style.left=0):(e.style.width="".concat(r).concat(n),e.style.height='100%',e.style.left="".concat(t.x).concat(n),e.style.top="0".concat(n)),!t.guide&&this.guidesContainer.appendChild(e),e},getElementPos:function(t){return this.editor.Canvas.getElementPos(t,{noScroll:1})},getElementGuides:function(t){var e=this,n=this.opts,r=this.getElementPos(t),o=r.top,i=r.height,a=r.left,l=r.width,c=[{type:'t',y:o},{type:'b',y:o+i},{type:'l',x:a},{type:'r',x:a+l},{type:'x',x:a+l/2},{type:'y',y:o+i/2}].map((function(o){return s(s({},o),{},{origin:t,originRect:r,guide:n.debug&&e.renderGuide(o)})}));return c.forEach((function(t){return e.guides.push(t)})),c},getTranslate:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:'x',n=0;return(t||'').split(' ').forEach((function(t){var r=t.trim(),o="translate".concat(e.toUpperCase(),"(");0===r.indexOf(o)&&(n=parseFloat(r.replace(o,'')))})),n},setTranslate:function(t,e,n){var r="translate".concat(e.toUpperCase(),"("),o="".concat(r).concat(n,")"),i=(t||'').split(' ').map((function(t){return 0===t.trim().indexOf(r)&&(t=o),t})).join(' ');return i.indexOf(r)<0&&(i+=" ".concat(o)),i},getPosition:function(){var t=this.target,e=this.isTran,n=t.getStyle(),r=n.left,o=n.top,i=n.transform,a=0,s=0;return e?(a=this.getTranslate(i),s=this.getTranslate(i,'y')):(a=parseFloat(r||0),s=parseFloat(o||0)),{x:a,y:s}},setPosition:function(t){var e=t.x,n=t.y,r=t.end,i=t.position,a=t.width,s=t.height,l=this.target,c=this.isTran,u=this.em,p='px',f=r?'':1,d="".concat(e).concat(p),h="".concat(n).concat(p),g={};if(c){var v=l.getStyle()['transform']||'';v=this.setTranslate(v,'x',d),g={transform:v=this.setTranslate(v,'y',h),en:f},l.addStyle(g,{avoidStore:!r})}else{var m={position:i,width:a,height:s},y={left:d,top:h,en:f};(0,o.keys)(m).forEach((function(t){var e=m[t];e&&(y[t]=e)})),g=y,l.addStyle(g,{avoidStore:!r})}u.getSelected()&&(0,o.keys)(g).forEach((function(t){return u.trigger("update:component:style:".concat(t))}))},_getDragData:function(){var t=this.target;return{target:t,parent:t.parent(),index:t.index()}},onStart:function(t){var e=this.target,n=this.editor,r=this.isTran,o=this.opts,i=o.center,a=o.onStart,s=n.Canvas,l=e.getStyle(),c='absolute',u=[c,'relative'];if(a&&a(this._getDragData()),!r&&l.position!==c){var p,f=s.offset(e.getEl()),d=f.left,h=f.top,g=f.width,v=f.height,m=e.parent();do{var y=m.getStyle();p=u.indexOf(y.position)>=0?m:null,m=m.parent()}while(m&&!p);if(i){var b=s.getMouseRelativeCanvas(t);d=b.x,h=b.y}else if(p){var w=s.offset(p.getEl());d-=w.left,h-=w.top}this.setPosition({x:d,y:h,width:"".concat(g,"px"),height:"".concat(v,"px"),position:c})}},onDrag:function(){var t=this,e=this.guidesTarget,n=this.opts,r=n.onDrag;this.updateGuides(e),n.debug&&e.forEach((function(e){return t.renderGuide(e)})),n.guidesInfo&&this.renderGuideInfo(e.filter((function(t){return t.active}))),r&&r(this._getDragData())},onEnd:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.editor,o=this.opts,i=this.id,a=o.onEnd;a&&a(t,n,s(s({event:t},n),this._getDragData())),r.stopCommand(i),this.hideGuidesInfo(),this.em.trigger("".concat(l,":end"),this.getEventOpts())},hideGuidesInfo:function(){var t=this;['X','Y'].forEach((function(e){var n=t["elGuideInfo".concat(e)];n&&(n.style.display='none')}))},renderGuideInfo:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=this.guidesStatic;this.hideGuidesInfo(),e.forEach((function(e){var r=e.origin,i=e.x,a=t.getElementPos(r),c=(0,o.isUndefined)(i)?'y':'x',u='y'===c,p=a[u?'left':'top'],f=a.rect[u?'left':'top'],d=u?p+a.width:p+a.height,h=u?f+a.rect.width:f+a.rect.height,g=t["elGuideInfo".concat(c.toUpperCase())],v=t["elGuideInfoContent".concat(c.toUpperCase())],m=g.style,y=n.filter((function(t){return t.type===e.type})).map((function(t){var e=t.originRect,n=e.left,r=e.width,o=e.top,i=e.height,a=u?n+r:o+i;return{gap:a0})).sort((function(t,e){return t.gap-e.gap})).map((function(t){return t.guide}))[0];if(y){var b=y.originRect,w=b.left,_=b.width,x=b.top,O=b.height,C=b.rect,k=u?w{"use strict";n.r(e),n.d(e,{default:()=>r});const r={run:function(t){if(t.Canvas.hasFocus()){var e=[];t.getSelectedAll().forEach((function(t){var n=t.components(),r=n&&n.filter((function(t){return t.get('selectable')}))[0];r&&e.push(r)})),e.length&&t.select(e)}}}},3888:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r={run:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(t.Canvas.hasFocus()||n.force){var r=[];t.getSelectedAll().forEach((function(t){for(var e=t.parent();e&&!e.get('selectable');)e=e.parent();e&&r.push(e)})),r.length&&t.select(r)}}}},5883:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r={run:function(t){if(t.Canvas.hasFocus()){var e=[];t.getSelectedAll().forEach((function(t){var n=t.parent();if(n){var r,o=n.components().length,i=0,a=0;do{i++,r=(a=t.index()+i)<=o?n.getChildAt(a):null}while(r&&!r.get('selectable'));e.push(r||t)}})),e.length&&t.select(e)}}}},7508:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r={run:function(t){if(t.Canvas.hasFocus()){var e=[];t.getSelectedAll().forEach((function(t){var n=t.parent();if(n){var r,o=0,i=0;do{o++,r=(i=t.index()-o)>=0?n.getChildAt(i):null}while(r&&!r.get('selectable'));e.push(r||t)}})),e.length&&t.select(e)}}}},8769:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>o});var r=n(9050);const o={run:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.target,i=[];if(!o.get('styles'))return i;var a=o.get('type'),s=t.Pages.getAllWrappers(),l=(0,r.flatten)(s.map((function(t){return t.findType(a)}))).length;if(!l){var c=t.CssComposer.getAll();i=c.filter((function(t){return t.get('group')==="cmp:".concat(a)})),c.remove(i)}return i}}},2213:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>o});var r=n(2982);const o={run:function(t){var e=t.getModel(),n=(0,r.Z)(t.getSelectedAll());n.length&&e.set('clipboard',n)}}},5049:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>l});var r=n(9050),o=n(2316),i=n.n(o),a=n(5130),s=i().$;const l=(0,r.extend)({},a["default"],{init:function(t){(0,r.bindAll)(this,'startDelete','stopDelete','onDelete'),this.hoverClass=this.pfx+'hover-delete',this.badgeClass=this.pfx+'badge-red'},enable:function(){this.$el.find('*').mouseover(this.startDelete).mouseout(this.stopDelete).click(this.onDelete)},startDelete:function(t){t.stopPropagation();var e=s(t.target);e.data('model').get('removable')&&(e.addClass(this.hoverClass),this.attachBadge(e.get(0)))},stopDelete:function(t){t.stopPropagation(),s(t.target).removeClass(this.hoverClass),this.badge&&this.badge.css({left:-1e3,top:-1e3})},onDelete:function(t){t.stopPropagation();var e=s(t.target);e.data('model').get('removable')&&(e.data('model').destroy(),this.removeBadge(),this.clean())},updateBadgeLabel:function(t){this.badge.html('Remove '+t.getName())}})},3775:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>i});var r=n(2316),o=n.n(r)().$;const i={run:function(t,e){var n=this;e&&e.set&&e.set('active',0);var r=t.getConfig(),i=t.Modal,a=r.stylePrefix;if(this.cm=t.CodeManager||null,!this.$editors){var s=this.buildEditor('htmlmixed','hopscotch','HTML'),l=this.buildEditor('css','hopscotch','CSS');this.htmlEditor=s.el,this.cssEditor=l.el;var c=o("
"));c.append(s.$el).append(l.$el),this.$editors=c}i.open({title:r.textViewCode,content:this.$editors}).getModel().once('change:open',(function(){return t.stopCommand(n.id)})),this.htmlEditor.setContent(t.getHtml()),this.cssEditor.setContent(t.getCss())},stop:function(t){var e=t.Modal;e&&e.close()},buildEditor:function(t,e,n){var r=document.createElement('textarea');!this.codeMirror&&(this.codeMirror=this.cm.getViewer('CodeMirror'));var o=this.codeMirror.clone().set({label:n,codeName:t,theme:e,input:r}),i=new this.cm.EditorView({model:o,config:this.cm.getConfig()}).render().$el;return o.init(r),{el:o,$el:i}}}},58:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>o});var r=n(9050);const o={isEnabled:function(){var t=document;return!!(t.fullscreenElement||t.webkitFullscreenElement||t.mozFullScreenElement)},enable:function(t){var e='';return t.requestFullscreen?t.requestFullscreen():t.webkitRequestFullscreen?(e='webkit',t.webkitRequestFullscreen()):t.mozRequestFullScreen?(e='moz',t.mozRequestFullScreen()):t.msRequestFullscreen&&t.msRequestFullscreen(),e},disable:function(){var t=document;this.isEnabled()&&(t.exitFullscreen?t.exitFullscreen():t.webkitExitFullscreen?t.webkitExitFullscreen():t.mozCancelFullScreen?t.mozCancelFullScreen():t.msExitFullscreen&&t.msExitFullscreen())},fsChanged:function(t){this.isEnabled()||(this.stopCommand({sender:this.sender}),document.removeEventListener("".concat(t||'',"fullscreenchange"),this.fsChanged))},run:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.sender=e;var o=n.target,i=(0,r.isElement)(o)?o:document.querySelector(o),a=this.enable(i||t.getContainer());this.fsChanged=this.fsChanged.bind(this,a),document.addEventListener(a+'fullscreenchange',this.fsChanged),t.trigger('change:canvasOffset')},stop:function(t,e){e&&e.set&&e.set('active',!1),this.disable(),t&&t.trigger('change:canvasOffset')}}},8658:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>u});var r=n(9050),o=n(2316),i=n.n(o),a=n(1163),s=n(5130),l=n(8463),c=i().$;const u=(0,r.extend)({},l["default"],s["default"],{init:function(t){s["default"].init.apply(this,arguments),(0,r.bindAll)(this,'initSorter','rollback','onEndMove'),this.opt=t,this.hoverClass=this.ppfx+'highlighter-warning',this.badgeClass=this.ppfx+'badge-warning',this.noSelClass=this.ppfx+'no-select'},enable:function(){for(var t=arguments.length,e=new Array(t),n=0;n{"use strict";n.r(e),n.d(e,{default:()=>i});var r=n(9050),o=n(8491);const i={open:function(t){var e=this,n=this.editor,o=this.title,i=this.config,a=this.am,s=i.custom;if((0,r.isFunction)(s.open))return s.open(a.__customData());n.Modal.open({title:o,content:t}).onceClose((function(){return n.stopCommand(e.id)}))},close:function(){var t=this.config.custom;if((0,r.isFunction)(t.close))return t.close(this.am.__customData());var e=this.editor.Modal;e&&e.close()},run:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t.AssetManager,i=r.getConfig(),a=n.types,s=void 0===a?[]:a,l=n.accept,c=n.select;if(this.title=n.modalTitle||t.t('assetManager.modalTitle')||'',this.editor=t,this.config=i,this.am=r,r.setTarget(n.target),r.onClick(n.onClick),r.onDblClick(n.onDblClick),r.onSelect(n.onSelect),r.__behaviour({select:c,types:s,options:n}),i.custom)this.rendered=this.rendered||(0,o.ut)('div'),this.rendered.className="".concat(i.stylePrefix,"custom-wrp"),r.__behaviour({container:this.rendered}),r.__trgCustom();else{if(!this.rendered||s){var u=r.getAll().filter((function(t){return t}));s&&s.length&&(u=u.filter((function(t){return-1!==s.indexOf(t.get('type'))}))),r.render(u),this.rendered=r.getContainer()}if(l){var p=this.rendered.querySelector("input#".concat(i.stylePrefix,"uploadFile"));p&&p.setAttribute('accept',l)}}return this.open(this.rendered),this},stop:function(t){this.editor=t,this.close(this.rendered)}}},5821:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>i});var r=n(9050),o=n(8491);const i={open:function(){var t=this.container,e=this.editor,n=this.bm,o=this.config,i=o.custom,a=o.appendTo;if((0,r.isFunction)(i.open))return i.open(n.__customData());if(this.firstRender&&!a){var s='views-container',l=e.Panels;(l.getPanel(s)||l.addPanel({id:s})).set('appendContent',t).trigger('change:appendContent'),i||t.appendChild(n.render())}t&&(t.style.display='block')},close:function(){var t=this.container,e=this.config.custom;if((0,r.isFunction)(e.close))return e.close(this.bm.__customData());t&&(t.style.display='none')},run:function(t){var e=t.Blocks;this.config=e.getConfig(),this.firstRender=!this.container,this.container=this.container||(0,o.ut)('div'),this.editor=t,this.bm=e;var n=this.container;e.__behaviour({container:n}),this.config.custom&&e.__trgCustom(),this.open()},stop:function(){this.close()}}},3452:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});const r={run:function(t){var e=t.LayerManager,n=t.Panels,r=e.getConfig();if(!r.appendTo){if(!this.layers){var o='views-container',i=document.createElement('div'),a=n.getPanel(o)||n.addPanel({id:o});r.custom?e.__trgCustom({container:i}):i.appendChild(e.render()),a.set('appendContent',i).trigger('change:appendContent'),this.layers=i}this.layers.style.display='block'}},stop:function(){var t=this.layers;t&&(t.style.display='none')}}},2840:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>i});var r=n(2316),o=n.n(r)().$;const i={run:function(t,e){if(this.sender=e,!this.$cn){var n=t.getConfig(),r=t.Panels,i='change:appendContent';this.$cn=o('
'),this.$cn2=o('
'),this.$cn.append(this.$cn2);var a=t.DeviceManager;if(a&&n.showDevices){var s=r.addPanel({id:'devices-c'}),l=a.render();s.set('appendContent',l).trigger(i)}var c=t.SelectorManager;this.slm=c;var u=c.getConfig();u.custom?c.__trgCustom({container:this.$cn2.get(0)}):u.appendTo||this.$cn2.append(c.render([]));var p=t.StyleManager;this.sm=p;var f=p.getConfig(),d=f.stylePrefix;this.$header=o("")),this.$cn.append(this.$header),f.custom?p.__trgCustom({container:this.$cn2.get(0)}):f.appendTo||this.$cn2.append(p.render());var h='views-container';this.panel=r.getPanel(h),this.panel||(this.panel=r.addPanel({id:h})),this.panel.set('appendContent',this.$cn).trigger(i),this.em=t.getModel(),this.listenTo(this.em,p.events.target,this.toggleSm)}this.toggleSm()},toggleSm:function(){var t,e,n,r,o=this.sender,i=this.sm;o&&o.get&&!o.get('active')||!i||(i.getSelected()?(null===(t=this.$cn2)||void 0===t||t.show(),null===(e=this.$header)||void 0===e||e.hide()):(null===(n=this.$cn2)||void 0===n||n.hide(),null===(r=this.$header)||void 0===r||r.show()))},stop:function(){var t,e;null===(t=this.$cn2)||void 0===t||t.hide(),null===(e=this.$header)||void 0===e||e.hide()}}},8644:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>i});var r=n(2316),o=n.n(r)().$;const i={run:function(t,e){this.sender=e;var n=t.getModel(),r=t.Config.stylePrefix,i=t.TraitManager,a=i.getConfig();if(!a.appendTo){if(!this.$cn){this.$cn=o('
'),this.$cn2=o('
'),this.$cn.append(this.$cn2),this.$header=o('').append("")),this.$cn.append(this.$header),this.$cn2.append("
").concat(n.t('traitManager.label'),"
")),this.$cn2.append(i.render());var s=t.Panels;(s.getPanel('views-container')?s.getPanel('views-container'):s.addPanel({id:'views-container'})).set('appendContent',this.$cn.get(0)).trigger('change:appendContent'),this.target=t.getModel(),this.listenTo(this.target,'component:toggled',this.toggleTm)}this.toggleTm()}},toggleTm:function(){var t=this.sender;t&&t.get&&!t.get('active')||(1===this.target.getSelectedAll().length?(this.$cn2.show(),this.$header.hide()):(this.$cn2.hide(),this.$header.show()))},stop:function(){this.$cn2&&this.$cn2.hide(),this.$header&&this.$header.hide()}}},560:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>o});var r=n(9050);const o={run:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=t.getModel(),i=o.get('clipboard'),a=t.getSelected();i&&a&&(t.getSelectedAll().forEach((function(e){var o=e.collection;if(o){var a,s={at:e.index()+1,action:n.action||'paste-component'};if((0,r.contains)(i,e)&&e.get('copyable'))a=o.add(e.clone(),s);else{var l=i.filter((function(t){return t.get('copyable')})).filter((function(n){return t.Components.canMove(e.parent(),n).result}));a=o.add(l.map((function(t){return t.clone()})),s)}(a=(0,r.isArray)(a)?a:[a]).forEach((function(e){return t.trigger('component:paste',e)}))}})),a.emitUpdate())}}},4944:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>a});var r=n(2982),o=n(9050),i='core:component-outline';const a={getPanels:function(t){return this.panels||(this.panels=t.Panels.getPanels()),this.panels},preventDrag:function(t){t.abort=1},tglEffects:function(t){var e=this.em,n=t?'on':'off';if(e){var r=e.get('Canvas'),i=r.getBody(),a=r.getToolbarEl();a&&(a.style.display=t?'none':'');var s=i.querySelectorAll(".".concat(this.ppfx,"no-pointer"));(0,o.each)(s,(function(e){return e.style.pointerEvents=t?'all':''})),e[n]('run:tlb-move:before',this.preventDrag)}},run:function(t,e){var n=this;this.sender=e,this.selected=(0,r.Z)(t.getSelectedAll()),t.select(),this.shouldRunSwVisibility||(this.shouldRunSwVisibility=t.Commands.isActive(i)),this.shouldRunSwVisibility&&t.stopCommand(i),t.getModel().stopDefault();var o=this.getPanels(t),a=t.Canvas.getElement(),s=t.getEl(),l=t.Config.stylePrefix;if(!this.helper){var c=document.createElement('span');c.className="".concat(l,"off-prv fa fa-eye-slash"),s.appendChild(c),c.onclick=function(){return n.stopCommand()},this.helper=c}this.helper.style.display='inline-block',o.forEach((function(t){return t.set('visible',!1)}));var u=a.style;u.width='100%',u.height='100%',u.top='0',u.left='0',u.padding='0',u.margin='0',t.refresh(),this.tglEffects(1)},stop:function(t){var e=this.sender,n=void 0===e?{}:e,r=this.selected;n.set&&n.set('active',0);var o=this.getPanels(t);this.shouldRunSwVisibility&&(t.runCommand(i),this.shouldRunSwVisibility=!1),t.getModel().runDefault(),o.forEach((function(t){return t.set('visible',!0)})),t.Canvas.getElement().setAttribute('style',''),r&&t.select(r),delete this.selected,this.helper&&(this.helper.style.display='none'),t.refresh(),this.tglEffects()}}},7538:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>i});var r=n(4942);function o(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}const i={run:function(t,e,n){var i=n||{},a=t.Canvas,s=a.getCanvasView(),l=function(t){for(var e=1;e
{"use strict";n.r(e),n.d(e,{default:()=>P});var r,o=n(1002),i=n(4942),a=n(2316),s=n.n(a),l=n(9050),c=n(1163),u=n(8491),p=n(6602),f=void 0&&(void 0).__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),d=void 0&&(void 0).__assign||function(){return d=Object.assign||function(t){for(var e,n=1,r=arguments.length;n2&&void 0!==arguments[2]?arguments[2]:{},r=n.el||this.canvas.getToolsEl(e);return r&&(r.style.display=t?'':'none'),r||{}},showElementOffset:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};k&&this.editor.runCommand('show-offset',{el:t,elPos:e,view:n.view,force:1,top:0,left:0})},hideElementOffset:function(t){this.editor.stopCommand('show-offset',{view:t})},showFixedElementOffset:function(t,e){this.editor.runCommand('show-offset',{el:t,elPos:e,state:'Fixed'})},hideFixedElementOffset:function(t,e){this.editor&&this.editor.stopCommand('show-offset',{state:'Fixed'})},hideHighlighter:function(t){this.canvas.getHighlighter(t).style.opacity=0},onClick:function(t){t.stopPropagation(),t.preventDefault();var e=this.em;if(e.get('_cmpDrag'))return e.set('_cmpDrag');var n=S(t.target),r=n.data('model');if(!r)for(var o=n.parent();!r&&o.length&&!(0,u.Mx)(o[0]);)r=o.data('model'),o=o.parent();if(r){if(e.isEditing()&&!r.get('textable')&&r.isChildOf('text'))return;this.select(r,t)}},select:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t&&(this.editor.select(t,{event:e,useValid:!0}),this.initResize(t))},updateBadge:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.canvas,o=S(t).data('model');if(o&&o.get('badgable')){var i=this.getBadge(n);if(!n.posOnly){var a=this.canvas.getConfig(),s=o.getIcon(),l=a.pStylePrefix||'',c="".concat(l,"badge"),u=a.customBadgeLabel,p="".concat(s?"").concat(s,"
"):'',"\n ").concat(o.getName(),"
");i.innerHTML=u?u(o):p}var f='px',d=i.style;d.display='block';var h=r.getTargetToElementFixed(t,i,{pos:e}),g=h.top,v=n.leftOff<0?-n.leftOff:0;d.top=g+f,d.left=v+f}},showHighlighter:function(t){this.canvas.getHighlighter(t).style.opacity=''},initResize:function(t){var e,n=this.em,r=this.canvas,i=n?n.get('Editor'):'',a=(n?n.get('Config'):'').stylePrefix||'',s="".concat(a,"resizing"),u=!(0,l.isElement)(t)&&(0,c.isTaggableNode)(t)?t:n.getSelected(),p=u&&u.get('resizable'),f={},d=function(t,e,n){var r=n.docs;r&&r.forEach((function(e){var n=e.body,r=n.className||'';n.className=('add'==t?"".concat(r," ").concat(s):r.replace(s,'')).trim()}))};if(i&&p){var h=(0,l.isElement)(t)?t:u.getEl();f={onStart:function(t){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=o.el,a=o.config,s=o.resizer,l=a.keyHeight,p=a.keyWidth,f=a.currentUnit,h=a.keepAutoHeight,g=a.keepAutoWidth;d('add',0,o),e=n.get('StyleManager').getModelToStyle(u),r.toggleFramesEvents();var v=getComputedStyle(i),m=e.getStyle(),y=m[p];a.autoWidth=g&&'auto'===y,isNaN(parseFloat(y))&&(y=v[p]);var b=m[l];a.autoHeight=h&&'auto'===b,isNaN(parseFloat(b))&&(b=v[l]),s.startDim.w=parseFloat(y),s.startDim.h=parseFloat(b),k=0,f&&(a.unitHeight=(0,c.getUnitFromValue)(b),a.unitWidth=(0,c.getUnitFromValue)(y))},onMove:function(){i.trigger('component:resize')},onEnd:function(t,e){d('remove',0,e),i.trigger('component:resize'),r.toggleFramesEvents(1),k=1},updateTarget:function(t,o){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e){var a=i.store,s=i.selectedHandler,l=i.config,c=l.keyHeight,u=l.keyWidth,p=l.autoHeight,f=l.autoWidth,d=l.unitWidth,h=l.unitHeight,g=['tc','bc'].indexOf(s)>=0,v=['cl','cr'].indexOf(s)>=0,m={},y=a?'':1;if(!g){var b=r.getBody().offsetWidth,w=o.w0&&void 0!==arguments[0]?arguments[0]:{};return this.canvas.getBadgeEl(t.view)},onFrameScroll:function(){this.updateTools()},updateTools:function(){this.updateLocalPos(),this.updateGlobalPos()},isCompSelected:function(t){return t&&'selected'===t.get('status')},updateToolsLocal:function(t){var e=t||this.getElHovered(),n=e.el,r=e.pos,o=e.view,i=e.component;if(n){var a=i.get('hoverable'),s=this.lastHovered!==n,l=s?{}:{posOnly:1};s&&a&&(this.lastHovered=n,this.showHighlighter(o),this.showElementOffset(n,r,{view:o})),this.isCompSelected(i)&&(this.hideHighlighter(o),this.hideElementOffset(o));var c='px',u=this.toggleToolsEl(1,o),p=u.style,f=this.canvas.canvasRectOffset(n,r),d=f.top,h=f.left;this.updateBadge(n,r,C(C({},l),{},{view:o,topOff:d,leftOff:h})),p.top=d+c,p.left=h+c,p.width=r.width+c,p.height=r.height+c,this._trgToolUp('local',{component:i,el:u,top:d,left:h,width:r.width,height:r.height})}else this.lastHovered=0},_upToolbar:(0,l.debounce)((function(){this.updateToolsGlobal({force:1})})),_trgToolUp:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.em.trigger('canvas:tools:update',C({type:t},e))},updateToolsGlobal:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.getElSelected(),n=e.el,r=e.pos,o=e.component;if(!n)return this.toggleToolsEl(),void(this.lastSelected=0);var i=this.canvas,a=this.lastSelected!==n;(a||t.force)&&(this.lastSelected=n,this.updateToolbar(o));var s='px',l=this.toggleToolsEl(1),c=l.style,u=i.getTargetToElementFixed(n,i.getToolbarEl(),{pos:r}),p=u.canvasOffsetTop,f=u.canvasOffsetLeft;c.top=p+s,c.left=f+s,c.width=r.width+s,c.height=r.height+s,this.updateToolbarPos({top:u.top,left:u.left}),this._trgToolUp('global',{component:o,el:l,top:p,left:f,width:r.width,height:r.height})},updateAttached:(0,l.debounce)((function(){this.updateGlobalPos()})),onContainerChange:(0,l.debounce)((function(){this.em.refreshCanvas()}),150),getElementPos:function(t){return this.canvas.getCanvasView().getElementPos(t)},hideBadge:function(){this.getBadge().style.display='none'},cleanPrevious:function(t){t&&t.set({status:'',state:''})},getContentWindow:function(){return this.canvas.getWindow()},run:function(t){(0,c.hasWin)()&&(this.editor=t&&t.get('Editor'),this.enable())},stop:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if((0,c.hasWin)()){var r=this.em,o=this.editor;this.onHovered(),this.stopSelectComponent(),!n.preserveSelected&&r.setSelected(null),this.toggleToolsEl(),o&&o.stopCommand('resize')}}}},8463:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>i});var r=n(2316),o=n.n(r)().$;const i={startSelectPosition:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.isPointed=!1;var o=this.editorModel.get('Utils'),i=t.ownerDocument.body;o&&!this.sorter&&(this.sorter=new o.Sorter({container:i,placer:this.canvas.getPlacerEl(),containerSel:'*',itemSel:'*',pfx:this.ppfx,direction:'a',document:e,wmargin:1,nested:1,em:this.editorModel,canvasRelative:1,scale:function(){return n.em.getZoomDecimal()}})),r.onStart&&(this.sorter.onStart=r.onStart),t&&this.sorter.startSort(t,{container:i})},getOffsetDim:function(){var t=this.offset(this.canvas.getFrameEl()),e=this.offset(this.canvas.getElement());return{top:t.top-e.top,left:t.left-e.left}},stopSelectPosition:function(){this.posTargetCollection=null,this.posIndex='after'==this.posMethod&&0!==this.cDim.length?this.posIndex+1:this.posIndex,this.sorter&&(this.sorter.moved=0,this.sorter.endMove()),this.cDim&&(this.posIsLastEl=0!==this.cDim.length&&'after'==this.posMethod&&this.posIndex==this.cDim.length,this.posTargetEl=0===this.cDim.length?o(this.outsideElem):!this.posIsLastEl&&this.cDim[this.posIndex]?o(this.cDim[this.posIndex][5]).parent():o(this.outsideElem),this.posTargetModel=this.posTargetEl.data('model'),this.posTargetCollection=this.posTargetEl.data('model-comp'))},enable:function(){this.startSelectPosition()},nearFloat:function(t,e,n){var r=t||0,o=e||'before',i=n.length,a=0!==i&&'after'==o&&r==i;return 0!==i&&(!a&&!n[r][4]||n[r-1]&&!n[r-1][4]||a&&!n[r-1][4])?1:0},run:function(){this.enable()},stop:function(){this.stopSelectPosition(),this.$wrapper.css('cursor',''),this.$wrapper.unbind()}}},7994:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>u});var r=n(4942),o=n(2316),i=n.n(o),a=n(9050),s=n(1163);function l(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}var c=i().$;const u={getOffsetMethod:function(t){return'get'+(t||'')+'OffsetViewerEl'},run:function(t,e,n){var o=n||{},i=o.state||'',u=t.getConfig(),p=this.em.getZoomDecimal(),f=o.el||'';if(!u.showOffsets||(0,s.isTextNode)(f)||!u.showOffsetsSelected&&'Fixed'==i)t.stopCommand(this.id,n);else{var d=t.Canvas,h=function(t){for(var e=1;e")).get(0),A=c("")).get(0),M=v+E+'-el',D="".concat(v+T+'-el'," ").concat(v+T),L="".concat(M," ").concat(v+E);b=c("
")).get(0),w=c("
")).get(0),_=c("
")).get(0),x=c("
")).get(0),O=c("
")).get(0),C=c("
")).get(0),k=c("
")).get(0),S=c("
")).get(0),this['marginT'+i]=b,this['marginB'+i]=w,this['marginL'+i]=_,this['marginR'+i]=x,this['padT'+i]=O,this['padB'+i]=C,this['padL'+i]=k,this['padR'+i]=S,j.appendChild(b),j.appendChild(w),j.appendChild(_),j.appendChild(x),A.appendChild(O),A.appendChild(C),A.appendChild(k),A.appendChild(S),y.appendChild(j),y.appendChild(A),this[m]='1'}var R='px',Z=parseFloat(g.marginLeft.replace(R,''))*p,N=parseFloat(g.marginRight.replace(R,''))*p,I=parseFloat(g.marginTop.replace(R,''))*p,F=parseFloat(g.marginBottom.replace(R,''))*p,V=b.style,B=w.style,H=_.style,z=x.style,U=O.style,W=C.style,$=k.style,q=S.style,G=parseFloat(h.left),K=parseFloat(g.width)*p+R;V.height=I+R,V.width=K,V.top=h.top-I+R,V.left=G+R,B.height=F+R,B.width=K,B.top=h.top+h.height+R,B.left=G+R;var Y=h.height+I+F+R,X=h.top-I+R;H.height=Y,H.width=Z+R,H.top=X,H.left=G-Z+R,z.height=Y,z.width=N+R,z.top=X,z.left=G+h.width+R;var J=parseFloat(g.paddingTop)*p;U.height=J+R;var Q=parseFloat(g.paddingBottom)*p;W.height=Q+R;var tt=h.height-Q-J+R,et=h.top+J+R;$.height=tt,$.width=parseFloat(g.paddingLeft)*p+R,$.top=et;var nt=parseFloat(g.paddingRight)*p;q.height=tt,q.width=nt+R,q.top=et}},stop:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n||{},o=r.state||'',i=this.getOffsetMethod(o),a=t.Canvas,s=a[i](n.view);s.style.opacity=0}}},8352:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>o});var r=n(9050);const o={init:function(){(0,r.bindAll)(this,'_onFramesChange')},run:function(t){this.toggleVis(t)},stop:function(t){this.toggleVis(t,0)},toggleVis:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(!t.Commands.isActive('preview')){var r=t.Canvas,o=n?'on':'off';r.getFrames().forEach((function(t){return e._upFrame(t,n)})),r.getModel()[o]('change:frames',this._onFramesChange)}},_onFramesChange:function(t,e){var n=this;e.forEach((function(t){return t.once('loaded',(function(){return n._upFrame(t,!0)}))}))},_upFrame:function(t,e){var n=e?'add':'remove';t.view.getBody().classList[n]("".concat(this.ppfx,"dashed"))}}},9304:(t,e,n)=>{"use strict";n.d(e,{Z:()=>c});var r=n(4942),o=n(2982),i=n(9050),a=n(1163);function s(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function l(t){for(var e=1;e
0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.all,r=e.onResult,o=e.reset,i=this.storageKey,s={action:'load'},l=n||this.getAll(),c=t[i];if('string'==typeof c)try{c=JSON.parse(c)}catch(t){this.__logWarn('Data parsing failed',{input:c})}return o&&c&&l.reset(null,s),r?c&&r(c,s):c&&(0,a.isDef)(c.length)&&l.reset(c,s),c},clear:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.all;return e&&e.reset(null,t),this},__getConfig:function(t){var e=this.config||{};return t?e[t]:e},getAll:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.all?t.array?(0,o.Z)(this.all.models):this.all:[]},getAllMap:function(){return this.getAll().reduce((function(t,e){return t[e.get(e.idAttribute)]=e,t}),{})},__initConfig:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.config=(0,a.deepMerge)(t,e),this.em=this.config.em,this.cls=[]},__initListen:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.all,n=this.em,r=this.events;e&&n&&e.on('add',(function(t,e,o){return n.trigger(r.add,t,o)})).on('remove',(function(t,e,o){return n.trigger(r.remove,t,o)})).on('change',(function(t,e){return n.trigger(r.update,t,t.changedAttributes(),e)})).on('all',this.__catchAllEvent,this),this.cls=[e].concat(t.collections||[]),(t.propagate||[]).forEach((function(t){var r=t.entity,o=t.event;r.on('all',(function(t,r,i,a){var s=l({event:t},a||i);[n,e].map((function(t){return t.trigger(o,r,s)}))}))}))},__remove:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.em,o=(0,i.isString)(t)?this.get(t):t,a=function(){return o&&e.all.remove(o,n),o};return!n.silent&&r&&r.trigger(this.events.removeBefore,o,a,n),!n.abort&&a()},__catchAllEvent:function(t,e,n,r){var o=this.em,i=this.events,a=r||n;o&&i.all&&o.trigger(i.all,{event:t,model:e,options:a}),this.__onAllEvent()},__appendTo:function(){var t=this.getConfig().appendTo;if(t){var e=(0,i.isElement)(t)?t:document.querySelector(t);if(!e)return this.__logWarn('"appendTo" element not found');e.appendChild(this.render())}},__onAllEvent:function(){},__logWarn:function(t,e){this.em.logWarning("[".concat(this.name,"]: ").concat(t),e)},_createId:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,n=this.getAll(),r=n.length+e,o=this.getAllMap();do{t=(0,a.createId)(r)}while(o[t]);return t},__listenAdd:function(t,e){var n=this;t.on('add',(function(t,r,o){return n.em.trigger(e,t,o)}))},__listenRemove:function(t,e){var n=this;t.on('remove',(function(t,r,o){return n.em.trigger(e,t,o)}))},__listenUpdate:function(t,e){var n=this;t.on('change',(function(t,r){return n.em.trigger(e,t,t.changedAttributes(),r)}))},__destroy:function(){var t;this.cls.forEach((function(t){t.stopListening(),t.reset()})),this.em=0,this.config=0,null===(t=this.view)||void 0===t||t.remove(),this.view=0}}},9138:(t,e,n)=>{"use strict";n.d(e,{ZP:()=>N,OA:()=>A,GN:()=>R,xH:()=>Z});var r=n(1002),o=n(2982),i=n(885),a=n(4942),s=n(5671),l=n(3144),c=n(1752),u=n(9340),p=n(2963),f=n(1120),d=n(9050),h=n(1163),g=n(1519),v=n(2316),m=n(8431),y=n(5963),b=n(966);function w(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function _(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{},n=e.locale,r=void 0===n||n,o=this.getId(),i=this.get('label')||this.getName();return r&&(null===(t=this.em)||void 0===t?void 0:t.t("traitManager.traits.labels.".concat(o)))||i}},{key:"getValue",value:function(){return this.getTargetValue()}},{key:"setValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={};e.partial&&(n.avoidStore=!0),this.setTargetValue(t,n),!1===e.partial&&(this.setTargetValue(''),this.setTargetValue(t))}},{key:"props",value:function(){return this.attributes}},{key:"targetUpdated",value:function(){var t,e=this.getTargetValue();this.set({value:e},{fromTarget:1}),null===(t=this.em)||void 0===t||t.trigger('trait:update',{trait:this,component:this.target})}},{key:"getTargetValue",value:function(){var t,e=this.get('name'),n=this.target;return t=this.get('changeProp')?n.get(e):n.getAttributes()[e],(0,d.isUndefined)(t)?'':t}},{key:"setTargetValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.target,r=this.get('name');if(!(0,d.isUndefined)(t)){var o=t;'false'===t?o=!1:'true'===t&&(o=!0),this.get('changeProp')?n.set(r,o,e):n.addAttributes({[r]:o},e)}}},{key:"setValueFromInput",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={value:t};this.set(r,_(_({},n),{},{avoidStore:1})),e&&(this.set('value','',n),this.set(r,n))}},{key:"getInitValue",value:function(){var t,e=this.target,n=this.get('name');if(e){var r=e.get('attributes');t=this.get('changeProp')?e.get(n):r[n]}return t||this.get('value')||this.get('default')}}]),n}(v.Model);O.prototype.defaults={type:'text',label:'',name:'',min:'',max:'',unit:'',step:1,value:'',target:'',default:'',placeholder:'',changeProp:0,options:[]};function C(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,f.Z)(t);if(e){var o=(0,f.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,p.Z)(this,n)}}var k=function(t){(0,u.Z)(n,t);var e=C(n);function n(){return(0,s.Z)(this,n),e.apply(this,arguments)}return(0,l.Z)(n,[{key:"initialize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.em=e.em,this.listenTo(this,'add',this.handleAdd),this.listenTo(this,'reset',this.handleReset)}},{key:"handleReset",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.previousModels,r=void 0===n?[]:n;r.forEach((function(t){return t.trigger('remove')}))}},{key:"handleAdd",value:function(t){t.em=this.em;var e=this.target;e&&(t.target=e)}},{key:"setTarget",value:function(t){this.target=t}},{key:"add",value:function(t,e){var n=this.em;if((0,d.isString)(t)||(0,d.isArray)(t)){var r=n&&n.get&&n.get('TraitManager'),o=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{build:function(e){var n=[];'string'==typeof e&&(e=[e]);for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,d.bindAll)(this,'__upSymbProps','__upSymbCls','__upSymbComps');var o=r.em,i=this.parent(),a=i&&i.attributes,s=this.get('propagate');if(s&&this.set('propagate',(0,d.isArray)(s)?s:[s]),a&&a.propagate&&!s){var l={},c=a.propagate;c.forEach((function(t){return l[t]=i.get(t)})),l.propagate=c,this.set(P(P({},l),e))}if(r&&r.config&&r.config.voidElements.indexOf(this.get('tagName'))>=0&&this.set('void',!0),r.em=o,this.opt=r,this.em=o,this.frame=r.frame,this.config=r.config||{},this.set('attributes',P(P({},(0,d.result)(this,'defaults').attributes||{}),this.get('attributes')||{})),this.ccid=n.createId(this,r),this.initClasses(),this.initTraits(),this.initComponents(),this.initToolbar(),this.initScriptProps(),this.listenTo(this,'change:script',this.scriptUpdated),this.listenTo(this,'change:tagName',this.tagUpdated),this.listenTo(this,'change:attributes',this.attrUpdated),this.listenTo(this,'change:attributes:id',this._idUpdated),this.on('change:toolbar',this.__emitUpdateTlb),this.on('change',this.__onChange),this.on(Z,this.__propToParent),this.set('status',''),this.views=[],['classes','traits','components'].forEach((function(e){var n="add remove ".concat('components'!==e?'change':'');t.listenTo(t.get(e),n.trim(),(function(){for(var n=arguments.length,r=new Array(n),o=0;o0&&void 0!==arguments[0]?arguments[0]:{},e=this.em,n=e&&e.get('UndoManager'),r=this.components();n&&!this.__hasUm&&(n.add(r),n.add(this.getSelectors()),this.__hasUm=1),t.recursive&&r.map((function(e){return e.__postAdd(t)}))}},{key:"__postRemove",value:function(){var t=this.em,e=t&&t.get('UndoManager');e&&(e.remove(this.components()),e.remove(this.getSelectors()),delete this.__hasUm)}},{key:"__onChange",value:function(t,e){var n=this,r=this.changedAttributes();(0,d.keys)(r).forEach((function(t){return n.emitUpdate(t)})),['status','open','toolbar','traits'].forEach((function(t){return delete r[t]})),(0,h.isEmptyObj)(r)||(this.__changesUp(e),this.__propSelfToParent({component:this,changed:r,options:e}))}},{key:"__changesUp",value:function(t){var e=this.em;[this.frame,e].forEach((function(e){return e&&e.changesUp(t)}))}},{key:"__propSelfToParent",value:function(t){this.trigger(R,t),this.__propToParent(t)}},{key:"__propToParent",value:function(t){var e=this.parent();e&&e.trigger(Z,t)}},{key:"__emitUpdateTlb",value:function(){this.emitUpdate('toolbar')}},{key:"is",value:function(t){return!(this.get('type')!=t)}},{key:"props",value:function(){return this.attributes}},{key:"index",value:function(){var t=this.collection;return t?t.indexOf(this):0}},{key:"setDragMode",value:function(t){return this.set('dmode',t)}},{key:"find",value:function(t){var e=[],n=this.view.$el.find(t);return n.each((function(t){var r=n.eq(t).data('model');r&&e.push(r)})),e}},{key:"findType",value:function(t){var e=[];return function n(r){return r.forEach((function(r){r.is(t)&&e.push(r),n(r.components())}))}(this.components()),e}},{key:"closest",value:function(t){var e=this.view.$el.closest(t);return e.length&&e.data('model')}},{key:"closestType",value:function(t){for(var e=this.parent();e&&!e.is(t);)e=e.parent();return e}},{key:"contains",value:function(t){var e=!1;if(!t)return e;var n=function n(r){!e&&r.forEach((function(r){r===t&&(e=!0),!e&&n(r.components())}))};return n(this.components()),e}},{key:"tagUpdated",value:function(){this.trigger('rerender')}},{key:"replaceWith",value:function(t){var e=this.collection,n=e.indexOf(this);return e.remove(this),e.add(t,{at:n})}},{key:"attrUpdated",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=this.get('attributes'),i=o.class;i&&this.setClass(i),delete o.class;var a=o.style;a&&this.setStyle(a),delete o.style;var s=P({},this.previous('attributes')),l=(0,h.shallowDiff)(s,this.get('attributes'));(0,d.keys)(l).forEach((function(t){return n.trigger("change:attributes:".concat(t),n,l[t],r)}))}},{key:"setAttributes",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.set('attributes',P({},t),e),this}},{key:"addAttributes",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.setAttributes(P(P({},this.getAttributes({noClass:!0})),t),e)}},{key:"removeAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Array.isArray(t)?t:[t],r=this.getAttributes();return n.map((function(t){return delete r[t]})),this.setAttributes(r,e)}},{key:"getStyle",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.em,o=(0,d.isString)(t)?t:'',i=o?e:t;if(r&&r.getConfig().avoidInlineStyle&&!i.inline){var a=r.get('state'),s=r.get('CssComposer'),l=s.getIdRule(this.getId(),P({state:a},i));if(this.rule=l,l)return l.getStyle(o)}return(0,c.Z)((0,f.Z)(n.prototype),"getStyle",this).call(this,o)}},{key:"setStyle",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=this.em,i=this.opt;if(o&&o.getConfig().avoidInlineStyle&&!i.temporary&&!r.inline){var a=this.get('style')||{};e=P(P({},e=(0,d.isString)(e)?this.parseStyle(e):e),a);var s=o.get('state'),l=o.get('CssComposer'),u=this.getStyle(r);this.rule=l.setIdRule(this.getId(),e,P(P({},r),{},{state:s}));var p=(0,h.shallowDiff)(u,e);this.set('style','',{silent:1}),(0,d.keys)(p).forEach((function(e){return t.trigger("change:style:".concat(e))}))}else e=(0,c.Z)((0,f.Z)(n.prototype),"setStyle",this).apply(this,arguments);return e}},{key:"getAttributes",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.em,r=[],o=P({},this.get('attributes')),i=n&&n.get('SelectorManager'),a=this.getId();if(e.noClass?delete o.class:(this.get('classes').forEach((function(t){return r.push((0,d.isString)(t)?t:t.get('name'))})),r.length&&(o.class=r.join(' '))),!e.noStyle){var s=this.get('style');(0,h.isObject)(s)&&!(0,h.isEmptyObj)(s)&&(o.style=this.styleToString({inline:1}))}(0,d.has)(o,'id')||(j(n)?t=i&&i.get(a,i.Selector.TYPE_ID):(0,d.isEmpty)(this.getStyle())||(t=1),(this.__getSymbol()||this.__getSymbols())&&(t=1),t&&(o.id=a));return o}},{key:"addClass",value:function(t){var e=this.em.get('SelectorManager').addClass(t);return this.get('classes').add(e)}},{key:"setClass",value:function(t){return this.get('classes').reset(),this.addClass(t)}},{key:"removeClass",value:function(t){var e=[];t=(0,d.isArray)(t)?t:[t];var n=this.get('classes'),r=y.Z.TYPE_CLASS;return t.forEach((function(t){t.split(' ').forEach((function(t){var o=n.where({name:t,type:r})[0];o&&e.push(n.remove(o))}))})),e}},{key:"getClasses",value:function(){var t=this.getAttributes().class;return t?t.split(' '):[]}},{key:"__logSymbol",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.__getSymbol(),o=this.__getSymbols();(r||o)&&this.em.log(t,{model:this,toUp:e,context:'symbols',opts:n})}},{key:"__initSymb",value:function(){this.__symbReady||(this.on('change',this.__upSymbProps),this.__symbReady=1)}},{key:"__isSymbol",value:function(){return(0,d.isArray)(this.get(M))}},{key:"__isSymbolOrInst",value:function(){return!(!this.__isSymbol()&&!this.get(D))}},{key:"__isSymbolTop",value:function(){var t=this.parent();return this.__isSymbolOrInst()&&(!t||t&&!t.__isSymbol()&&!t.__getSymbol())}},{key:"__isSymbolNested",value:function(){if(!this.__isSymbolOrInst()||this.__isSymbolTop())return!1;var t=(this.__isSymbol()?this:this.__getSymbol()).__getSymbTop(),e=this.__getSymbTop();return(e.__isSymbol()?e:e.__getSymbol())!==t}},{key:"__getAllById",value:function(){var t=this.em;return t?t.get('DomComponents').allById():{}}},{key:"__getSymbol",value:function(){var t=this.get(D);if(t&&(0,d.isString)(t)){var e=this.__getAllById()[t];e?(t=e,this.set(D,e)):t=0}return t}},{key:"__getSymbols",value:function(){var t=this,e=this.get(M);return e&&(0,d.isArray)(e)&&(e.forEach((function(n,r){n&&(0,d.isString)(n)&&(e[r]=t.__getAllById()[n])})),e=e.filter((function(t){return t&&!(0,d.isString)(t)}))),e}},{key:"__isSymbOvrd",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'',e=this.get(L),n=t.split(':'),r=(0,i.Z)(n,1),o=r[0],a=t!==o?[t,o]:[t];return!0===e||(0,d.isArray)(e)&&a.some((function(t){return e.indexOf(t)>=0}))}},{key:"__getSymbToUp",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=[],r=this.em,i=e.changed,a=r&&r.config.symbols;if(e.fromInstance||e.noPropagate||e.fromUndo||!a||i&&this.__isSymbOvrd(i))return n;var s=this.__getSymbols()||[],l=this.__getSymbol(),c=l?[l].concat((0,o.Z)(l.__getSymbols()||[])):s;return n=c.filter((function(e){return e!==t})).filter((function(t){return!(i&&t.__isSymbOvrd(i))}))}},{key:"__getSymbTop",value:function(t){for(var e=this,n=this.parent(t);n&&(n.__isSymbol()||n.__getSymbol());)e=n,n=n.parent(t);return e}},{key:"__upSymbProps",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.changedAttributes(),o=r.attributes||{};if(delete r.status,delete r.open,delete r[M],delete r[D],delete r[L],delete r.attributes,delete o.id,(0,h.isEmptyObj)(o)||(r.attributes=o),!(0,h.isEmptyObj)(r)){var i=this.__getSymbToUp(n);(0,d.keys)(r).map((function(t){e.__isSymbOvrd(t)&&delete r[t]})),this.__logSymbol('props',i,{opts:n,changed:r}),i.forEach((function(t){var o=P({},r);(0,d.keys)(o).map((function(e){t.__isSymbOvrd(e)&&delete o[e]})),t.set(o,P({fromInstance:e},n))}))}}},{key:"__upSymbCls",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=this.__getSymbToUp(r);this.__logSymbol('classes',o,{opts:r}),o.forEach((function(t){t.set('classes',n.get('classes'),{fromInstance:n})})),this.__changesUp(r)}},{key:"__upSymbComps",value:function(t,e,n){var r=this,i=n||e||{},a={fromInstance:i.fromInstance,fromUndo:i.fromUndo},s=t.opt.temporary;if(n)if(n.add){var l=[],c=!!this.__getSymbols(),u=this.__getSymbToUp(P(P({},a),{},{changed:'components:add'}));if(u.length){var p=t.__getSymbol();l=(p?p.__getSymbols():t.__getSymbols())||[],(l=(0,o.Z)(l)).push(p||t)}!s&&this.__logSymbol('add',u,{opts:n,addedInstances:l.map((function(t){return t.cid})),added:t.cid}),u.forEach((function(e){var o=e.__getSymbTop(),i=l.filter((function(t){var e=t.__getSymbTop({prev:1});return o&&e&&e===o}))[0]||t.clone({symbol:1,symbolInv:c});e.append(i,P({fromInstance:r},n))}))}else{var f=t.__getSymbol();if(f&&!n.temporary&&f.set(M,f.__getSymbols().filter((function(e){return e!==t}))),!t.__isSymbolTop()){var d='components:remove',h=n.index,g=t.parent(),v=P({fromInstance:t},n),m=t.__isSymbolNested(),y=function(t){var e=t.parent();e&&!e.__isSymbOvrd(d)&&t.remove(v)},b=g.__isSymbOvrd(d)?[]:t.__getSymbToUp(a);m&&(b=g.__getSymbToUp(P(P({},a),{},{changed:d})),y=function(t){var e=t.components().at(h);e&&e.remove(P({fromInstance:g},v))}),!s&&this.__logSymbol('remove',b,{opts:n,removed:t.cid,isSymbNested:m}),b.forEach(y)}}else{var w=this.__getSymbToUp(P(P({},a),{},{changed:'components:reset'}));this.__logSymbol('reset',w,{components:t.models}),w.forEach((function(n){var o=t.models.map((function(t){return t.clone({symbol:1})}));n.components().reset(o,P({fromInstance:r},e))}))}this.__changesUp(i)}},{key:"initClasses",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r='change:classes',o=this.get('attributes').class||[],i=[this,r,this.initClasses],a=this.get('classes')||o,s=(0,d.isString)(a)?a.split(' '):a;this.stopListening.apply(this,i);var l=this.normalizeClasses(s),c=new b.Z([]);return this.set('classes',c,n),c.add(l),c.on('add remove reset',this.__upSymbCls),this.listenTo.apply(this,i),this}},{key:"initComponents",value:function(){var t=[this,'change:components',this.initComponents];this.stopListening.apply(this,t);var e=new m.Z(null,this.opt);e.parent=this;var n=this.get('components'),r=!this.opt.avoidChildren;return this.set('components',e),r&&n&&e.add((0,d.isFunction)(n)?n(this):n,this.opt),e.on('add remove reset',this.__upSymbComps),this.listenTo.apply(this,t),this}},{key:"initTraits",value:function(t){var e=this.em,n='change:traits';this.off(n,this.initTraits),this.__loadTraits();var r=P({},this.get('attributes')),o=this.get('traits');return o.each((function(t){if(!t.get('changeProp')){var e=t.get('name'),n=t.getInitValue();e&&n&&(r[e]=n)}})),o.length&&this.set('attributes',r),this.on(n,this.initTraits),t&&e&&e.trigger('component:toggled'),this}},{key:"initScriptProps",value:function(){if(!this.opt.temporary){var t='script-props',e=["change:".concat(t),this.initScriptProps];this.off.apply(this,e);var n=this.previous(t)||[],r=this.get(t)||[],o=n.map((function(t){return"change:".concat(t)})).join(' '),i=r.map((function(t){return"change:".concat(t)})).join(' ');o&&this.off(o,this.__scriptPropsChange),i&&this.on(i,this.__scriptPropsChange),this.on.apply(this,e)}}},{key:"__scriptPropsChange",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n.avoidStore||this.trigger('rerender')}},{key:"append",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(0,d.isArray)(t)?(0,o.Z)(t):[t],r=n.map((function(t){return(0,d.isString)(t)||t.collection&&t.collection.remove(t,{temporary:1}),t})),i=this.components().add(r,e);return(0,d.isArray)(i)?i:[i]}},{key:"components",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.get('components');return(0,d.isUndefined)(t)?n:(n.reset(null,e),t?this.append(t,e):[])}},{key:"getChildAt",value:function(t){return this.components().at(t||0)||null}},{key:"getLastChild",value:function(){var t=this.components();return t.at(t.length-1)||null}},{key:"empty",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.components().reset(null,t),this}},{key:"parent",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.collection||t.prev&&this.prevColl;return e?e.parent:null}},{key:"parents",value:function(){var t=this.parent();return t?[t].concat(t.parents()):[]}},{key:"scriptUpdated",value:function(){this.set('scriptUpdated',1)}},{key:"initToolbar",value:function(){var t=this.em,e=this,n=t&&t.getConfig().stylePrefix||'';if(!e.get('toolbar')&&t){var r=[];e.collection&&r.push({label:t.getIcon('arrowUp'),command:function(t){return t.runCommand('core:component-exit',{force:1})}}),e.get('draggable')&&r.push({attributes:{class:"".concat(n,"no-touch-actions"),draggable:!0},label:t.getIcon('move'),command:'tlb-move'}),e.get('copyable')&&r.push({label:t.getIcon('copy'),command:'tlb-clone'}),e.get('removable')&&r.push({label:t.getIcon('delete'),command:'tlb-delete'}),e.set('toolbar',r)}}},{key:"__loadTraits",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t||this.get('traits');if(!(n instanceof k)){n=(0,d.isFunction)(n)?n(this):n;var r=new k([],this.opt);r.setTarget(this),n.length&&(n.forEach((function(t){return t.attributes&&delete t.attributes.value})),r.add(n)),this.set({traits:r},e)}return this}},{key:"getTraits",value:function(){return this.__loadTraits(),(0,o.Z)(this.get('traits').models)}},{key:"setTraits",value:function(t){var e=(0,d.isArray)(t)?t:[t];return this.set({traits:e}),this.getTraits()}},{key:"getTrait",value:function(t){return this.getTraits().filter((function(e){return e.get('id')===t||e.get('name')===t}))[0]||null}},{key:"updateTrait",value:function(t,e){var n,r=this.getTrait(t);return r&&r.set(e),null===(n=this.em)||void 0===n||n.trigger('component:toggled'),this}},{key:"getTraitIndex",value:function(t){var e=this.getTrait(t);return e?this.get('traits').indexOf(e):-1}},{key:"removeTrait",value:function(t){var e,n=this,r=((0,d.isArray)(t)?t:[t]).map((function(t){return n.getTrait(t)})),o=this.get('traits'),i=r.length?o.remove(r):[];return null===(e=this.em)||void 0===e||e.trigger('component:toggled'),(0,d.isArray)(i)?i:[i]}},{key:"addTrait",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.__loadTraits();var r=this.get('traits').add(t,n);return null===(e=this.em)||void 0===e||e.trigger('component:toggled'),(0,d.isArray)(r)?r:[r]}},{key:"normalizeClasses",value:function(t){var e=[],n=this.em,r=n&&n.get('SelectorManager');if(r)return t.models?(0,o.Z)(t.models):(t.forEach((function(t){return e.push(r.add(t))})),e)}},{key:"clone",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.em,n=P({},this.attributes),r=P({},this.opt),i=this.getId(),a=e&&e.get('CssComposer');n.attributes=P({},n.attributes),delete n.attributes.id,n.components=[],n.classes=[],n.traits=[],this.__isSymbolTop()&&(t.symbol=1),this.get('components').each((function(e,r){n.components[r]=e.clone(P(P({},t),{},{_inner:1}))})),this.get('traits').each((function(t,e){n.traits[e]=t.clone()})),this.get('classes').each((function(t,e){n.classes[e]=t.get('name')})),n.status='',r.collection=null;var s=new this.constructor(n,r),l="#".concat(s.getId()),c=a?a.getRules("#".concat(i)):[];c.forEach((function(t){var e=t.clone();e.set('selectors',[l]),a.getAll().add(e)})),s.set(M,0);var u=this.__getSymbol(),p=this.__getSymbols();t.symbol||!u&&!p?u?(u.set(M,[].concat((0,o.Z)(u.__getSymbols()),[s])),s.__initSymb()):t.symbol&&(this.__isSymbol()?(this.set(M,[].concat((0,o.Z)(p),[s])),s.set(D,this),s.__initSymb()):t.symbolInv?(this.set(M,[s]),s.set(D,this),[this,s].map((function(t){return t.__initSymb()}))):(s.set(M,[this]),[this,s].map((function(t){return t.__initSymb()})),this.set(D,s))):(s.set(D,0),s.set(M,0));var f='component:clone';return e&&e.trigger(f,s),this.trigger(f,s),s}},{key:"getName",value:function(){var t=this.em,e=this.attributes,n=e.type,r=e.tagName,o=e.name,i=n||r,a=!n&&r,s='domComponents.names.',l=o&&(null==t?void 0:t.t("".concat(s).concat(o))),c=a&&(null==t?void 0:t.t("".concat(s).concat(a))),u=t&&(t.t("".concat(s).concat(n))||t.t("".concat(s).concat(r)));return this.get('custom-name')||l||o||c||(0,h.capitalize)(a)||u||(0,h.capitalize)(i)}},{key:"getIcon",value:function(){var t=this.get('icon');return t?t+' ':''}},{key:"toHTML",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this,n=[],r=t.tag,o=r||e.get('tagName'),i=e.get('void'),a=t.attributes,s=this.getAttrToHTML();if(delete t.tag,a&&((0,d.isFunction)(a)?s=a(e,s)||{}:(0,h.isObject)(a)&&(s=a)),t.withProps){var l=this.toJSON();(0,d.forEach)(l,(function(t,e){'_'!==e[0]&&['classes','attributes','components'].indexOf(e)<0&&(s["data-gjs-".concat(e)]=(0,d.isArray)(t)||(0,h.isObject)(t)?JSON.stringify(t):t)}))}for(var c in s){var u=s[c];if(!(0,d.isUndefined)(u)&&null!==u)if((0,d.isBoolean)(u))u&&n.push(c);else{var p='';if(t.altQuoteAttr&&(0,d.isString)(u)&&u.indexOf('"')>=0)p="'".concat(u.replace(/'/g,'''),"'");else{var f=(0,d.isString)(u)?u.replace(/"/g,'"'):u;p="\"".concat(f,"\"")}n.push("".concat(c,"=").concat(p))}}var g=n.length?" ".concat(n.join(' ')):'',v=e.getInnerHTML(t),m="<".concat(o).concat(g).concat(i?'/':'',">").concat(v);return!i&&(m+="".concat(o,">")),m}},{key:"getInnerHTML",value:function(t){return this.__innerHTML(t)}},{key:"__innerHTML",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.components();return e.length?e.map((function(e){return e.toHTML(t)})).join(''):this.get('content')}},{key:"getAttrToHTML",value:function(){var t=this.getAttributes();return delete t.style,t}},{key:"toJSON",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=v.Model.prototype.toJSON.call(this,t);if(e.attributes=this.getAttributes(),delete e.attributes.class,delete e.toolbar,delete e.traits,delete e.status,delete e.open,delete e._undoexc,!t.fromUndo){var n=e[D],r=e[M];r&&(0,d.isArray)(r)&&(e[M]=r.filter((function(t){return t})).map((function(t){return t.getId?t.getId():t}))),n&&!(0,d.isString)(n)&&(e[D]=n.getId())}return this.em.getConfig().avoidDefaults&&this.getChangedProps(e),e}},{key:"getChangedProps",value:function(t){var e=t||v.Model.prototype.toJSON.apply(this),n=(0,d.result)(this,'defaults');return(0,d.forEach)(n,(function(t,n){-1===['type'].indexOf(n)&&e[n]===t&&delete e[n]})),(0,d.isEmpty)(e.type)&&delete e.type,(0,d.forEach)(['attributes','style'],(function(t){(0,d.isEmpty)(n[t])&&(0,d.isEmpty)(e[t])&&delete e[t]})),(0,d.forEach)(['classes','components'],(function(t){(!e[t]||(0,d.isEmpty)(n[t])&&!e[t].length)&&delete e[t]})),e}},{key:"getId",value:function(){return(this.get('attributes')||{}).id||this.ccid||this.cid}},{key:"setId",value:function(t,e){var n=P({},this.get('attributes'));return n.id=t,this.set('attributes',n,e),this}},{key:"getEl",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,e=this.getView(t);return e&&e.el}},{key:"getView",value:function(t){var e=this.view,n=this.views;return t&&(e=n.filter((function(e){return e._getFrame()===t.view}))[0]),e}},{key:"getCurrentView",value:function(){var t=(this.em.get('currentFrame')||{}).model;return this.getView(t)}},{key:"__getScriptProps",value:function(){var t=this.props();return(this.get('script-props')||[]).reduce((function(e,n){return e[n]=t[n],e}),{})}},{key:"getScriptString",value:function(t){var e=this,n=t||this.get('script');if(!n)return n;if(this.get('script-props'))n=n.toString().trim();else{if('function'==typeof n){var o=n.toString().trim();n=(o=o.replace(/^function[\s\w]*\(\)\s?\{/,'').replace(/\}$/,'')).trim()}var i=this.em.getConfig(),a=E(i.tagVarStart||'{[ '),s=E(i.tagVarEnd||' ]}'),l=new RegExp("".concat(a,"([\\w\\d-]*)").concat(s),'g');n=n.replace(l,(function(t,n){e.scriptUpdated();var o=e.attributes[n]||'';return(0,d.isArray)(o)||'object'==(0,r.Z)(o)?JSON.stringify(o):o}))}return n}},{key:"emitUpdate",value:function(t){for(var e=this.em,n=R+(t?":".concat(t):''),r=t&&this.get(t),o=arguments.length,i=new Array(o>1?o-1:0),a=1;a=0&&this.__propSelfToParent({component:this,changed:{[t]:r},options:i[2]||i[1]||{}})}},{key:"onAll",value:function(t){return(0,d.isFunction)(t)&&(t(this),this.components().forEach((function(e){return e.onAll(t)}))),this}},{key:"remove",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.em,r=this.collection,o=function(){r&&r.remove(t,P(P({},e),{},{action:'remove-component'})),r||(t.components('',e),t.components().removeChildren(t,null,e))},i=P({},e);return[this,n].map((function(e){return e.trigger('component:remove:before',t,o,i)})),!i.abort&&o(),this}},{key:"move",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t){var n=e.at,r=this.index(),o=t===this.parent(),i=r===n||r===n-1;o&&i||(o&&n&&n>r&&(e.at=n-1),this.remove({temporary:1}),t.append(this,e),this.emitUpdate())}return this}},{key:"isInstanceOf",value:function(t){var e,n,r=null===(e=this.em)||void 0===e||null===(n=e.get('DomComponents').getType(t))||void 0===n?void 0:n.model;return!!r&&this instanceof r}},{key:"isChildOf",value:function(t){for(var e=(0,d.isString)(t),n=this.parent();n;){if(e){if(n.isInstanceOf(t))return!0}else if(n===t)return!0;n=n.parent()}return!1}},{key:"resetId",value:function(){var t=this.em,e=this.getId();if(e){var r=n.createId(this);this.setId(r);var o=t&&t.get('CssComposer').getIdRule(e),i=o&&o.get('selectors').at(0);return i&&i.set('name',r),this}}},{key:"_getStyleRule",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.id,n=this.em,r=e||this.getId();return n&&n.get('CssComposer').getIdRule(r)}},{key:"_getStyleSelector",value:function(t){var e=this._getStyleRule(t);return e&&e.get('selectors').at(0)}},{key:"_idUpdated",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!r.idUpdate){var o=this.ccid,i=this.get('attributes')||{},a=i.id,s=(this.previous('attributes')||{}).id||o,l=n.getList(this);if(l[a]||!a&&s)return this.setId(s,{idUpdate:1});delete l[s],l[a]=this,this.ccid=a;var c=this._getStyleSelector({id:s});c&&c.set({name:a,label:a})}}}]),n}(g.Z);N.getDefaults=function(){return(0,d.result)(this.prototype,'defaults')},N.isComponent=function(t){return{tagName:(0,h.toLowerCase)(t.tagName)}},N.ensureInList=function(t){var e=N.getList(t),n=t.getId(),r=e[n];if(r){if(r!==t){var o=N.getIncrementId(n,e);t.setId(o),e[o]=t}}else e[n]=t;t.components().forEach((function(t){return N.ensureInList(t)}))},N.createId=function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=N.getList(t),o=n.idMap,i=void 0===o?{}:o,a=t.get('attributes'),s=a.id;return s?(e=N.getIncrementId(s,r,n),t.setId(e),s!==e&&(i[s]=e)):e=N.getNewId(r),r[e]=t,e},N.getNewId=function(t){for(var e=Object.keys(t).length.toString().length+2,n=(Math.random()+1.1).toString(36).slice(-e),r="i".concat(n);t[r];)r=N.getNewId(t);return r},N.getIncrementId=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.keepIds,o=void 0===r?[]:r,i=1,a=t;if(o.indexOf(t)<0)for(;e[a];)i++,a="".concat(t,"-").concat(i);return a},N.getList=function(t){var e=t.opt,n=void 0===e?{}:e,r=n.domc,o=n.em,i=r||o&&o.get('DomComponents');return i?i.componentsById:{}},N.checkId=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=(0,d.isArray)(t)?t:[t],i=r.keepIds,a=void 0===i?[]:i;o.forEach((function(t){var o=t.attributes,i=void 0===o?{}:o,s=t.components,l=i.id;if(l&&n[l]&&a.indexOf(l)<0){var c=N.getIncrementId(l,n);i.id=c,(0,d.isArray)(e)&&e.forEach((function(t){var e=t.selectors;e.forEach((function(t,n){t==="#".concat(l)&&(e[n]="#".concat(c))}))}))}s&&N.checkId(s,e,n,r)}))}},8431:(t,e,n)=>{"use strict";n.d(e,{Z:()=>C});var r=n(1002),o=n(2982),i=n(5671),a=n(3144),s=n(7326),l=n(9340),c=n(2963),u=n(1120),p=n(4942),f=n(4925),d=n(2316),h=n.n(d),g=n(9050),v=n(9138),m=["id","draggable"],y=["at"];function b(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,u.Z)(t);if(e){var o=(0,u.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,c.Z)(this,n)}}function w(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function _(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:[];if(!e)return[];var r=(0,g.isArray)(e)||(0,g.isFunction)(e.map)?e:[e];return r.map((function(e){n.push(e.getId()),t(e.components().models,n)})),n},O=function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r.visitedCmps=r.visitedCmps||{};var o=r.visitedCmps,i=(0,g.isArray)(e)?e:[e];return i.map((function(e){var i=e.attributes,a=void 0===i?{}:i,s=e.components,l=e.tagName,c=a.id,u=(a.draggable,(0,f.Z)(a,m)),p=e;if(c&&(o[c]?(o[c].push(p),c=v.ZP.getNewId(n),p.attributes.id=c):(o[c]=[],n[c]&&(p=n[c],l&&p.set({tagName:l},_(_({},r),{},{silent:!0})),(0,g.keys)(u).length&&p.addAttributes(u,_({},r))))),s){var d=t(s,n);if((0,g.isFunction)(p.components)){var h=p.components();h.length>0&&h.reset(d,r)}else p.components=d}return p}))},C=function(t){(0,l.Z)(n,t);var e=b(n);function n(){var t;(0,i.Z)(this,n);for(var r=arguments.length,o=new Array(r),a=0;a1&&void 0!==arguments[1]?arguments[1]:{};this.opt=e,this.listenTo(this,'add',this.onAdd),this.listenTo(this,'remove',this.removeChildren),this.listenTo(this,'reset',this.resetChildren);var n=e.em,r=e.config;this.config=r,this.em=n,this.domc=e.domc||n&&n.get('DomComponents')}},{key:"resetChildren",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this,o=n.previousModels||[],i=o.filter((function(e){return!t.get(e.cid)})),a=x(t);n.keepIds=x(o).filter((function(t){return a.indexOf(t)>=0})),i.forEach((function(t){return e.removeChildren(t,r,n)})),t.each((function(t){return e.onAdd(t)}))}},{key:"resetFromString",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'',e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.keepIds=x(this);var n=this.domc,r=this.em,o=this.parent,i=null==r?void 0:r.get('CssComposer'),a=(null==n?void 0:n.allById())||{},s=this.parseString(t,e),l=O(s,a,e),c=e.visitedCmps,u=void 0===c?{}:c;Object.keys(u).forEach((function(t){var e=u[t];if(e.length){var n=(null==i?void 0:i.getRules("#".concat(t)))||[];n.length&&e.forEach((function(t){n.forEach((function(e){var n=e.clone();n.set('selectors',["#".concat(t.attributes.id)]),i.getAll().add(n)}))}))}})),this.reset(l,e),null==r||r.trigger('component:content',o,e,t)}},{key:"removeChildren",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(t){var o=this.domc,i=this.em,a=r.temporary||r.fromUndo;if(t.prevColl=this,!a){var s=t.getId(),l=i.get('SelectorManager').getAll(),c=i.get('CssComposer').getAll(),u=(r.keepIds||[]).indexOf(s)<0,p=o?o.allById():{};delete p[s];var f=u?c.remove(c.filter((function(t){return t.getSelectors().getFullString()==="#".concat(s)})),r):[];l.remove(f.map((function(t){return t.getSelectors().at(0)}))),t.opt.temporary||(i.get('Commands').run('core:component-style-clear',{target:t}),t.removed(),t.trigger('removed'),i.trigger('component:remove',t));var d=t.components();d.forEach((function(t){return n.removeChildren(t,e,r)}))}var h=t.components();i.stopListening(h),i.stopListening(t),i.stopListening(t.get('classes')),t.__postRemove()}}},{key:"model",value:function(t,e){var n,r=e.collection.opt,o=r.em,i=o.get('DomComponents').componentTypes;e.em=o,e.config=r.config,e.componentTypes=i,e.domc=r.domc;for(var a=0;a1&&void 0!==arguments[1]?arguments[1]:{},n=this.em,r=this.domc,o=n.get('CssComposer'),i=n.get('Parser').parseHtml(t);if(v.ZP.checkId(i.html,i.css,r.componentsById,e),i.css&&o&&!e.temporary){e.at;var a=(0,f.Z)(e,y);o.addCollection(i.css,_(_({},a),{},{extend:1}))}return i.html}},{key:"add",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n.keepIds=[].concat((0,o.Z)(n.keepIds||[]),(0,o.Z)(x(n.previousModels))),(0,g.isString)(t)?t=this.parseString(t,n):(0,g.isArray)(t)&&(t=(0,o.Z)(t)).forEach((function(r,o){if((0,g.isString)(r)){var i=e.parseString(r,n);t[o]=(0,g.isArray)(i)&&!i.length?null:i}}));var r=(0,g.isArray)(t);t=(r?t:[t]).filter((function(t){return t})).map((function(t){return e.processDef(t)})),t=r?(0,g.flatten)(t,1):t[0];var i=h().Collection.prototype.add.apply(this,[t,n]);return this.__firstAdd=i,i}},{key:"processDef",value:function(t){if(t.cid&&t.ccid)return t;var e=this.em,n=this.config,o=(void 0===n?{}:n).processor,i=t;if(o){var a=o(i=_({},i));a&&((0,g.each)(i,(function(t,e){return delete i[e]})),(0,g.extend)(i,a))}if(i.$$typeof&&'object'==(0,r.Z)(i.props)){(i=_({},i)).props=_({},i.props);var s=e.get('DomComponents'),l=e.get('Parser').parserHtml;(0,g.each)(i,(function(t,e){(0,g.includes)(['props','type'],e)||delete i[e]}));var c=i.props,u=c.children;delete c.children,delete i.props;var p=l.splitPropsFromAttr(c);i.attributes=p.attrs,u&&(i.components=u),i.type?s.getType(i.type)||(i.tagName=i.type,delete i.type):i.type='textnode',(0,g.extend)(i,p.props)}return i}},{key:"onAdd",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.domc,o=this.em,i=t.getStyle(),a=o&&o.getConfig().avoidInlineStyle;if(r&&r.Component.ensureInList(t),!(0,g.isEmpty)(i)&&!a&&o&&o.get&&o.getConfig().forceClass&&!n.temporary){var s=t.cid;o.get('CssComposer').setClassRule(s,i);t.setStyle({}),t.addClass(s)}t.__postAdd({recursive:1}),this.__onAddEnd()}}]),n}(h().Collection)},2169:(t,e,n)=>{"use strict";n.d(e,{Z:()=>w});var r=n(4942),o=n(5671),i=n(3144),a=n(9340),s=n(2963),l=n(1120),c=n(2316),u=n.n(c),p=n(9050),f=n(8431),d=n(3505),h=n(966),g=n(8491),v=n(1163);function m(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function y(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{},e=this.model,n=t.config||{},r=n.em,o=e.opt||{},i=this.$el,a=this.el;this.opts=t,this.modelOpt=o,this.config=n,this.em=r||'',this.pfx=n.stylePrefix||'',this.ppfx=n.pStylePrefix||'',this.attr=e.get('attributes'),this.classe=this.attr.class||[],this.listenTo(e,'change:style',this.updateStyle),this.listenTo(e,'change:attributes',this.renderAttributes),this.listenTo(e,'change:highlightable',this.updateHighlight),this.listenTo(e,'change:status change:locked',this.updateStatus),this.listenTo(e,'change:script rerender',this.reset),this.listenTo(e,'change:content',this.updateContent),this.listenTo(e,'change',this.handleChange),this.listenTo(e,'active',this.onActive),this.listenTo(e,'disable',this.onDisable),i.data('model',e),(0,v.setViewEl)(a,this),e.view=this,this._getFrame()&&e.views.push(this),this.initClasses(),this.initComponents({avoidRender:1}),this.events=y(y({},this.constructor.getEvents()),{},{dragstart:'handleDragStart'}),this.delegateEvents(),!o.temporary&&this.init(this._clbObj())}},{key:"__isDraggable",value:function(){var t=this.model,e=this.config,n=t.attributes.draggable;return e.draggableComponents&&n}},{key:"_clbObj",value:function(){var t=this.em,e=this.model,n=this.el;return{editor:t&&t.getEditor(),model:e,el:n}}},{key:"init",value:function(){}},{key:"removed",value:function(){}},{key:"onActive",value:function(){}},{key:"onDisable",value:function(){}},{key:"remove",value:function(){var t;u().View.prototype.remove.apply(this,arguments);var e=this.model,n=this.$el,r=e.views,o=this._getFrame()||{};return e.components().forEach((function(t){var e=t.getView(o.model);null==e||e.remove()})),null===(t=this.childrenView)||void 0===t||t.remove(),r.splice(r.indexOf(this),1),this.removed(this._clbObj()),n.data({model:'',collection:'',view:''}),this}},{key:"handleDragStart",value:function(t){if(!this.__isDraggable())return!1;t.stopPropagation(),t.preventDefault(),this.em.get('Commands').run('tlb-move',{target:this.model,event:t})}},{key:"initClasses",value:function(){var t=this.model,e='change:classes',n=t.get('classes');n instanceof h.Z&&(this.stopListening(t,e,this.initClasses),this.listenTo(t,e,this.initClasses),this.listenTo(n,'add remove change',this.updateClasses),n.length&&this.importClasses())}},{key:"initComponents",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.model,n=this.$el,r=this.childrenView,o='change:components',i=e.get('components'),a=[e,o,this.initComponents];i instanceof f.Z&&(n.data('collection',i),r&&r.remove(),this.stopListening.apply(this,a),!t.avoidRender&&this.renderChildren(),this.listenTo.apply(this,a))}},{key:"handleChange",value:function(){var t=this.model,e=(0,p.keys)(t.changed);if(1!==e.length||'status'!==e[0])for(var n in t.emitUpdate(),t.changed)t.emitUpdate(n)}},{key:"importClasses",value:function(){var t=this.config.em.get('SelectorManager');t&&this.model.get('classes').each((function(e){t.add(e.get('name'))}))}},{key:"updateStatus",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.em,n=this.el,r=this.ppfx,o=this.model,i=e?e.get('Canvas').getConfig():{},a=i.extHl,s=o.get('status'),l="".concat(r,"selected"),c="".concat(l,"-parent"),u="".concat(r,"freezed"),p="".concat(r,"hovered"),f="".concat(r,"no-pointer"),d=[l,c,u,p,f],h=a&&!t.noExtHl?'':l;this.$el.removeClass(d.join(' '));var g=n.getAttribute('class')||'',v=[g];switch(s){case'selected':v.push(h);break;case'selected-parent':v.push(c);break;case'freezed':v.push(u);break;case'freezed-selected':v.push(u,h);break;case'hovered':!t.avoidHover&&v.push(p)}o.get('locked')&&v.push(f);var m=v.filter(Boolean).join(' ');m&&n.setAttribute('class',m)}},{key:"updateHighlight",value:function(){var t=this.model,e=t.get('textable'),n=t.get('highlightable')&&(e||!t.isChildOf('text'));this.setAttribute('data-gjs-highlightable',!!n||'')}},{key:"updateStyle",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.model,o=this.em;if(o&&o.getConfig().avoidInlineStyle&&!n.inline){var i=r.getStyle();!(0,p.isEmpty)(i)&&r.setStyle(i)}else this.setAttribute('style',r.styleToString(n))}},{key:"updateClasses",value:function(){var t=this.model.get('classes').pluck('name').join(' ');this.setAttribute('class',t),this.updateStatus(),this.onAttrUpdate()}},{key:"setAttribute",value:function(t,e){var n=this.$el;e?n.attr(t,e):n.removeAttr(t)}},{key:"getClasses",value:function(){return this.model.getClasses().join(' ')}},{key:"updateAttributes",value:function(){var t=[],e=this.model,n=this.$el,r=this.el,o=e.attributes,i=o.textable,a=o.type,s=y(y({id:e.getId(),'data-gjs-type':a||'default'},this.__isDraggable()&&{draggable:!0}),i&&{contenteditable:'false'});(0,p.each)(r.attributes,(function(e){return t.push(e.nodeName)})),t.forEach((function(t){return n.removeAttr(t)})),this.updateStyle(),this.updateHighlight();var l=y(y({},s),e.getAttributes());(0,p.keys)(l).forEach((function(t){return!1===l[t]&&delete l[t]})),n.attr(l)}},{key:"updateContent",value:function(){var t=this.model.get('content'),e=this.model.components().length;this.getChildrenContainer().innerHTML=e?'':t}},{key:"prevDef",value:function(t){t.preventDefault()}},{key:"updateScript",value:function(){var t=this.model,e=this.em;t.get('script')&&e&&e.get('Canvas').getCanvasView().updateScript(this)}},{key:"getChildrenContainer",value:function(){var t=this.el;return'function'==typeof this.getChildrenSelector?t=this.el.querySelector(this.getChildrenSelector()):this.getTemplate,t}},{key:"getOffsetRect",value:function(){var t={},e=this.el,n=0,r=0;return function o(i){var a=i.offsetParent;a?(n+=a.offsetTop,r+=a.offsetLeft,o(a)):(t.top=e.offsetTop+n,t.left=e.offsetLeft+r,t.bottom=t.top+e.offsetHeight,t.right=t.left+e.offsetWidth)}(e),t}},{key:"isInViewport",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.rect,n=this.el,r=n.ownerDocument,o=r.body,i=r.defaultView.frameElement,a=e||this.getOffsetRect(),s=a.top,l=a.left,c=this._getFrame().getOffsetRect();return s>=c.scrollTop&&l>=c.scrollLeft&&s<=c.scrollBottom&&l<=i.offsetWidth+o.scrollLeft}},{key:"scrollIntoView",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.getOffsetRect(),n=this.isInViewport({rect:e});if(!n||t.force){var r=this.el;'smooth'!==t.behavior?r.ownerDocument.defaultView.scrollTo(0,e.top):r.scrollIntoView(y({behavior:'smooth',block:'nearest'},t))}}},{key:"reset",value:function(){var t=this.el;this.el='',this._ensureElement(),this._setData(),(0,g.dL)(t,this.el),this.render()}},{key:"_setData",value:function(){var t=this.model,e=t.components();this.$el.data({model:t,collection:e,view:this})}},{key:"_getFrame",value:function(){var t;return null===(t=this.config.em)||void 0===t?void 0:t.get('Canvas').config.frameView}},{key:"renderChildren",value:function(){this.updateContent();var t=this.getChildrenContainer(),e=this.childrenView||new d.Z({collection:this.model.get('components'),config:this.config,componentTypes:this.opts.componentTypes});e.render(t),this.childrenView=e;for(var n=Array.prototype.slice.call(e.el.childNodes),r=0,o=n.length;r{"use strict";n.d(e,{Z:()=>d});var r=n(5671),o=n(3144),i=n(9340),a=n(2963),s=n(1120),l=n(2316),c=n.n(l),u=n(9050),p=n(8491);function f(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,s.Z)(t);if(e){var o=(0,s.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,a.Z)(this,n)}}var d=function(t){(0,i.Z)(a,t);var e=f(a);function a(){return(0,r.Z)(this,a),e.apply(this,arguments)}return(0,o.Z)(a,[{key:"initialize",value:function(t){this.opts=t||{},this.config=t.config||{},this.em=this.config.em;var e=this.collection;this.listenTo(e,'add',this.addTo),this.listenTo(e,'reset',this.resetChildren),this.listenTo(e,'remove',this.removeChildren)}},{key:"removeChildren",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t.views.forEach((function(t){if(t){var e=t.childrenView,n=t.scriptContainer;e&&e.stopListening(),(0,p.L_)(n),t.remove.apply(t)}}));var o=t.components();o.forEach((function(t){return n.removeChildren(t,e,r)}))}},{key:"addTo",value:function(t){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=this.config.em,r=this.collection.indexOf(t);if(this.addToCollection(t,null,r),n&&!e.temporary){var o=function t(e){n.trigger('component:add',e),e.components().forEach((function(e){return t(e)}))};o(t)}}},{key:"addToCollection",value:function(t,e,r){this.compView||(this.compView=n(2169).Z);for(var o=this.config,i=this.opts,a=this.em,s=e||null,l=o.frameView,c=void 0===l?{}:l,p=c.model&&t.getView(c.model),f=i.componentTypes||a&&a.get('DomComponents').getTypes(),d=t.get('type')||'default',h=this.compView,g=0;g1&&void 0!==arguments[1]?arguments[1]:{},r=n.previousModels,o=void 0===r?[]:r;this.parentEl.innerHTML='',o.forEach((function(t){return e.removeChildren(t,e.collection)})),t.each((function(t){return e.addToCollection(t)}))}},{key:"render",value:function(t){var e=this,n=this.el,r=document.createDocumentFragment();return this.parentEl=t||this.el,this.collection.each((function(t){return e.addToCollection(t,r)})),n.innerHTML='',n.appendChild(r),this}}]),a}(c().View)},793:(t,e,n)=>{"use strict";n.d(e,{Z:()=>l});var r=n(4942),o=n(9050),i=n(2316);function a(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function s(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{},r=n.em;this.em=r,this.opts=n,this.model=function(){var t,n,o,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(i&&i.type){var l=e.getBaseType();t=(o=e.getType(i.type))?o.model:l.model,n=o?o.view:l.view}else{var c=e.recognizeType(i);t=(o=c.type).model,n=o.view,i=c.attributes}var u=new t(i,s(s({},a),{},{em:r}));return u.typeView=n,u};var o=this.init&&this.init.bind(this);o&&o()},recognizeType:function(t){for(var e=this.getTypes(),n=0;n{"use strict";n.d(e,{Z:()=>f});var r=n(5671),o=n(3144),i=n(9340),a=n(2963),s=n(1120),l=n(2316),c=n.n(l);function u(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,s.Z)(t);if(e){var o=(0,s.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,a.Z)(this,n)}}var p=c().$,f=function(t){(0,i.Z)(n,t);var e=u(n);function n(){var t,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,r.Z)(this,n),t=e.call(this,o);var i=o.ppfx||'';return t.opts=o,t.ppfx=i,t.em=o.target||{},!o.onChange&&t.listenTo(t.model,'change:value',t.handleModelChange),t}return(0,o.Z)(n,[{key:"template",value:function(){return" ")}},{key:"inputClass",value:function(){return"".concat(this.ppfx,"field")}},{key:"holderClass",value:function(){return"".concat(this.ppfx,"input-holder")}},{key:"elementUpdated",value:function(){this.model.trigger('el:change')}},{key:"setValue",value:function(t){var e=this.model,n=t||e.get('defaults'),r=this.getInputEl();r&&(r.value=n)}},{key:"handleModelChange",value:function(t,e,n){this.setValue(e,n)}},{key:"handleChange",value:function(t){t.stopPropagation();var e=this.getInputEl().value;this.__onInputChange(e),this.elementUpdated()}},{key:"__onInputChange",value:function(t){this.model.set({value:t},{fromInput:1})}},{key:"getInputEl",value:function(){if(!this.inputEl){var t=this.model,e=this.opts.type||'text',n=t.get('placeholder')||t.get('defaults')||t.get('default')||'';this.inputEl=p(" "))}return this.inputEl.get(0)}},{key:"render",value:function(){this.inputEl=null;var t=this.$el;return t.addClass(this.inputClass()),t.html(this.template()),t.find(".".concat(this.holderClass())).append(this.getInputEl()),this}}]),n}(c().View);f.prototype.events={change:'handleChange'}},8767:(t,e,n)=>{"use strict";n.d(e,{Z:()=>b});var r=n(4942),o=n(5671),i=n(3144),a=n(9340),s=n(2963),l=n(1120),c=n(2316),u=n.n(c),p=n(9050),f=n(1163);var d=n(8659);function h(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function g(t){for(var e=1;e","","▼
",' '].join(''),s=function(){var t='';if(o)for(var e=1;e<=6;e++)t+="
";return["'].join('')}(),l='spectrum.id';t.fn.spectrum=function(e,n){if('string'==typeof e){var o=this,i=Array.prototype.slice.call(arguments,1);return this.each((function(){var n=r[t(this).data(l)];if(n){var a=n[e];if(!a)throw new Error("Spectrum: no such method: '"+e+"'");'get'==e?o=n.get():'container'==e?o=n.container:'option'==e?o=n.option.apply(n,i):'destroy'==e?(n.destroy(),t(this).removeData(l)):a.apply(n,i)}})),o}return this.spectrum('destroy').each((function(){var n=S(this,t.extend({},e,t(this).data()));t(this).data(l,n.id)}))},t.fn.spectrum.load=!0,t.fn.spectrum.loadOpts={},t.fn.spectrum.draggable=j,t.fn.spectrum.defaults=n,t.fn.spectrum.inputTypeColorSupport=function e(){if(void 0===e._cachedResult){var n=t(" ")[0];e._cachedResult='color'===n.type&&''!==n.value}return e._cachedResult},t.spectrum={},t.spectrum.localization={},t.spectrum.palettes={},t.fn.spectrum.processNativeColorInputs=function(){var e=t('input[type=color]');e.length&&!A()&&e.spectrum({preferredFormat:'hex6'})};var c=/^[\s,#]+/,u=/\s+$/,p=0,d=Math,h=d.round,g=d.min,v=d.max,m=d.random,y=function(t,e){if(e=e||{},(t=t||'')instanceof y)return t;if(!(this instanceof y))return new y(t,e);var n=function(t){var e={r:0,g:0,b:0},n=1,r=!1,o=!1;'string'==typeof t&&(t=function(t){t=t.replace(c,'').replace(u,'').toLowerCase();var e,n=!1;if(x[t])t=x[t],n=!0;else if('transparent'==t)return{r:0,g:0,b:0,a:0,format:'name'};if(e=C.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=C.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=C.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=C.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=C.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=C.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=C.hex8.exec(t))return{a:et(e[1]),r:J(e[2]),g:J(e[3]),b:J(e[4]),format:n?'name':'hex8'};if(e=C.hex6.exec(t))return{r:J(e[1]),g:J(e[2]),b:J(e[3]),format:n?'name':'hex'};if(e=C.hex3.exec(t))return{r:J(e[1]+''+e[1]),g:J(e[2]+''+e[2]),b:J(e[3]+''+e[3]),format:n?'name':'hex'};return!1}(t));'object'==typeof t&&(t.hasOwnProperty('r')&&t.hasOwnProperty('g')&&t.hasOwnProperty('b')?(i=t.r,a=t.g,s=t.b,e={r:255*Y(i,255),g:255*Y(a,255),b:255*Y(s,255)},r=!0,o='%'===String(t.r).substr(-1)?'prgb':'rgb'):t.hasOwnProperty('h')&&t.hasOwnProperty('s')&&t.hasOwnProperty('v')?(t.s=tt(t.s),t.v=tt(t.v),e=function(t,e,n){t=6*Y(t,360),e=Y(e,100),n=Y(n,100);var r=d.floor(t),o=t-r,i=n*(1-e),a=n*(1-o*e),s=n*(1-(1-o)*e),l=r%6;return{r:255*[n,a,i,i,s,n][l],g:255*[s,n,n,a,i,i][l],b:255*[i,i,s,n,n,a][l]}}(t.h,t.s,t.v),r=!0,o='hsv'):t.hasOwnProperty('h')&&t.hasOwnProperty('s')&&t.hasOwnProperty('l')&&(t.s=tt(t.s),t.l=tt(t.l),e=function(t,e,n){var r,o,i;function a(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}if(t=Y(t,360),e=Y(e,100),n=Y(n,100),0===e)r=o=i=n;else{var s=n<.5?n*(1+e):n+e-n*e,l=2*n-s;r=a(l,s,t+1/3),o=a(l,s,t),i=a(l,s,t-1/3)}return{r:255*r,g:255*o,b:255*i}}(t.h,t.s,t.l),r=!0,o='hsl'),t.hasOwnProperty('a')&&(n=t.a));var i,a,s;return n=K(n),{ok:r,format:t.format||o,r:g(255,v(e.r,0)),g:g(255,v(e.g,0)),b:g(255,v(e.b,0)),a:n}}(t);this._originalInput=t,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=h(100*this._a)/100,this._format=e.format||n.format,this._gradientType=e.gradientType,this._r<1&&(this._r=h(this._r)),this._g<1&&(this._g=h(this._g)),this._b<1&&(this._b=h(this._b)),this._ok=n.ok,this._tc_id=p++};y.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},setAlpha:function(t){return this._a=K(t),this._roundA=h(100*this._a)/100,this},toHsv:function(){var t=D(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=D(this._r,this._g,this._b),e=h(360*t.h),n=h(100*t.s),r=h(100*t.v);return 1==this._a?'hsv('+e+', '+n+'%, '+r+'%)':'hsva('+e+', '+n+'%, '+r+'%, '+this._roundA+')'},toHsl:function(){var t=M(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=M(this._r,this._g,this._b),e=h(360*t.h),n=h(100*t.s),r=h(100*t.l);return 1==this._a?'hsl('+e+', '+n+'%, '+r+'%)':'hsla('+e+', '+n+'%, '+r+'%, '+this._roundA+')'},toHex:function(t){return L(this._r,this._g,this._b,t)},toHexString:function(t){return'#'+this.toHex(t)},toHex8:function(){return R(this._r,this._g,this._b,this._a)},toHex8String:function(){return'#'+this.toHex8()},toRgb:function(){return{r:h(this._r),g:h(this._g),b:h(this._b),a:this._a}},toRgbString:function(){return 1==this._a?'rgb('+h(this._r)+', '+h(this._g)+', '+h(this._b)+')':'rgba('+h(this._r)+', '+h(this._g)+', '+h(this._b)+', '+this._roundA+')'},toPercentageRgb:function(){return{r:h(100*Y(this._r,255))+'%',g:h(100*Y(this._g,255))+'%',b:h(100*Y(this._b,255))+'%',a:this._a}},toPercentageRgbString:function(){return 1==this._a?'rgb('+h(100*Y(this._r,255))+'%, '+h(100*Y(this._g,255))+'%, '+h(100*Y(this._b,255))+'%)':'rgba('+h(100*Y(this._r,255))+'%, '+h(100*Y(this._g,255))+'%, '+h(100*Y(this._b,255))+'%, '+this._roundA+')'},toName:function(){return 0===this._a?'transparent':!(this._a<1)&&(O[L(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e='#'+R(this._r,this._g,this._b,this._a),n=e,r=this._gradientType?'GradientType = 1, ':'';t&&(n=y(t).toHex8String());return'progid:DXImageTransform.Microsoft.gradient('+r+'startColorstr='+e+',endColorstr='+n+')'},toString:function(t){var e=!!t;t=t||this._format;var n=!1,r=this._a<1&&this._a>=0;return e||!r||'hex'!==t&&'hex6'!==t&&'hex3'!==t&&'name'!==t?('rgb'===t&&(n=this.toRgbString()),'prgb'===t&&(n=this.toPercentageRgbString()),'hex'!==t&&'hex6'!==t||(n=this.toHexString()),'hex3'===t&&(n=this.toHexString(!0)),'hex8'===t&&(n=this.toHex8String()),'name'===t&&(n=this.toName()),'hsl'===t&&(n=this.toHslString()),'hsv'===t&&(n=this.toHsvString()),n||this.toHexString()):'name'===t&&0===this._a?this.toName():this.toRgbString()},_applyModification:function(t,e){var n=t.apply(null,[this].concat([].slice.call(e)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(F,arguments)},brighten:function(){return this._applyModification(V,arguments)},darken:function(){return this._applyModification(B,arguments)},desaturate:function(){return this._applyModification(Z,arguments)},saturate:function(){return this._applyModification(N,arguments)},greyscale:function(){return this._applyModification(I,arguments)},spin:function(){return this._applyModification(H,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(q,arguments)},complement:function(){return this._applyCombination(z,arguments)},monochromatic:function(){return this._applyCombination(G,arguments)},splitcomplement:function(){return this._applyCombination($,arguments)},triad:function(){return this._applyCombination(U,arguments)},tetrad:function(){return this._applyCombination(W,arguments)}},y.fromRatio=function(t,e){if('object'==typeof t){var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]='a'===r?t[r]:tt(t[r]));t=n}return y(t,e)},y.equals=function(t,e){return!(!t||!e)&&y(t).toRgbString()==y(e).toRgbString()},y.random=function(){return y.fromRatio({r:m(),g:m(),b:m()})},y.mix=function(t,e,n){n=0===n?0:n||50;var r,o=y(t).toRgb(),i=y(e).toRgb(),a=n/100,s=2*a-1,l=i.a-o.a,c=1-(r=((r=s*l==-1?s:(s+l)/(1+s*l))+1)/2),u={r:i.r*r+o.r*c,g:i.g*r+o.g*c,b:i.b*r+o.b*c,a:i.a*a+o.a*(1-a)};return y(u)},y.readability=function(t,e){var n=y(t),r=y(e),o=n.toRgb(),i=r.toRgb(),a=n.getBrightness(),s=r.getBrightness(),l=Math.max(o.r,i.r)-Math.min(o.r,i.r)+Math.max(o.g,i.g)-Math.min(o.g,i.g)+Math.max(o.b,i.b)-Math.min(o.b,i.b);return{brightness:Math.abs(a-s),color:l}},y.isReadable=function(t,e){var n=y.readability(t,e);return n.brightness>125&&n.color>500},y.mostReadable=function(t,e){for(var n=null,r=0,o=!1,i=0;i125&&a.color>500,l=3*(a.brightness/125)+a.color/500;(s&&!o||s&&o&&l>r||!s&&!o&&l>r)&&(o=s,r=l,n=y(e[i]))}return n};var b,w,_,x=y.names={aliceblue:'f0f8ff',antiquewhite:'faebd7',aqua:'0ff',aquamarine:'7fffd4',azure:'f0ffff',beige:'f5f5dc',bisque:'ffe4c4',black:'000',blanchedalmond:'ffebcd',blue:'00f',blueviolet:'8a2be2',brown:'a52a2a',burlywood:'deb887',burntsienna:'ea7e5d',cadetblue:'5f9ea0',chartreuse:'7fff00',chocolate:'d2691e',coral:'ff7f50',cornflowerblue:'6495ed',cornsilk:'fff8dc',crimson:'dc143c',cyan:'0ff',darkblue:'00008b',darkcyan:'008b8b',darkgoldenrod:'b8860b',darkgray:'a9a9a9',darkgreen:'006400',darkgrey:'a9a9a9',darkkhaki:'bdb76b',darkmagenta:'8b008b',darkolivegreen:'556b2f',darkorange:'ff8c00',darkorchid:'9932cc',darkred:'8b0000',darksalmon:'e9967a',darkseagreen:'8fbc8f',darkslateblue:'483d8b',darkslategray:'2f4f4f',darkslategrey:'2f4f4f',darkturquoise:'00ced1',darkviolet:'9400d3',deeppink:'ff1493',deepskyblue:'00bfff',dimgray:'696969',dimgrey:'696969',dodgerblue:'1e90ff',firebrick:'b22222',floralwhite:'fffaf0',forestgreen:'228b22',fuchsia:'f0f',gainsboro:'dcdcdc',ghostwhite:'f8f8ff',gold:'ffd700',goldenrod:'daa520',gray:'808080',green:'008000',greenyellow:'adff2f',grey:'808080',honeydew:'f0fff0',hotpink:'ff69b4',indianred:'cd5c5c',indigo:'4b0082',ivory:'fffff0',khaki:'f0e68c',lavender:'e6e6fa',lavenderblush:'fff0f5',lawngreen:'7cfc00',lemonchiffon:'fffacd',lightblue:'add8e6',lightcoral:'f08080',lightcyan:'e0ffff',lightgoldenrodyellow:'fafad2',lightgray:'d3d3d3',lightgreen:'90ee90',lightgrey:'d3d3d3',lightpink:'ffb6c1',lightsalmon:'ffa07a',lightseagreen:'20b2aa',lightskyblue:'87cefa',lightslategray:'789',lightslategrey:'789',lightsteelblue:'b0c4de',lightyellow:'ffffe0',lime:'0f0',limegreen:'32cd32',linen:'faf0e6',magenta:'f0f',maroon:'800000',mediumaquamarine:'66cdaa',mediumblue:'0000cd',mediumorchid:'ba55d3',mediumpurple:'9370db',mediumseagreen:'3cb371',mediumslateblue:'7b68ee',mediumspringgreen:'00fa9a',mediumturquoise:'48d1cc',mediumvioletred:'c71585',midnightblue:'191970',mintcream:'f5fffa',mistyrose:'ffe4e1',moccasin:'ffe4b5',navajowhite:'ffdead',navy:'000080',oldlace:'fdf5e6',olive:'808000',olivedrab:'6b8e23',orange:'ffa500',orangered:'ff4500',orchid:'da70d6',palegoldenrod:'eee8aa',palegreen:'98fb98',paleturquoise:'afeeee',palevioletred:'db7093',papayawhip:'ffefd5',peachpuff:'ffdab9',peru:'cd853f',pink:'ffc0cb',plum:'dda0dd',powderblue:'b0e0e6',purple:'800080',rebeccapurple:'663399',red:'f00',rosybrown:'bc8f8f',royalblue:'4169e1',saddlebrown:'8b4513',salmon:'fa8072',sandybrown:'f4a460',seagreen:'2e8b57',seashell:'fff5ee',sienna:'a0522d',silver:'c0c0c0',skyblue:'87ceeb',slateblue:'6a5acd',slategray:'708090',slategrey:'708090',snow:'fffafa',springgreen:'00ff7f',steelblue:'4682b4',tan:'d2b48c',teal:'008080',thistle:'d8bfd8',tomato:'ff6347',turquoise:'40e0d0',violet:'ee82ee',wheat:'f5deb3',white:'fff',whitesmoke:'f5f5f5',yellow:'ff0',yellowgreen:'9acd32'},O=y.hexNames=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}(x),C=(w='[\\s|\\(]+('+(b='(?:'+'[-\\+]?\\d*\\.\\d+%?'+')|(?:'+'[-\\+]?\\d+%?'+')')+')[,|\\s]+('+b+')[,|\\s]+('+b+')\\s*\\)?',_='[\\s|\\(]+('+b+')[,|\\s]+('+b+')[,|\\s]+('+b+')[,|\\s]+('+b+')\\s*\\)?',{rgb:new RegExp('rgb'+w),rgba:new RegExp('rgba'+_),hsl:new RegExp('hsl'+w),hsla:new RegExp('hsla'+_),hsv:new RegExp('hsv'+w),hsva:new RegExp('hsva'+_),hex3:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex8:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});window.tinycolor=y,t((function(){t.fn.spectrum.load&&t.fn.spectrum.processNativeColorInputs()}))}function k(e,n,r,o){for(var a=[],s=0;s ')}else{a.push(t('
').append(t(' ').attr('title',o.noColorSelectedText)).html())}}return""+a.join('')+'
'}function S(l,c){var u,p,f,d,h=function(e,r){var o=t.extend({},n,e);return o.callbacks={move:E(o.move,r),change:E(o.change,r),show:E(o.show,r),hide:E(o.hide,r),beforeShow:E(o.beforeShow,r)},o}(c,l),g=h.flat,v=h.showSelectionPalette,m=h.localStorageKey,b=h.theme,w=h.callbacks,_=(u=Wt,p=10,function(){var t=this,e=arguments,n=function(){d=null,u.apply(t,e)};f&&clearTimeout(d),!f&&d||(d=setTimeout(n,p))}),x=!1,O=!1,C=!0,S=0,P=0,M=0,D=0,L=0,R=0,Z=0,N=0,I=0,F=0,V=1,B=[],H=[],z={},U=h.selectionPalette.slice(0),W=h.maxSelectionSize,$='sp-dragging',q=null,G=l.ownerDocument,K=(G.body,t(l)),Y=!1,X=t(s,G).addClass(b),J=X.find('.sp-picker-container'),Q=X.find('.sp-color'),tt=X.find('.sp-dragger'),et=X.find('.sp-hue'),nt=X.find('.sp-slider'),rt=X.find('.sp-alpha-inner'),ot=X.find('.sp-alpha'),it=X.find('.sp-alpha-handle'),at=X.find('.sp-input'),st=X.find('.sp-palette'),lt=X.find('.sp-initial'),ct=X.find('.sp-cancel'),ut=X.find('.sp-clear'),pt=X.find('.sp-choose'),ft=X.find('.sp-palette-toggle'),dt=K.is('input'),ht=dt&&'color'===K.attr('type')&&A(),gt=dt&&!g,vt=gt?t(a).addClass(b).addClass(h.className).addClass(h.replacerClassName):t([]),mt=gt?vt:K,yt=vt.find('.sp-preview-inner'),bt=h.color||dt&&K.val(),wt=!1,_t=h.preferredFormat,xt=!h.showButtons||h.clickoutFiresChange,Ot=!bt,Ct=h.allowEmpty&&!ht;function kt(){if(h.showPaletteOnly&&(h.showPalette=!0),ft.text(h.showPaletteOnly?h.togglePaletteMoreText:h.togglePaletteLessText),h.palette){B=h.palette.slice(0),H=t.isArray(B[0])?B:[B],z={};for(var e=0;e1&&(delete window.localStorage[m],t.each(e,(function(t,e){Pt(e)})))}catch(t){}try{U=window.localStorage[m].split(';')}catch(t){}}}function Pt(e){if(v){var n=y(e).toRgbString();if(!z[n]&&-1===t.inArray(n,U))for(U.push(n);U.length>W;)U.shift();if(m&&window.localStorage)try{window.localStorage[m]=U.join(';')}catch(t){}}}function Tt(){var e=Vt(),n=t.map(H,(function(t,n){return k(t,e,'sp-palette-row sp-palette-row-'+n,h)}));St(),U&&n.push(k(function(){var t=[];if(h.showPalette)for(var e=0;ed&&d>o?Math.abs(g.left+o-d):0),g.top-=Math.min(g.top,g.top+i>h&&h>i?Math.abs(i+a-r):r),g}(X,mt))),zt(),h.showPalette&&Tt(),K.trigger('reflow.spectrum'))}function $t(){Nt(),Y=!0,K.attr('disabled',!0),mt.addClass('sp-disabled')}!function(){if(o&&X.find('*:not(input)').attr('unselectable','on'),kt(),gt&&K.after(vt).hide(),Ct||ut.hide(),g)K.after(X).hide();else{var e='parent'===h.appendTo?K.parent():t(h.appendTo);1!==e.length&&(e=t('body')),e.append(X)}function n(e){return e.data&&e.data.ignore?(Ft(t(e.target).closest('.sp-thumb-el').data('color')),Bt()):(Ft(t(e.target).closest('.sp-thumb-el').data('color')),Bt(),h.hideAfterPaletteSelect&&(Ut(!0),Nt())),!1}St(),mt.bind('click.spectrum touchstart.spectrum',(function(e){Y||Dt(),e.stopPropagation(),t(e.target).is('input')||e.preventDefault()})),(K.is(':disabled')||!0===h.disabled)&&$t(),X.click(T),at.change(Mt),at.bind('paste',(function(){setTimeout(Mt,1)})),at.keydown((function(t){13==t.keyCode&&Mt()})),ct.text(h.cancelText),ct.bind('click.spectrum',(function(t){t.stopPropagation(),t.preventDefault(),It(),Nt()})),ut.attr('title',h.clearText),ut.bind('click.spectrum',(function(t){t.stopPropagation(),t.preventDefault(),Ot=!0,Bt(),g&&Ut(!0)})),pt.text(h.chooseText),pt.bind('click.spectrum',(function(t){t.stopPropagation(),t.preventDefault(),o&&at.is(':focus')&&at.trigger('change'),at.hasClass('sp-validation-error')||(Ut(!0),Nt())})),ft.text(h.showPaletteOnly?h.togglePaletteMoreText:h.togglePaletteLessText),ft.bind('click.spectrum',(function(t){t.stopPropagation(),t.preventDefault(),h.showPaletteOnly=!h.showPaletteOnly,h.showPaletteOnly||g||X.css('left','-='+(J.outerWidth(!0)+5)),kt()})),j(ot,(function(t,e,n){V=t/L,Ot=!1,n.shiftKey&&(V=Math.round(10*V)/10),Bt()}),jt,At),j(et,(function(t,e){N=parseFloat(e/D),Ot=!1,h.showAlpha||(V=1),Bt()}),jt,At),j(Q,(function(t,e,n){if(n.shiftKey){if(!q){var r=I*S,o=P-F*P,i=Math.abs(t-r)>Math.abs(e-o);q=i?'x':'y'}}else q=null;var a=!q||'y'===q;(!q||'x'===q)&&(I=parseFloat(t/S)),a&&(F=parseFloat((P-e)/P)),Ot=!1,h.showAlpha||(V=1),Bt()}),jt,At),bt?(Ft(bt),Ht(),_t=h.preferredFormat||y(bt).getFormat(),Pt(bt)):Ht(),g&&Lt();var r=o?'mousedown.spectrum':'click.spectrum touchstart.spectrum';st.delegate('.sp-thumb-el',r,n),lt.delegate('.sp-thumb-el:nth-child(1)',r,{ignore:!0},n)}();var qt={show:Lt,hide:Nt,toggle:Dt,reflow:Wt,option:function(n,r){return n===e?t.extend({},h):r===e?h[n]:(h[n]=r,'preferredFormat'===n&&(_t=h.preferredFormat),void kt())},enable:function(){Y=!1,K.attr('disabled',!1),mt.removeClass('sp-disabled')},disable:$t,offset:function(t){h.offset=t,Wt()},set:function(t){Ft(t),Ut()},get:Vt,destroy:function(){K.show(),mt.unbind('click.spectrum touchstart.spectrum'),X.remove(),vt.remove(),r[qt.id]=null},container:X};return qt.id=r.push(qt)-1,qt}function P(){}function T(t){t.stopPropagation()}function E(t,e){var n=Array.prototype.slice,r=n.call(arguments,2);return function(){return t.apply(e,r.concat(n.call(arguments)))}}function j(e,n,r,i){n=n||function(){},r=r||function(){},i=i||function(){};var a=document,s=!1,l={},c=0,u=0,p='ontouchstart'in window,f={};function d(t){t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),t.returnValue=!1}function h(t){if(s){if(o&&a.documentMode<9&&!t.button)return g();var r=t&&t.touches&&t.touches[0],i=r&&r.pageX||t.pageX,f=r&&r.pageY||t.pageY,h=Math.max(0,Math.min(i-l.left,u)),v=Math.max(0,Math.min(f-l.top,c));p&&d(t),n.apply(e,[h,v,t])}}function g(){s&&(t(a).unbind(f),t(a.body).removeClass('sp-dragging'),setTimeout((function(){i.apply(e,arguments)}),0)),s=!1}f['selectstart']=d,f['dragstart']=d,f['touchmove mousemove']=h,f['touchend mouseup']=g,t(e).bind('touchstart mousedown',(function(n){var o=n.which?3==n.which:2==n.button;o||s||!1!==r.apply(e,arguments)&&(s=!0,c=t(e).height(),u=t(e).width(),l=t(e).offset(),t(a).bind(f),t(a.body).addClass('sp-dragging'),h(n),d(n))}))}function A(){return t.fn.spectrum.inputTypeColorSupport()}function M(t,e,n){t=Y(t,255),e=Y(e,255),n=Y(n,255);var r,o,i=v(t,e,n),a=g(t,e,n),s=(i+a)/2;if(i==a)r=o=0;else{var l=i-a;switch(o=s>.5?l/(2-i-a):l/(i+a),i){case t:r=(e-n)/l+(e>1)+720)%360;--e;)r.h=(r.h+o)%360,i.push(y(r));return i}function G(t,e){e=e||6;for(var n=y(t).toHsv(),r=n.h,o=n.s,i=n.v,a=[],s=1/e;e--;)a.push(y({h:r,s:o,v:i})),i=(i+s)%1;return a}function K(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function Y(t,e){(function(t){return'string'==typeof t&&-1!=t.indexOf('.')&&1===parseFloat(t)})(t)&&(t='100%');var n=function(t){return'string'==typeof t&&-1!=t.indexOf('%')}(t);return t=g(e,v(0,parseFloat(t))),n&&(t=parseInt(t*e,10)/100),d.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function X(t){return g(1,v(0,t))}function J(t){return parseInt(t,16)}function Q(t){return 1==t.length?'0'+t:''+t}function tt(t){return t<=1&&(t=100*t+'%'),t}function et(t){return J(t)/255}}(m);var y=function(t){var e='name'===t.getFormat()&&t.toName(),n=1==t.getAlpha()?t.toHexString():t.toRgbString();return e||n.replace(/ /g,'')},b=function(t){(0,a.Z)(n,t);var e=v(n);function n(){return(0,o.Z)(this,n),e.apply(this,arguments)}return(0,i.Z)(n,[{key:"template",value:function(){var t=this.ppfx;return"\n
\n \n ")}},{key:"inputClass",value:function(){var t=this.ppfx;return"".concat(t,"field ").concat(t,"field-color")}},{key:"holderClass",value:function(){return"".concat(this.ppfx,"input-holder")}},{key:"remove",value:function(){d.Z.prototype.remove.apply(this,arguments),this.colorEl.spectrum('destroy')}},{key:"handleChange",value:function(t){t.stopPropagation();var e=t.target.value;(0,p.isUndefined)(e)||this.__onInputChange(e)}},{key:"__onInputChange",value:function(t){var e=this.model,n=this.opts.onChange,r=t,o=this.getColorEl();if(o){o.spectrum('set',r);var i=o.spectrum('get'),a=r&&y(i);a&&(r=a)}n?n(r):e.set({value:r},{fromInput:1})}},{key:"setValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.model,r=(0,p.isUndefined)(e.def)?n.get('defaults'):e.def,o=(0,p.isUndefined)(t)?(0,p.isUndefined)(r)?'':r:t,i=this.getInputEl(),a=this.getColorEl(),s='none'!=o?o:'';i.value=o,a.get(0).style.backgroundColor=s,(e.fromTarget||e.fromInput&&!e.avoidStore)&&(a.spectrum('set',s),this.noneColor='none'==o,this.movedColor=s)}},{key:"getColorEl",value:function(){var t=this;if(!this.colorEl){var e=this.em,n=this.model,r=this.opts,o=this.ppfx,i=r.onChange,a=m("
")),s=a.get(0).style,l=e&&e.config?e.config.el:'',c=e&&e.getConfig&&e.getConfig().colorPicker||{};this.movedColor='';var u,p=!1;this.$el.find('[data-colorp-c]').append(a);var f=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];i?i(t,!e):(e&&n.setValueFromInput(0,!1),n.setValueFromInput(t,e))};a.spectrum(g(g(g({color:n.getValue()||!1,containerClassName:"".concat(o,"one-bg ").concat(o,"two-color"),appendTo:l||'body',maxSelectionSize:8,showPalette:!0,showAlpha:!0,chooseText:'Ok',cancelText:'⨯',palette:[]},c),n.get('colorPicker')||{}),{},{move:function(e){var n=y(e);t.movedColor=n,s.backgroundColor=n,f(n,!1)},change:function(e){p=!0;var n=y(e);s.backgroundColor=n,f(n),t.noneColor=0},show:function(e){p=!1,t.movedColor='',u=i?n.getValue({noDefault:!0}):y(e)},hide:function(){p||!u&&!i||(t.noneColor&&(u=''),s.backgroundColor=u,a.spectrum('set',u),f(u,!1))}})),e&&e.on&&this.listenTo(e,'component:selected',(function(){t.movedColor&&f(t.movedColor),p=!0,t.movedColor='',a.spectrum('hide')})),this.colorEl=a}return this.colorEl}},{key:"render",value:function(){return d.Z.prototype.render.call(this),this.getColorEl(),this}}]),n}(d.Z)},7610:(t,e,n)=>{"use strict";n.d(e,{Z:()=>g});var r=n(5671),o=n(3144),i=n(7326),a=n(9340),s=n(2963),l=n(1120),c=n(2316),u=n.n(c),p=n(9050),f=n(1163),d=n(8659);function h(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.Z)(t);if(e){var o=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,s.Z)(this,n)}}u().$;var g=function(t){(0,a.Z)(n,t);var e=h(n);function n(){var t,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,r.Z)(this,n),t=e.call(this,o),(0,p.bindAll)((0,i.Z)(t),'moveIncrement','upIncrement'),t.doc=document,t.listenTo(t.model,'change:unit',t.handleModelChange),t}return(0,o.Z)(n,[{key:"template",value:function(){var t=this.ppfx;return"\n \n \n \n ")}},{key:"inputClass",value:function(){var t=this.ppfx;return this.opts.contClass||"".concat(t,"field ").concat(t,"field-integer")}},{key:"setValue",value:function(t,e){var n=e||{},r=this.validateInputValue(t,{deepCheck:1}),o={value:r.value};(r.unit||r.force)&&(o.unit=r.unit),this.model.set(o,n),n.silent&&this.handleModelChange()}},{key:"handleChange",value:function(t){t.stopPropagation(),this.setValue(this.getInputEl().value),this.elementUpdated()}},{key:"handleUnitChange",value:function(t){t.stopPropagation();var e=this.getUnitEl().value;this.model.set('unit',e),this.elementUpdated()}},{key:"handleKeyDown",value:function(t){'ArrowUp'===t.key&&(t.preventDefault(),this.upArrowClick()),'ArrowDown'===t.key&&(t.preventDefault(),this.downArrowClick())}},{key:"elementUpdated",value:function(){this.model.trigger('el:change')}},{key:"handleModelChange",value:function(){var t=this.model;this.getInputEl().value=t.get('value');var e=this.getUnitEl();e&&(e.value=t.get('unit')||'')}},{key:"getUnitEl",value:function(){if(!this.unitEl){var t=this.model,e=t.get('units')||[];if(e.length){var n=['- '];e.forEach((function(e){var r=e==t.get('unit')?'selected':'';n.push("").concat(e," "))}));var r=document.createElement('div');r.innerHTML="").concat(n.join('')," "),this.unitEl=r.firstChild}}return this.unitEl}},{key:"upArrowClick",value:function(){var t=this.model,e=t.get('step'),n=parseFloat(t.get('value'));this.setValue(this.normalizeValue(n+e)),this.elementUpdated()}},{key:"downArrowClick",value:function(){var t=this.model,e=t.get('step'),n=parseFloat(t.get('value'));this.setValue(this.normalizeValue(n-e)),this.elementUpdated()}},{key:"downIncrement",value:function(t){t.preventDefault(),this.moved=0;var e=this.model.get('value')||0;e=this.normalizeValue(e),this.current={y:t.pageY,val:e},(0,f.on)(this.doc,'mousemove',this.moveIncrement),(0,f.on)(this.doc,'mouseup',this.upIncrement)}},{key:"moveIncrement",value:function(t){this.moved=1;var e=this.model,n=e.get('step'),r=this.current,o=this.normalizeValue(r.val+(r.y-t.pageY)*n),i=this.validateInputValue(o),a=i.value,s=i.unit;return this.prValue=a,e.set({value:a,unit:s},{avoidStore:1}),!1}},{key:"upIncrement",value:function(){var t=this.model,e=t.get('step');if((0,f.off)(this.doc,'mouseup',this.upIncrement),(0,f.off)(this.doc,'mousemove',this.moveIncrement),this.prValue&&this.moved){var n=this.prValue-e;t.set('value',n,{avoidStore:1}).set('value',n+e),this.elementUpdated()}}},{key:"normalizeValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.model,r=n.get('step'),o=0;if(isNaN(t))return e;if(t=parseFloat(t),Math.floor(t)!==t){var i=r.toString().split('.')[1];o=i?i.length:0}return o?parseFloat(t.toFixed(o)):t}},{key:"validateInputValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=0,r=e||{},o=this.model,i='',a=(0,p.isUndefined)(t)?i:t,s=e.units||o.get('units')||[],l=o.get('unit')||s.length&&s[0]||'',c=(0,p.isUndefined)(e.max)?o.get('max'):e.max,u=(0,p.isUndefined)(e.min)?o.get('min'):e.min,f=!!o.get('limitlessMax'),d=!!o.get('limitlessMin');if(r.deepCheck){var h=o.get('fixedValues')||[];if(''===a&&(l=''),a){var g=new RegExp('^'+h.join('|'),'g');if(h.length&&g.test(a))a=a.match(g)[0],l='',n=1;else{var v=a+'';a+='',a=parseFloat(a.replace(',','.')),a=isNaN(a)?i:a;var m=v.replace(a,'');(0,p.indexOf)(s,m)>=0&&(l=m)}}}return f||(0,p.isUndefined)(c)||''===c||(a=a>c?c:a),d||(0,p.isUndefined)(u)||''===u||(a=a{"use strict";n.d(e,{Z:()=>h});var r=n(5671),o=n(3144),i=n(7326),a=n(9340),s=n(2963),l=n(1120),c=n(4942),u=n(9050),p=n(2316),f=n.n(p);function d(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,l.Z)(t);if(e){var o=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,s.Z)(this,n)}}var h=function(t){(0,a.Z)(n,t);var e=d(n);function n(){var t,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0,s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,r.Z)(this,n),t=e.call(this,o),(0,c.Z)((0,i.Z)(t),"itemsView",''),(0,c.Z)((0,i.Z)(t),"itemType",'type'),(0,c.Z)((0,i.Z)(t),"reuseView",!1),t.config=a||o.config||{},s&&t.listenTo(t.collection,'add',t.addTo),t.items=[],t}return(0,o.Z)(n,[{key:"addTo",value:function(t){this.add(t)}},{key:"itemViewNotFound",value:function(t){var e=this.config,n=this.ns,r=e.em,o="".concat(n?"[".concat(n,"]: "):'',"'").concat(t,"' type not found");r&&r.logWarning(o)}},{key:"add",value:function(t,e){var n,r=this.config,o=this.reuseView,i=this.items,a=this.itemsView,s=void 0===a?{}:a,l=e||null,c=this.itemView,p=t.get(this.itemType);s[p]?c=s[p]:!p||s[p]||(0,u.includes)(['button','checkbox','color','date','datetime-local','email','file','hidden','image','month','number','password','radio','range','reset','search','submit','tel','text','time','url','week'],p)||this.itemViewNotFound(p),n=t.view&&o?t.view:new c({model:t,config:r},r),i&&i.push(n);var f=n.render().el;l?l.appendChild(f):this.$el.append(f)}},{key:"render",value:function(){var t=document.createDocumentFragment();return this.clearItems(),this.$el.empty(),this.collection.length&&this.collection.each((function(e){this.add(e,t)}),this),this.$el.append(t),this.onRender(),this}},{key:"onRender",value:function(){}},{key:"onRemoveBefore",value:function(){}},{key:"onRemove",value:function(){}},{key:"remove",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.items;this.onRemoveBefore(e,t),this.clearItems(),f().View.prototype.remove.apply(this,arguments),this.onRemove(e,t)}},{key:"clearItems",value:function(){this.items}}]),n}(f().View);h.prototype.itemView=''},4859:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>A});var r=n(5861),o=n(5671),i=n(3144),a=n(7326),s=n(9340),l=n(2963),c=n(1120),u=n(4942),p=n(4687),f=n.n(p),d=n(9714);const h={id:'gjs-',type:'local',autosave:!0,autoload:!0,recovery:!1,stepsBeforeSave:1,onStore:function(t){return t},onLoad:function(t){return t},options:{local:{key:'gjsProject',checkLocal:!0},remote:{headers:{},urlStore:'',urlLoad:'',contentTypeJson:!0,fetchOptions:'',credentials:'include',onStore:function(t){return t},onLoad:function(t){return t}}}};var g=n(1163),v=function(){function t(){(0,o.Z)(this,t)}var e,n;return(0,i.Z)(t,[{key:"store",value:(n=(0,r.Z)(f().mark((function t(e){var n,r=arguments;return f().wrap((function(t){for(;1;)switch(t.prev=t.next){case 0:n=r.length>1&&void 0!==r[1]?r[1]:{},this.hasLocal(n,!0)&&localStorage.setItem(n.key,JSON.stringify(e));case 2:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:"load",value:(e=(0,r.Z)(f().mark((function t(){var e,n,r=arguments;return f().wrap((function(t){for(;1;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},n={},this.hasLocal(e,!0)&&(n=JSON.parse(localStorage.getItem(e.key)||'{}')),t.abrupt("return",n);case 4:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"hasLocal",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;if(t.checkLocal&&(!(0,g.hasWin)()||!localStorage)){if(e)throw new Error('localStorage not available');return!1}return!0}}]),t}(),m=n(9050),y=n(6062);function b(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function w(t){for(var e=1;e1&&void 0!==r[1]?r[1]:{},t.next=3,this.request(n.urlStore,this.__props(n,e),n);case 3:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:"load",value:(e=(0,r.Z)(f().mark((function t(e){return f().wrap((function(t){for(;1;)switch(t.prev=t.next){case 0:return t.next=2,this.request(e.urlLoad,this.__props(e),e);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"request",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return(0,y.Z)(t,e).then((function(t){var e=t.text();return 1==(t.status/200|0)?e:e.then(Promise.reject)})).then((function(t){var e=t&&(0,m.isString)(t);return n.contentTypeJson&&e?JSON.parse(t):t}))}},{key:"__props",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=e.contentTypeJson,o=e.headers||{},i=e.fetchOptions||{},a='X-Requested-With',s='Content-Type';if((0,m.isUndefined)(o[a])&&(o[a]='XMLHttpRequest'),(0,m.isUndefined)(o[s])&&r&&(o[s]='application/json; charset=utf-8'),n)if(r)t=JSON.stringify(n);else for(var l in t=new FormData,n)t.append(l,n[l]);var c={method:t?'POST':'GET',credentials:e.credentials,headers:o,body:t};return w(w({},c),(0,m.isFunction)(i)?i(c):i)}}]),t}();function x(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function O(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};this.__initConfig(h,t);var e=this.getConfig();return e._disable&&(e.type=0),this.storages={},this.add(E,new v(e)),this.add(j,new _(e)),this.setCurrent(e.type),this}},{key:"isAutosave",value:function(){return!!this.getConfig().autosave}},{key:"setAutosave",value:function(t){return this.getConfig().autosave=!!t,this}},{key:"getStepsBeforeSave",value:function(){return this.getConfig().stepsBeforeSave}},{key:"setStepsBeforeSave",value:function(t){return this.getConfig().stepsBeforeSave=t,this}},{key:"add",value:function(t,e){return this.storages[t]=e,this}},{key:"get",value:function(t){return this.storages[t]||null}},{key:"getStorages",value:function(){return this.storages}},{key:"getCurrent",value:function(){return this.getConfig().currentStorage}},{key:"setCurrent",value:function(t){return this.getConfig().currentStorage=t,this}},{key:"getCurrentStorage",value:function(){return this.get(this.getCurrent())}},{key:"getStorageOptions",value:function(t){return this.getCurrentOptions(t)}},{key:"store",value:(l=(0,r.Z)(f().mark((function t(e){var n,r,o,i,a,s=arguments;return f().wrap((function(t){for(;1;)switch(t.prev=t.next){case 0:return n=s.length>1&&void 0!==s[1]?s[1]:{},r=this.getCurrentStorage(),o=O(O({},this.getCurrentOptions()),n),i=this.getRecoveryStorage(),a=this.getCurrentOptions(E),t.prev=5,t.next=8,this.__exec(r,o,e);case 8:if(t.t0=i,!t.t0){t.next=12;break}return t.next=12,this.__exec(i,a,{});case 12:case 19:t.next=22;break;case 14:if(t.prev=14,t.t1=t["catch"](5),!i){t.next=21;break}return t.next=19,this.__exec(i,a,e);case 21:throw t.t1;case 22:return t.abrupt("return",e);case 23:case"end":return t.stop()}}),t,this,[[5,14]])}))),function(t){return l.apply(this,arguments)})},{key:"load",value:(n=(0,r.Z)(f().mark((function t(){var e,n,r,o,i,a,s=arguments;return f().wrap((function(t){for(;1;)switch(t.prev=t.next){case 0:if(e=s.length>0&&void 0!==s[0]?s[0]:{},n=this.getCurrentStorage(),r=O(O({},this.getCurrentOptions()),e),!(o=this.getRecoveryStorage())){t.next=17;break}return t.next=7,this.__exec(o,this.getCurrentOptions(E));case 7:if(a=t.sent,(0,m.isEmpty)(a)){t.next=17;break}return t.prev=9,t.next=12,this.__askRecovery();case 12:i=a,t.next=17;break;case 15:t.prev=15,t.t0=t["catch"](9);case 17:if(i){t.next=21;break}return t.next=20,this.__exec(n,r);case 20:i=t.sent;case 21:return t.abrupt("return",i||{});case 22:case"end":return t.stop()}}),t,this,[[9,15]])}))),function(){return n.apply(this,arguments)})},{key:"__askRecovery",value:function(){var t=this.em,e=this.getRecovery();return new Promise((function(n,r){(0,m.isFunction)(e)?e(n,r,null==t?void 0:t.getEditor()):confirm(null==t?void 0:t.t('storageManager.recover'))?n():r()}))}},{key:"getRecovery",value:function(){return this.getConfig().recovery}},{key:"getRecoveryStorage",value:function(){return this.getRecovery()&&this.getCurrent()===j&&this.get(E)}},{key:"__exec",value:(e=(0,r.Z)(f().mark((function t(e,n,r){var o,i,a,s,l,c,u,p;return f().wrap((function(t){for(;1;)switch(t.prev=t.next){case 0:if(o=r?'store':'load',i=this.getConfig(),a=i.onStore,s=i.onLoad,this.onStart(o,r),e){t.next=5;break}return t.abrupt("return",r||{});case 5:if(t.prev=5,u=null===(c=this.em)||void 0===c?void 0:c.getEditor(),!r){t.next=31;break}if(t.t1=a,!t.t1){t.next=13;break}return t.next=12,a(r,u);case 12:t.t1=t.sent;case 13:if(t.t0=t.t1,t.t0){t.next=16;break}t.t0=r;case 16:if(p=t.t0,t.t3=n.onStore,!t.t3){t.next=22;break}return t.next=21,n.onStore(p,u);case 21:t.t3=t.sent;case 22:if(t.t2=t.t3,t.t2){t.next=25;break}t.t2=p;case 25:return p=t.t2,t.next=28,e.store(p,n);case 28:l=r,t.next=53;break;case 31:return t.next=33,e.load(n);case 33:if(l=t.sent,l=this.__clearKeys(l),t.t5=n.onLoad,!t.t5){t.next=40;break}return t.next=39,n.onLoad(l,u);case 39:t.t5=t.sent;case 40:if(t.t4=t.t5,t.t4){t.next=43;break}t.t4=l;case 43:if(l=t.t4,t.t7=s,!t.t7){t.next=49;break}return t.next=48,s(l,u);case 48:t.t7=t.sent;case 49:if(t.t6=t.t7,t.t6){t.next=52;break}t.t6=l;case 52:l=t.t6;case 53:this.onAfter(o,l),this.onEnd(o,l),t.next=61;break;case 57:throw t.prev=57,t.t8=t["catch"](5),this.onError(o,t.t8),t.t8;case 61:return t.abrupt("return",l);case 62:case"end":return t.stop()}}),t,this,[[5,57]])}))),function(t,n,r){return e.apply(this,arguments)})},{key:"__clearKeys",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.getConfig(),n=new RegExp("^".concat(e.id)),r={};for(var o in t){var i=o.replace(n,'');r[i]=t[o]}return r}},{key:"getCurrentOptions",value:function(t){var e=this.getConfig(),n=t||this.getCurrent();return e.options[n]||{}}},{key:"onStart",value:function(t,e){var n=this.em;n&&(n.trigger(k),t&&n.trigger("".concat(k,":").concat(t),e))}},{key:"onAfter",value:function(t,e){var n=this.em;n&&(n.trigger(S),n.trigger("".concat(S,":").concat(t),e),n.trigger("storage:".concat(t),e))}},{key:"onEnd",value:function(t,e){var n=this.em;n&&(n.trigger(P),t&&n.trigger("".concat(P,":").concat(t),e))}},{key:"onError",value:function(t,e){var n=this.em;n&&(n.trigger(T,e),t&&n.trigger("".concat(T,":").concat(t),e),this.onEnd(t,e))}},{key:"canAutoload",value:function(){return this.getCurrentStorage()&&this.getConfig().autoload}},{key:"destroy",value:function(){this.__destroy(),this.storages={}}}]),p}(d.Z)},5069:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>Se,evAll:()=>fe,evCustom:()=>Ce,evLayerSelect:()=>xe,evPfx:()=>de,evProp:()=>ye,evPropAdd:()=>be,evPropRemove:()=>we,evPropUp:()=>_e,evSector:()=>he,evSectorAdd:()=>ge,evSectorRemove:()=>ve,evSectorUpdate:()=>me,evTarget:()=>Oe});var r=n(2982),o=n(4942),i=n(9050),a=n(1163),s=n(9304),l=n(2316),c=n.n(l);const u={sectors:[{name:'General',open:!1,properties:['display','float','position','top','right','left','bottom']},{name:'Flex',open:!1,properties:['flex-direction','flex-wrap','justify-content','align-items','align-content','order','flex-basis','flex-grow','flex-shrink','align-self']},{name:'Dimension',open:!1,properties:['width','height','max-width','min-height','margin','padding']},{name:'Typography',open:!1,properties:['font-family','font-size','font-weight','letter-spacing','color','line-height','text-align','text-shadow']},{name:'Decorations',open:!1,properties:['background-color','border-radius','border','box-shadow','background']},{name:'Extra',open:!1,properties:['opacity','transition','transform']}],appendTo:'',stylePrefix:'sm-',custom:!1,hideNotStylable:!0,highlightChanged:!0,highlightComputed:!0,showComputed:!0,clearProperties:!0,avoidComputed:['width','height']};var p=n(4925),f=n(5671),d=n(3144),h=n(9340),g=n(2963),v=n(1120),m=n(793),y=["partial"];function b(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function w(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.em=e.em;var r=this.get('id')||'',o=this.get('name')||this.get('label')||'';!this.get('property')&&this.set('property',(o||r).replace(/ /g,'-'));var i=this.get('property');!this.get('id')&&this.set('id',i),!o&&this.set('name',(0,a.capitalize)(i).replace(/-/g,' ')),this.on('change',this.__upTargets),n.callInit(this,t,e)}},{key:"__getParentProp",value:function(){var t,e;return null===(t=this.collection)||void 0===t||null===(e=t.opts)||void 0===e?void 0:e.parentProp}},{key:"__upTargets",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=this.em,a=o.get('StyleManager'),s=this.getName(),l=n.__clear,c=l?'':this.__getFullValue(n),u=this.__getParentProp(),p=this.changedAttributes(),f=(0,i.keys)(p).reduce((function(t,n){return t[n]=e.previous(n),t}),{}),d=[].concat((0,r.Z)((0,i.keys)(this.__getClearProps())),['__p']),h=(0,i.keys)(p),g=!n.__up&&!u&&(l||d.some((function(t){return h.indexOf(t)>=0}))),v=this.get('onChange'),m={property:this,from:f,to:p,value:c,opts:n};a.__trgEv(a.events.propertyUpdate,m),v&&v(m),g&&this.__upTargetsStyle({[s]:c},n)}},{key:"__upTargetsStyle",value:function(t,e){var n,r=null===(n=this.em)||void 0===n?void 0:n.get('StyleManager');null==r||r.addStyleTargets(w(w({},t),{},{__p:!!e.avoidStore}),e)}},{key:"_up",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.noTarget&&(e.__up=!0);var n=e.partial,r=(0,p.Z)(e,y);return t.__p=!(!r.avoidStore&&!n),this.set(t,w(w({},r),{},{avoidStore:t.__p}))}},{key:"up",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.set(t,w(w({},e),{},{__up:!0}))}},{key:"init",value:function(){}},{key:"getId",value:function(){return this.get('id')}},{key:"getType",value:function(){return this.get('type')}},{key:"getName",value:function(){return this.get('property')}},{key:"getLabel",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.locale,r=void 0===n||n,o=this.getId(),i=this.get('name')||this.get('label');return r&&(null===(t=this.em)||void 0===t?void 0:t.t("styleManager.properties.".concat(o)))||i}},{key:"getValue",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.noDefault,n=this.get('value');return this.hasValue()||e?n:this.getDefaultValue()}},{key:"hasValue",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.noParent,n=e&&this.getParentTarget(),r=this.get('value');return!(0,i.isUndefined)(r)&&''!==r&&!n}},{key:"hasValueParent",value:function(){return this.hasValue()&&!this.hasValue({noParent:!0})}},{key:"getStyle",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.getName(),n=t.camelCase?(0,a.camelCase)(e):e;return{[n]:this.__getFullValue(t)}}},{key:"getDefaultValue",value:function(){var t=this.get('default');return"".concat((0,i.isUndefined)(t)?this.get('defaults'):t)}},{key:"upValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null===t||''===t?this.__getClearProps():this.__parseValue(t,e);return this._up(n,e)}},{key:"isVisible",value:function(){return!!this.get('visible')}},{key:"clear",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._up(this.__getClearProps(),w(w({},t),{},{__clear:!0}))}},{key:"canClear",value:function(){var t=this.getParent();return t?t.__canClearProp(this):this.hasValue({noParent:!0})}},{key:"getParent",value:function(){return this.__getParentProp()||null}},{key:"isFull",value:function(){return!!this.get('full')}},{key:"__parseValue",value:function(t,e){return this.parseValue(t,e)}},{key:"__getClearProps",value:function(){return{value:''}}},{key:"setValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.parseValue(t),o=!e;!o&&this.set({value:void 0},{avoidStore:o,silent:!0}),this.set(r,w({avoidStore:o},n))}},{key:"setValueFromInput",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.setValue(t,e,w(w({},n),{},{fromInput:1}))}},{key:"parseValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={value:t},r='!important';if((0,i.isString)(t)&&-1!==t.indexOf(r)&&(n.value=t.replace(r,'').trim(),n.important=1),!this.get('functionName')&&!e.complete)return n;var o=[],a="".concat(n.value),s=a.indexOf('(')+1,l=a.lastIndexOf(')'),c=a.substring(0,s-1);if(c&&(n.functionName=c),o.push(s),l>=0&&o.push(l),n.value=String.prototype.substring.apply(a,o),e.numeric){var u=parseFloat(n.value);n.unit=n.value.replace(u,''),n.value=u}return n}},{key:"__getFullValue",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.withDefault;return!this.hasValue()&&e?this.getDefaultValue():this.getFullValue()}},{key:"getFullValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.get('functionName'),r=this.getDefaultValue(),o=(0,i.isUndefined)(t)?this.get('value'):t,a=!(0,i.isUndefined)(o)&&''!==o;if(o&&r&&o===r)return r;if(n&&a){var s='url'===n?"'".concat(o.replace(/'|"/g,''),"'"):o;o="".concat(n,"(").concat(s,")")}return a&&this.get('important')&&!e.skipImportant&&(o="".concat(o," !important")),o||''}},{key:"__setParentTarget",value:function(t){this.up({parentTarget:t})}},{key:"getParentTarget",value:function(){return this.get('parentTarget')||null}},{key:"__parseFn",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'',e=t.indexOf('(')+1,n=t.lastIndexOf(')');return{name:t.substring(0,e-1).trim(),value:String.prototype.substring.apply(t,[e,n>=0?n:void 0]).trim()}}},{key:"__checkVisibility",value:function(t){var e=t.target,n=t.component,r=t.sectors,o=n||e;if(!o)return!1;var s=this.getId(),l=this.getName(),c=this.get('toRequire'),u=this.get('requires'),p=this.get('requiresParent'),f=o.get('unstylable'),d=o.get('stylable-require'),h=o.get('stylable');if((0,i.isArray)(h)&&(h=h.indexOf(l)>=0),(0,i.isArray)(f)&&(h=f.indexOf(l)<0),c&&(h=!e||d&&(d.indexOf(s)>=0||d.indexOf(l)>=0)),r&&u){var g=(0,i.keys)(u);r.forEach((function(t){t.getProperties().forEach((function(t){if((0,i.includes)(g,t.id)){var e=u[t.id];h=h&&(0,i.includes)(e,t.get('value'))}}))}))}if(p){var v=n&&n.parent(),m=v&&v.getEl();if(m){var y=(0,a.hasWin)()?window.getComputedStyle(m):{};(0,i.each)(p,(function(t,e){h=h&&y[e]&&(0,i.includes)(t,y[e])}))}else h=!1}return!!h}}]),n}(l.Model);function O(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function C(t){for(var e=1;e3&&void 0!==arguments[3]?arguments[3]:{};t.prototype.initialize.apply(e,[n,w(w({},r),{},{skipInit:1})])},x.callInit=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!n.skipInit&&t.init(e,n)},x.getDefaults=function(){return(0,i.result)(this.prototype,'defaults')},x.prototype.defaults={name:'',property:'',type:'',defaults:'',info:'',value:'',icon:'',functionName:'',status:'',visible:!0,fixedValues:['initial','inherit'],onChange:null,full:0,important:0,toRequire:0,requires:null,requiresParent:null,parentTarget:null};var S=function(t){return'integer'===t||'number'===t},P=function(t){(0,h.Z)(n,t);var e=k(n);function n(){return(0,f.Z)(this,n),e.apply(this,arguments)}return(0,d.Z)(n,[{key:"defaults",value:function(){return C(C({},x.getDefaults()),{},{detached:!1,properties:[],separator:' ',join:null,fromStyle:null,toStyle:null,full:!0})}},{key:"initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};x.callParentInit(x,this,t,e);var n=this.em,r=new Ht(this.get('properties')||[],{em:n,parentProp:this});this.set('properties',r,{silent:1}),this.listenTo(r,'change',this.__upProperties),x.callInit(this,t,e)}},{key:"getProperties",value:function(){return(0,r.Z)(this.get('properties').models)}},{key:"getProperty",value:function(t){return this.get('properties').filter((function(e){return e.getId()===t||e.getName()===t}))[0]||null}},{key:"getPropertyAt",value:function(t){return this.get('properties').at(t)}},{key:"isDetached",value:function(){return!!this.get('detached')}},{key:"getValues",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.byName;return this.getProperties().reduce((function(t,n){return t[e?n.getName():n.getId()]="".concat(n.__getFullValue()),t}),{})}},{key:"getSeparator",value:function(){return this.getSplitSeparator()}},{key:"getJoin",value:function(){return this.__getJoin()}},{key:"getStyleFromProps",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.getName(),n=this.__getJoin(),r=this.get('toStyle'),o=this.getValues(),i={};if(r)i=r(o,{join:n,name:e,property:this});else if(o=this.getValues({byName:!0}),this.isDetached())i=o;else{var a=this.getProperties().map((function(t){return t.__getFullValue({withDefault:1})})).filter(Boolean).join(n);i={[e]:a}}return this.isDetached()?i[e]='':(i[e]=i[e]||'',i=C(C({},i),this.getProperties().reduce((function(t,e){return t[e.getName()]='',t}),{}))),t.camelCase?Object.keys(i).reduce((function(t,e){return t[camelCase(e)]=i[e],t}),{}):i}},{key:"getSplitSeparator",value:function(){return new RegExp("".concat(this.get('separator'),"(?![^\\(]*\\))"))}},{key:"__upProperties",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e.__up&&!e.__clearIn){var n=this.__getParentProp();if(n)return n.__upProperties(this,e);this.__upTargetsStyleProps(e,t)}}},{key:"__upTargetsStyleProps",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,n=this.getStyleFromProps();if(this.isDetached()&&e){var r=e.getName();n={[r]:n[r]}}this.__upTargetsStyle(n,t)}},{key:"_up",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.__setProperties(this.__getSplitValue(t.value),e),x.prototype._up.call(this,t,e)}},{key:"getStyle",value:function(t){return this.getStyleFromProps(t)}},{key:"__getFullValue",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.isDetached()||t.__clear?'':this.getStyleFromProps()[this.getName()]||''}},{key:"__getJoin",value:function(){var t=this.get('join');return(0,i.isString)(t)?t:this.get('separator')}},{key:"__styleHasProps",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.getName(),n=this.getProperties(),o=n.map((function(t){return t.getName()})),a=[e].concat((0,r.Z)(o));return a.some((function(e){return!(0,i.isUndefined)(t[e])&&''!==t[e]}))}},{key:"__splitValue",value:function(t,e){return t.split(e).map((function(t){return t.trim()})).filter(Boolean)}},{key:"__splitStyleName",value:function(t,e,n){return this.__splitValue(t[e]||'',n)}},{key:"__getSplitValue",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'',e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.byName,r=this.getProperties(),o=4===r.length&&r.every((function(t){return S(t.getType())})),a=this.__splitValue(t,this.getSplitSeparator()),s={};return r.forEach((function(t,e){var r=a[e],l=(0,i.isUndefined)(r)?'':r;if(o){var c=a.length;l=a[e]||a[e%c+(1!=c&&c%2?1:0)]||l}var u=n?t.getName():t.getId();s[u]=l||''})),s}},{key:"__getPropsFromStyle",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.__styleHasProps(t))return null;var n=e.byName,r=this.getName(),o=this.getProperties(),a=this.getSplitSeparator(),s=this.get('fromStyle'),l=s?s(t,{property:this,name:r,separator:a}):{};return s||(l=this.__getSplitValue(t[r]||'',{byName:n}),o.forEach((function(e){var r=t[e.getName()],o=n?e.getName():e.getId();(0,i.isUndefined)(r)||''===r||(l[o]=r)}))),l}},{key:"__setProperties",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.getProperties().forEach((function(n){var r=t[n.getId()];n.__getFullValue()!==r&&n.upValue(r,e)}));var n=(0,i.keys)(t).map((function(e){return t[e]})).join(' ');this.set('value',n,{silent:!0})}},{key:"clear",value:function(){var t=this;return this.getProperties().map((function(e){return e.clear({__clearIn:!t.isDetached()})})),x.prototype.clear.call(this)}},{key:"hasValue",value:function(t){return this.getProperties().some((function(e){return e.hasValue(t)}))}},{key:"getFullValue",value:function(){return this.__getFullValue()}},{key:"__canClearProp",value:function(t){return this.isDetached()&&t.hasValue({noParent:!0})}}]),n}(x);function T(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function E(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{},e=this.get('values');return t.camelCase?Object.keys(e).reduce((function(t,n){return t[(0,a.camelCase)(n)]=e[n],t}),{}):e}},{key:"getLabel",value:function(){var t;return null===(t=this.prop)||void 0===t?void 0:t.getLayerLabel(this)}},{key:"isSelected",value:function(){var t;return(null===(t=this.prop)||void 0===t?void 0:t.getSelectedLayer())===this}},{key:"select",value:function(){var t;return null===(t=this.prop)||void 0===t?void 0:t.selectLayer(this)}},{key:"remove",value:function(){var t;return null===(t=this.prop)||void 0===t?void 0:t.removeLayer(this)}},{key:"move",value:function(t){var e;return null===(e=this.prop)||void 0===e?void 0:e.moveLayer(this,t)}},{key:"getStylePreview",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return null===(t=this.prop)||void 0===t?void 0:t.getStylePreview(this,e)}},{key:"hasPreview",value:function(){var t;return!(null===(t=this.prop)||void 0===t||!t.get('preview'))}},{key:"upValues",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.set('values',E(E({},this.getValues()),t))}}]),n}(l.Model);function M(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,v.Z)(t);if(e){var o=(0,v.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,g.Z)(this,n)}}var D=function(t){(0,h.Z)(n,t);var e=M(n);function n(){return(0,f.Z)(this,n),e.apply(this,arguments)}return(0,d.Z)(n,[{key:"initialize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prop=e.prop}}]),n}(l.Collection);D.prototype.model=A;var L=["__layers"];function R(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Z(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};P.callParentInit(P,this,t,e);var n=this.get('layers'),r=new D(n,{prop:this});r.property=this,r.properties=this.get('properties'),this.set('layers',r,{silent:!0}),this.on('change:selectedLayer',this.__upSelected),this.listenTo(r,'add remove',this.__upLayers),P.callInit(this,t,e)}},{key:"getLayers",value:function(){return this.__getLayers().models}},{key:"__getLayers",value:function(){return this.get('layers')}},{key:"getLayer",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.__getLayers().at(t)||null}},{key:"getSelectedLayer",value:function(){var t=this.get('selectedLayer');return t&&t.getIndex()>=0?t:null}},{key:"selectLayer",value:function(t){return this.set('selectedLayer',t,{__select:!0})}},{key:"selectLayerAt",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=this.getLayer(t);return e&&this.selectLayer(e)}},{key:"moveLayer",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=t?t.getIndex():-1;n>=0&&(0,i.isNumber)(e)&&e>=0&&e0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={};this.getProperties().forEach((function(e){var r=e.getId(),o=t[r];n[r]=(0,i.isUndefined)(o)?e.getDefaultValue():o}));var r=this.get('layers').push({values:n},e);return r}},{key:"removeLayer",value:function(t){return this.get('layers').remove(t)}},{key:"removeLayerAt",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=this.getLayer(t);return e?this.removeLayer(e):null}},{key:"getLayerLabel",value:function(t){var e='';if(t){var n=this.get('layerLabel'),r=t.getValues(),o=t.getIndex();if(n)e=n(t,{index:o,values:r,property:this});else{var i=[];this.getProperties().map((function(t){i.push(r[t.getId()])})),e=i.filter(Boolean).join(' ')}}return e}},{key:"getStyleFromLayer",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.__getJoin(),o=this.__getJoinLayers(),s=this.get('toStyle'),l=this.getName(),c=t.getValues();if(s)e=s(c,{join:r,joinLayers:o,name:l,layer:t,property:this});else{var u=this.getProperties().map((function(t){var e=t.getName(),r=c[t.getId()],o=(0,i.isUndefined)(r)?t.getDefaultValue():r;if(n.number&&S(t.getType())){var a=t.parseValue(r,n.number);o="".concat(a.value).concat(a.unit)}return{name:e,value:o}}));e=this.isDetached()?u.reduce((function(t,e){return t[e.name]=e.value,t}),{}):{[this.getName()]:u.map((function(t){return t.value})).join(r)}}return n.camelCase?Object.keys(e).reduce((function(t,n){return t[(0,a.camelCase)(n)]=e[n],t}),{}):e}},{key:"getStylePreview",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={},r=this.get('preview');return r&&(n=this.getStyleFromLayer(t,e)),n}},{key:"getLayerSeparator",value:function(){var t=this.get('layerSeparator');return(0,i.isString)(t)?new RegExp("".concat(t,"(?![^\\(]*\\))")):t}},{key:"__upProperties",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getSelectedLayer();n&&(n.upValues({[t.getId()]:t.__getFullValue()}),e.__up||this.__upTargetsStyleProps(e))}},{key:"__upLayers",value:function(t,e,n){this.__upTargetsStyleProps(n||e)}},{key:"__upTargets",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e.__select)return x.prototype.__upTargets.call(this,t,e)}},{key:"__upTargetsStyleProps",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.__upTargetsStyle(this.getStyleFromLayers(),t)}},{key:"__upTargetsStyle",value:function(t,e){return x.prototype.__upTargetsStyle.call(this,t,e)}},{key:"__upSelected",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.noEvent,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.em.get('StyleManager'),o=this.getSelectedLayer(),i=null==o?void 0:o.getValues();i&&this.getProperties().forEach((function(t){var e,r=null!==(e=i[t.getId()])&&void 0!==e?e:'';t.__getFullValue()!==r&&t.upValue(r,Z(Z({},n),{},{__up:!0}))})),!e&&r.__trgEv(r.events.layerSelect,{property:this})}},{key:"_up",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.__layers,r=void 0===n?[]:n,o=(0,p.Z)(t,L);return!this.isDetached()&&this.__setLayers(r),this.__upSelected({noEvent:!0},e),x.prototype._up.call(this,o,e)}},{key:"__setLayers",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=this.__getLayers(),n=t.map((function(t){return{values:t}}));e.length===n.length?n.map((function(t,n){var r;return null===(r=e.at(n))||void 0===r?void 0:r.upValues(t.values)})):this.__getLayers().reset(n),this.__upSelected({noEvent:!0})}},{key:"__parseValue",value:function(t){var e=this,n=this.parseValue(t);return n.__layers=t.split(I).map((function(t){return t.trim()})).map((function(t){return e.__parseLayer(t)})).filter(Boolean),n}},{key:"__parseLayer",value:function(t){var e=this.get('parseLayer'),n=t.split(F),r=this.getProperties();return e?e({value:t,values:n}):r.reduce((function(t,e,r){var o=n[r];return t[e.getId()]=(0,i.isUndefined)(o)?e.getDefaultValue():o,t}),{})}},{key:"__getLayersFromStyle",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.__styleHasProps(e))return null;var n=this.getName(),r=this.getProperties(),o=this.getLayerSeparator(),a=this.get('fromStyle'),s=a?a(e,{property:this,name:n,separatorLayers:o}):[];if(!a){var l=this.__splitStyleName(e,n,o).map((function(e){return e.split(t.getSplitSeparator())})).map((function(t){var e={};return r.forEach((function(n,r){var o=t[r];e[n.getId()]=(0,i.isUndefined)(o)?n.getDefaultValue():o})),e}));r.forEach((function(n){var r=n.getId();t.__splitStyleName(e,n.getName(),o).map((function(t){return{[r]:t||n.getDefaultValue()}})).forEach((function(t,e){l[e]=l[e]?Z(Z({},l[e]),t):t}))})),s=l}return(0,i.isArray)(s)?s:[s]}},{key:"getStyle",value:function(t){return this.getStyleFromLayers(t)}},{key:"getStyleFromLayers",value:function(t){var e=this,n={},r=this.getName(),o=this.getLayers(),a=this.getProperties();if(o.map((function(n){return e.getStyleFromLayer(n,t)})).forEach((function(t){(0,i.keys)(t).map((function(e){n[e]||(n[e]=[]),n[e].push(t[e])}))})),(0,i.keys)(n).map((function(t){n[t]=n[t].join(e.__getJoinLayers())})),this.isDetached())n[r]='',!o.length&&a.map((function(t){n[t.getName()]=''}));else{var s=a.reduce((function(t,e){return t[e.getName()]='',t}),{});n[r]=n[r]||'',n=Z(Z({},n),s)}return n}},{key:"__getJoinLayers",value:function(){var t=this.get('layerJoin'),e=this.get('layerSeparator');return t||((0,i.isString)(e)?e:t)}},{key:"__getFullValue",value:function(){return this.get('detached')?'':this.getStyleFromLayers()[this.getName()]}},{key:"hasValue",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.noParent,n=e&&this.getParentTarget();return this.getLayers().length>0&&!n}},{key:"clear",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.__getLayers().reset(),this.__upTargetsStyleProps(t),x.prototype.clear.call(this)}},{key:"__canClearProp",value:function(){return!1}}]),n}(P),B=["complete","partial"];function H(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function z(t){for(var e=1;e \n
\n ")}},{key:"templateLabel",value:function(t){var e=this.pfx,n=this.em,r=t.parent,o=t.attributes,i=o.icon,a=void 0===i?'':i,s=o.info,l=void 0===s?'':s,c=null==n?void 0:n.getConfig().icons,u=(null==c?void 0:c.close)||'';return"\n \n ").concat(t.getLabel(),"\n \n ").concat(r?'':"").concat(u,"
"),"\n ")}},{key:"templateInput",value:function(t){return"\n \n \n
\n ")}},{key:"initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,i.bindAll)(this,'__change','__updateStyle');var e=t.config||{},n=e.em;this.config=e,this.em=n,this.pfx=e.stylePrefix||'',this.ppfx=e.pStylePrefix||'',this.__destroyFn=this.destroy?this.destroy.bind(this):function(){};var r=this.model;r.view=this,this.onValueChange=(0,i.debounce)(this.onValueChange.bind(this),10),this.updateStatus=(0,i.debounce)(this.updateStatus.bind(this)),this.listenTo(r,'destroy remove',this.remove),this.listenTo(r,'change:visible',this.updateVisibility),this.listenTo(r,'change:name change:className change:full',this.render),this.listenTo(r,'change:value',this.onValueChange),this.listenTo(r,'change:parentTarget',this.updateStatus),this.listenTo(n,'change:device',this.onValueChange);var o=this.init&&this.init.bind(this);o&&o()}},{key:"remove",value:function(){var t=this;l.View.prototype.remove.apply(this,arguments),['em','input','$input','view'].forEach((function(e){return t[e]=null})),this.__destroyFn(this._getClbOpts())}},{key:"updateStatus",value:function(){var t,e=this.model,n=this.pfx,r=this.ppfx,o=this.config,i="".concat(r,"four-color"),a="".concat(r,"color-warn"),s=this.$el.children(".".concat(n,"label")),l=this.getClearEl(),c=l?l.style:{};s.removeClass("".concat(i," ").concat(a)),c.display='none',e.hasValue({noParent:!0})&&o.highlightChanged?(s.addClass(i),o.clearProperties&&(c.display='')):e.hasValue()&&o.highlightComputed&&s.addClass(a),null===(t=this.parent)||void 0===t||t.updateStatus()}},{key:"clear",value:function(t){t&&t.stopPropagation(),this.model.clear()}},{key:"getClearEl",value:function(){return this.clearEl||(this.clearEl=this.el.querySelector("[".concat(W,"]"))),this.clearEl}},{key:"inputValueChanged",value:function(t){t&&t.stopPropagation(),this.emit||this.model.upValue(t.target.value)}},{key:"onValueChange",value:function(t,e){this.setValue(this.model.getFullValue(void 0,{skipImportant:!0})),this.updateStatus()}},{key:"setValue",value:function(t){var e=this.model,n=(0,i.isUndefined)(t)||''===t?e.getDefaultValue():t;if(this.update)return this.__update(n);this.__setValueInput(n)}},{key:"__setValueInput",value:function(t){var e=this.getInputEl();e&&(e.value=t)}},{key:"getInputEl",value:function(){return this.input||(this.input=this.el.querySelector('input')),this.input}},{key:"updateVisibility",value:function(){this.el.style.display=this.model.isVisible()?'':'none'}},{key:"clearCached",value:function(){this.clearEl=null,this.input=null,this.$input=null}},{key:"__unset",value:function(){var t=this.unset&&this.unset.bind(this);t&&t(this._getClbOpts())}},{key:"__update",value:function(t){var e=this.update&&this.update.bind(this);e&&e(z(z({},this._getClbOpts()),{},{value:t}))}},{key:"__change",value:function(){for(var t=this.emit&&this.emit.bind(this),e=arguments.length,n=new Array(e),r=0;r1&&void 0!==arguments[1]?arguments[1]:{},n=e.complete,r=e.partial,o=((0,p.Z)(e,B),this.model),i=!1!==n&&!0!==r;(0,a.isObject)(t)?o.__upTargetsStyle(t,{avoidStore:!i}):o.upValue(t,{partial:!i})}},{key:"_getClbOpts",value:function(){var t=this.model;return{el:this.el,createdEl:this.createdEl,property:t,props:t.attributes,change:this.__change,updateStyle:this.__updateStyle}}},{key:"render",value:function(){this.clearCached();var t=this.pfx,e=this.model,n=this.el,r=this.$el,o=e.getName(),i=e.getType(),a=e.get('className')||'',s="".concat(t,"property"),l='number'===i?"".concat(t).concat(i," ").concat(t,"integer"):"".concat(t).concat(i);this.createdEl&&this.__destroyFn(this._getClbOpts()),r.empty().append(this.template(e)),r.find('[data-sm-label]').append(this.templateLabel(e));var c=this.create&&this.create.bind(this);this.createdEl=c&&c(this._getClbOpts()),r.find('[data-sm-fields]').append(this.createdEl||this.templateInput(e)),n.className="".concat(s," ").concat(l," ").concat(s,"__").concat(o," ").concat(a).trim(),n.className+=e.isFull()?" ".concat(s,"--full"):'';var u=this.onRender&&this.onRender.bind(this);u&&u(),this.setValue(e.getValue())}}]),n}(l.View);$.prototype.events={change:'inputValueChanged',["click [".concat(W,"]")]:'clear'};var q=n(8491);function G(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,v.Z)(t);if(e){var o=(0,v.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,g.Z)(this,n)}}var K=function(t){(0,h.Z)(n,t);var e=G(n);function n(){return(0,f.Z)(this,n),e.apply(this,arguments)}return(0,d.Z)(n,[{key:"initialize",value:function(t){this.config=t.config||{},this.pfx=this.config.stylePrefix||'',this.properties=[],this.parent=t.parent;var e=this.collection;this.listenTo(e,'add',this.addTo),this.listenTo(e,'reset',this.render)}},{key:"addTo",value:function(t,e,n){this.add(t,null,n)}},{key:"add",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.parent,o=this.config,i=e||this.el,a=new t.typeView({model:t,config:o});r&&(a.parent=r),a.render();var s=a.el;this.properties.push(a),(0,q.$Q)(i,s,n.at)}},{key:"remove",value:function(){l.View.prototype.remove.apply(this,arguments),this.clearItems()}},{key:"clearItems",value:function(){this.properties.forEach((function(t){return t.remove()})),this.properties=[]}},{key:"render",value:function(){var t=this,e=this.$el,n=this.pfx;this.clearItems();var r=document.createDocumentFragment();return this.collection.forEach((function(e){return t.add(e,r)})),e.empty(),e.append(r),e.attr('class',"".concat(n,"properties")),this}}]),n}(l.View);function Y(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function X(t){for(var e=1;e\n \n \n ")}},{key:"remove",value:function(){var t;null===(t=this.props)||void 0===t||t.remove(),$.prototype.remove.apply(this,arguments)}},{key:"onValueChange",value:function(){}},{key:"onRender",value:function(){var t=this.model,e=this.pfx,n=t.get('properties');if(n.length&&!this.props){var r=t.isDetached(),o=new K({config:X(X({},this.config),{},{highlightComputed:r,highlightChanged:r}),collection:n,parent:this});o.render(),this.$el.find("#".concat(e,"input-holder")).append(o.el),this.props=o}}},{key:"clearCached",value:function(){$.prototype.clearCached.apply(this,arguments),this.props=null}}]),n}($);function tt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,v.Z)(t);if(e){var o=(0,v.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,g.Z)(this,n)}}var et=function(t){(0,h.Z)(n,t);var e=tt(n);function n(){return(0,f.Z)(this,n),e.apply(this,arguments)}return(0,d.Z)(n,[{key:"events",value:function(){return{click:'select','click [data-close-layer]':'removeItem','mousedown [data-move-layer]':'initSorter','touchstart [data-move-layer]':'initSorter'}}},{key:"template",value:function(){var t=this.pfx,e=this.ppfx,n=this.em,r=null==n?void 0:n.getConfig().icons,o=(null==r?void 0:r.close)||'',i=(null==r?void 0:r.move)||'';return"\n \n
\n ").concat(i,"\n
\n
\n
\n
\n ").concat(o,"\n
\n
\n
\n ")}},{key:"initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.model,n=t.config||{};this.em=n.em,this.config=n,this.sorter=t.sorter,this.pfx=n.stylePrefix||'',this.ppfx=n.pStylePrefix||'',this.propertyView=t.propertyView;var r=this.propertyView.model;this.listenTo(e,'destroy remove',this.remove),this.listenTo(e,'change:values',this.updateLabel),this.listenTo(r,'change:selectedLayer',this.updateVisibility),e.view=this,e.set({droppable:0,draggable:1}),this.$el.data('model',e)}},{key:"initSorter",value:function(){var t;null===(t=this.sorter)||void 0===t||t.startSort(this.el)}},{key:"removeItem",value:function(t){t&&t.stopPropagation(),this.model.remove()}},{key:"select",value:function(){this.model.select()}},{key:"getPropertiesWrapper",value:function(){return this.propsWrapEl||(this.propsWrapEl=this.el.querySelector('[data-properties]')),this.propsWrapEl}},{key:"getPreviewEl",value:function(){return this.previewEl||(this.previewEl=this.el.querySelector('[data-preview]')),this.previewEl}},{key:"getLabelEl",value:function(){return this.labelEl||(this.labelEl=this.el.querySelector('[data-label]')),this.labelEl}},{key:"updateLabel",value:function(){var t=this.model,e=t.getLabel();if(this.getLabelEl().innerHTML=e,t.hasPreview()){var n=this.getPreviewEl(),r=t.getStylePreview({number:{min:-3,max:3}}),o=(0,i.keys)(r).map((function(t){return"".concat(t,":").concat(r[t])})).join(';');n.setAttribute('style',o)}}},{key:"updateVisibility",value:function(){var t=this.pfx,e=this.model,n=this.propertyView,r=this.getPropertiesWrapper(),o=e.isSelected();r.style.display=o?'':'none',this.$el[o?'addClass':'removeClass']("".concat(t,"active")),o&&r.appendChild(n.props.el)}},{key:"render",value:function(){var t=this.el,e=this.pfx,n=this.model;return t.innerHTML=this.template(),t.className="".concat(e,"layer"),n.hasPreview()&&(t.querySelector('[data-preview-box]').style.display=''),this.updateLabel(),this.updateVisibility(),this}}]),n}(l.View);function nt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,v.Z)(t);if(e){var o=(0,v.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,g.Z)(this,n)}}var rt=function(t){(0,h.Z)(n,t);var e=nt(n);function n(){return(0,f.Z)(this,n),e.apply(this,arguments)}return(0,d.Z)(n,[{key:"initialize",value:function(t){var e=this.collection,n=t.config||{},r=n.em,o=n.stylePrefix||'',i=n.pStylePrefix||'';this.config=n,this.pfx=o,this.ppfx=i,this.propertyView=t.propertyView,this.className="".concat(o,"layers ").concat(i,"field"),this.listenTo(e,'add',this.addTo),this.listenTo(e,'reset',this.reset),this.items=[];var a=r?r.get('Utils'):'';this.sorter=a?new a.Sorter({container:this.el,ignoreViewChildren:1,containerSel:".".concat(o,"layers"),itemSel:".".concat(o,"layer"),pfx:n.pStylePrefix}):'',e.view=this,this.$el.data('model',e),this.$el.data('collection',e)}},{key:"addTo",value:function(t){var e=this.collection.indexOf(t);this.addToCollection(t,null,e)}},{key:"addToCollection",value:function(t,e,n){var r=e||null,o=this.propertyView,i=this.config,a=this.sorter,s=this.$el,l=new et({model:t,config:i,sorter:a,propertyView:o}),c=l.render().el;if(this.items.push(l),r)r.appendChild(c);else if(void 0!==n){var u='before';s.children().length===n&&(n--,u='after'),n<0?s.append(c):s.children().eq(n)[u](c)}else s.append(c);return c}},{key:"reset",value:function(t,e){this.clearItems(e),this.render()}},{key:"remove",value:function(){this.clearItems(),l.View.prototype.remove.apply(this,arguments)}},{key:"clearItems",value:function(){this.items.forEach((function(t){return t.remove()})),this.items=[]}},{key:"render",value:function(){var t=this,e=this.$el,n=this.sorter,r=document.createDocumentFragment();return e.empty(),this.collection.forEach((function(e){return t.addToCollection(e,r)})),e.append(r),e.attr('class',this.className),n&&(n.plh=null),this}}]),n}(l.View);function ot(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function it(t){for(var e=1;e\n \n ").concat(r,"\n \n
\n \n ")}},{key:"init",value:function(){var t=this.model;this.listenTo(t.__getLayers(),'change reset',this.updateStatus)}},{key:"addLayer",value:function(){this.model.addLayer({},{at:0})}},{key:"setValue",value:function(){}},{key:"remove",value:function(){var t;null===(t=this.layersView)||void 0===t||t.remove(),Q.prototype.remove.apply(this,arguments)}},{key:"clearCached",value:function(){Q.prototype.clearCached.apply(this,arguments),this.layersView=null}},{key:"onRender",value:function(){var t=this.model,e=this.el,n=this.config,r=t.get('properties');if(r.length&&!this.props){var o=new K({config:it(it({},n),{},{highlightComputed:!1,highlightChanged:!1}),collection:r,parent:this});o.render();var i=new rt({collection:t.__getLayers(),config:n,propertyView:this});i.render(),e.querySelector('[data-layers-wrapper]').appendChild(i.el),this.props=o,this.layersView=i}}}]),n}(Q);function lt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ct(t){for(var e=1;e\n \n \n \n ")}},{key:"__setValueInput",value:function(t){var e=this.model,n=this.el,r=e.getDefaultValue(),o=n.querySelector('[data-preview-box]'),i=n.querySelector('[data-preview]');o.style.display=t&&t!==r?'':'none',i.style.backgroundImage=t||e.getDefaultValue()}},{key:"openAssetManager",value:function(){var t,e=this,n=null===(t=this.em)||void 0===t?void 0:t.get('AssetManager');null==n||n.open({select:function(t,r){var o=(0,i.isString)(t)?t:t.get('src');e.model.upValue(o,{partial:!r}),r&&n.close()},types:['image'],accept:'image/*'})}}]),n}($);function ft(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,v.Z)(t);if(e){var o=(0,v.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,g.Z)(this,n)}}var dt=function(t){(0,h.Z)(n,t);var e=ft(n);function n(){return(0,f.Z)(this,n),e.apply(this,arguments)}return(0,d.Z)(n,[{key:"templateInput",value:function(){return''}},{key:"init",value:function(){var t=this.model;this.listenTo(t,'change:unit',this.onValueChange),this.listenTo(t,'change:units',this.render)}},{key:"setValue",value:function(){}},{key:"onRender",value:function(){var t=this.ppfx,e=this.model,n=this.el;if(!this.inputInst){var r=e.input;r.ppfx=t,r.render(),n.querySelector(".".concat(t,"fields")).appendChild(r.el),this.input=r.inputEl.get(0),this.inputInst=r}}},{key:"clearCached",value:function(){$.prototype.clearCached.apply(this,arguments),this.inputInst=null}}]),n}($),ht=n(8767);function gt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,v.Z)(t);if(e){var o=(0,v.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,g.Z)(this,n)}}var vt=function(t){(0,h.Z)(n,t);var e=gt(n);function n(){return(0,f.Z)(this,n),e.apply(this,arguments)}return(0,d.Z)(n,[{key:"setValue",value:function(t){var e;null===(e=this.inputInst)||void 0===e||e.setValue(t,{fromTarget:1,def:this.model.getDefaultValue()})}},{key:"remove",value:function(){var t=this;dt.prototype.remove.apply(this,arguments);var e=this.inputInst;e&&e.remove&&e.remove(),['inputInst','$color'].forEach((function(e){return t[e]=null}))}},{key:"__handleChange",value:function(t,e){this.model.upValue(t,{partial:e})}},{key:"onRender",value:function(){if(!this.inputInst){this.__handleChange=this.__handleChange.bind(this);var t=this.ppfx,e=this.model,n=this.em,r=this.el,o=new ht.Z({target:n,model:e,ppfx:t,onChange:this.__handleChange}).render();r.querySelector(".".concat(t,"fields")).appendChild(o.el),this.input=o.inputEl.get(0),this.inputInst=o}}}]),n}(dt);function mt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function yt(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:[];return this.set('options',t),this}},{key:"addOption",value:function(t){if(t){var e=this.getOptions();this.setOptions([].concat((0,r.Z)(e),[t]))}return this}},{key:"getOptionId",value:function(t){return(0,a.isDef)(t.id)?t.id:t.value}},{key:"getOptionLabel",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.locale,o=void 0===r||r,a=((0,i.isString)(t)?this.getOption(t):t)||{},s=this.getOptionId(a),l=a.label||a.name||s,c=n.property||this.getId();return o&&(null===(e=this.em)||void 0===e?void 0:e.t("styleManager.options.".concat(c,".").concat(s)))||l}},{key:"initialize",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n\n \n \n \n ")}},{key:"initialize",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n").concat(o,""))}));var o=this.el.querySelector("#".concat(e,"input-holder"));o.innerHTML="".concat(r.join('')," "),this.input=o.firstChild}}},{key:"__setValueInput",value:function(t){var e=this.model,n=this.getInputEl(),r=e.getOptions()[0],o=r?e.getOptionId(r):'';n&&(n.value=t||o)}}]),n}($);function Ot(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ct(t){for(var e=1;e")}},{key:"onRender",value:function(){var t=this.pfx,e=this.ppfx,n=this.model,r="".concat(e,"radio-item-label"),o=n.getName(),i=n.getOptions(),a="".concat(t,"radio ").concat(t,"radio-").concat(o),s=n.cid;if(!this.input){var l=[];i.forEach((function(i){var c=i.className?"".concat(i.className," ").concat(t,"icon ").concat(r):'',u=n.getOptionId(i),p="".concat(o,"-").concat(u,"-").concat(s),f=c?'':n.getOptionLabel(u),d=i.title?"title=\"".concat(i.title,"\""):'',h=n.getValue()===u?'checked':'';l.push("\n \n \n ").concat(f," \n
\n "))}));var c=this.el.querySelector(".".concat(e,"field"));c.innerHTML="").concat(l.join(''),"
"),this.input=c.firstChild}}},{key:"__setValueInput",value:function(t){var e,n=this.model,r=t||n.getDefaultValue(),o=null===(e=this.getInputEl())||void 0===e?void 0:e.querySelector("[value=\"".concat(r,"\"]"));o&&(o.checked=!0)}}]),n}(xt),Et=n(7610);function jt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function At(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};x.callParentInit(x,this,t,e);var n=this.get('unit'),r=this.get('units');this.input=(0,a.hasWin)()&&new Et.Z({model:this}),r.length&&!n&&this.set('unit',r[0],{silent:1}),x.callInit(this,t,e)}},{key:"__getClearProps",value:function(){return At(At({},x.prototype.__getClearProps()),{},{unit:''})}},{key:"parseValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=x.prototype.parseValue.apply(this,arguments),r=this.input.validateInputValue(n.value,At({deepCheck:1},e)),o=r.value,i=r.unit;return n.value=o,n.unit=i,n}},{key:"getFullValue",value:function(){var t=this.get('value'),e=this.get('unit'),n=(0,i.isUndefined)(t)?'':"".concat(t),r=!(0,i.isUndefined)(e)&&n?e:'',o="".concat(n).concat(r);return x.prototype.getFullValue.apply(this,[o])}}]),n}(x);function Lt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Rt(t){for(var e=1;e\n \n \n ")}},{key:"getSliderEl",value:function(){return this.slider||(this.slider=this.el.querySelector('input[type=range]')),this.slider}},{key:"inputValueChanged",value:function(){this.model.upValue(this.getSliderEl().value)}},{key:"inputValueChangedSoft",value:function(){this.model.upValue(this.getSliderEl().value,{partial:!0})}},{key:"setValue",value:function(t){var e=this.model,n=e.parseValue(t);this.getSliderEl().value=''===t?e.getDefaultValue():parseFloat(n.value),dt.prototype.setValue.apply(this,arguments)}},{key:"onRender",value:function(){dt.prototype.onRender.apply(this,arguments),this.model.get('showInput')||(this.inputInst.el.style.display='none')}},{key:"clearCached",value:function(){dt.prototype.clearCached.apply(this,arguments),this.slider=null}}]),n}(dt);const Ht=c().Collection.extend(m.Z).extend({extendViewApi:1,init:function(){var t=this.opts,e=this.em,n=t.module||(null==e?void 0:e.get('StyleManager'));n&&(n.__listenAdd(this,n.events.propertyAdd),n.__listenRemove(this,n.events.propertyRemove))},types:[{id:'stack',model:V,view:st,isType:function(t){if(t&&'stack'==t.type)return t}},{id:'composite',model:P,view:Q,isType:function(t){if(t&&'composite'==t.type)return t}},{id:'file',model:x,view:pt,isType:function(t){if(t&&'file'==t.type)return t}},{id:'color',model:x,view:vt,isType:function(t){if(t&&'color'==t.type)return t}},{id:'select',model:wt,view:xt,isType:function(t){if(t&&'select'==t.type)return t}},{id:'radio',model:St,view:Tt,isType:function(t){if(t&&'radio'==t.type)return t}},{id:'slider',model:Nt,view:Bt,isType:function(t){if(t&&'slider'==t.type)return t}},{id:'integer',model:Dt,view:dt,isType:function(t){if(t&&'integer'==t.type)return t}},{id:'number',model:Dt,view:dt,isType:function(t){if(t&&'number'==t.type)return t}},{id:'base',model:x,view:$,isType:function(t){return t.type='base',t}}]});var zt=["extend"];function Ut(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Wt(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{},r=n.em;this.em=r;var o=t||{},a=this.buildProperties(o.buildProps),s=this.get('name')||'',l=[];!this.get('id')&&this.set('id',s.replace(/ /g,'_').toLowerCase()),l=(l=a?this.extendProperties(a):this.get('properties').map((function(t){return(0,i.isString)(t)?e.buildProperties(t)[0]:t})).filter(Boolean)).map((function(t){return e.checkExtend(t)}));var c=new Ht(l,{em:r});c.sector=this,this.set('properties',c)}},{key:"getId",value:function(){return this.get('id')}},{key:"getName",value:function(){var t,e=this.getId();return(null===(t=this.em)||void 0===t?void 0:t.t("styleManager.sectors.".concat(e)))||this.get('name')}},{key:"setName",value:function(t){return this.set('name',t)}},{key:"isOpen",value:function(){return!!this.get('open')}},{key:"setOpen",value:function(t){return this.set('open',t)}},{key:"isVisible",value:function(){return!!this.get('visible')}},{key:"getProperties",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.get('properties'),n=e.models?(0,r.Z)(e.models):e;return n.filter((function(e){var n=!0;(t.withValue&&(n=e.hasValue({noParent:!0})),t.withParentValue)&&(n=!e.hasValue({noParent:!0})&&e.hasValue());return n}))}},{key:"getProperty",value:function(t){return this.getProperties().filter((function(e){return e.get('id')===t}))[0]||null}},{key:"addProperty",value:function(t,e){return this.get('properties').add(this.checkExtend(t),e)}},{key:"extendProperties",value:function(t,e,n){for(var r=t.length,o=e||this.get('properties'),a=this.get('extendBuilded'),s=[],l=0,c=o.length;l1&&void 0!==arguments[1]?arguments[1]:{},n=e.module,r=e.em;this.em=r,this.module=n,this.listenTo(this,'reset',this.onReset)}},{key:"model",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.collection.em;return new qt(t,Kt(Kt({},e),{},{em:n}))}},{key:"onReset",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.previousModels||[];n.forEach((function(t){return t.get('properties').reset()}))}}]),n}(l.Collection),Jt=n(885),Qt=["extend"];function te(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ee(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.from||'',o=this.props[r||t]||{},a=ee(ee({},o),{},{property:t},e);return a.properties&&(0,i.isFunction)(a.properties)&&(a.properties=a.properties()),this.props[t]=a,a}},{key:"get",value:function(t){return this.props[t]||null}},{key:"build",value:function(t){var e=this,n=[];return((0,i.isString)(t)?[t]:t).forEach((function(t){n.push(e.get(t)||{property:t})})),n}}]),t}();var oe,ie=n(7539);function ae(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,v.Z)(t);if(e){var o=(0,v.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,g.Z)(this,n)}}var se=function(t){(0,h.Z)(n,t);var e=ae(n);function n(){return(0,f.Z)(this,n),e.apply(this,arguments)}return(0,d.Z)(n,[{key:"template",value:function(t){var e,n,r,o=t.pfx,i=t.label,a=null===(e=this.em)||void 0===e?void 0:e.getConfig().icons,s=(null==a?void 0:a.caret)||'',l="".concat(o,"sector-");return(0,ie.Z)(oe||(n=["\n \n "],r||(r=n.slice(0)),oe=Object.freeze(Object.defineProperties(n,{raw:{value:Object.freeze(r)}}))),l,l,s,l,i)}},{key:"events",value:function(){return{'click [data-sector-title]':'toggle'}}},{key:"initialize",value:function(t){var e=t.config||{},n=this.model,r=e.em;this.config=e,this.em=r,this.pfx=e.stylePrefix||'',this.listenTo(n,'destroy remove',this.remove),this.listenTo(n,'change:open',this.updateOpen),this.listenTo(n,'change:visible',this.updateVisibility)}},{key:"updateOpen",value:function(){var t=this.$el,e=this.model,n=this.pfx,r=e.isOpen();t[r?'addClass':'removeClass']("".concat(n,"open")),this.getPropertiesEl().style.display=r?'':'none'}},{key:"updateVisibility",value:function(){this.el.style.display=this.model.isVisible()?'':'none'}},{key:"getPropertiesEl",value:function(){var t=this.$el,e=this.pfx;return t.find(".".concat(e,"properties")).get(0)}},{key:"toggle",value:function(){var t=this.model;t.setOpen(!t.get('open'))}},{key:"renderProperties",value:function(){var t=this.model,e=this.config,n=t.get('properties');if(n){var r=new K({collection:n,config:e});this.$el.append(r.render().el)}}},{key:"render",value:function(){var t=this.pfx,e=this.model,n=this.$el,r=e.getId(),o=e.getName();return n.html(this.template({pfx:t,label:o})),this.renderProperties(),n.attr('class',"".concat(t,"sector ").concat(t,"sector__").concat(r," no-select")),this.updateOpen(),this}}]),n}(l.View);function le(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,v.Z)(t);if(e){var o=(0,v.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,g.Z)(this,n)}}var ce=function(t){(0,h.Z)(n,t);var e=le(n);function n(){return(0,f.Z)(this,n),e.apply(this,arguments)}return(0,d.Z)(n,[{key:"initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.module,n=t.config,r=void 0===n?{}:n,o=this.collection;this.pfx=r.stylePrefix||'',this.ppfx=r.pStylePrefix||'',this.config=r,this.module=e,this.listenTo(o,'add',this.addTo),this.listenTo(o,'reset',this.render)}},{key:"remove",value:function(){var t=this;l.View.prototype.remove.apply(this,arguments),['config','module','em'].forEach((function(e){return t[e]={}}))}},{key:"addTo",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.addToCollection(t,null,n)}},{key:"addToCollection",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.config,o=this.el,i=e||o,a=new se({model:t,config:r}).render().el;return(0,q.$Q)(i,a,n.at),a}},{key:"render",value:function(){var t=this,e=this.$el,n=this.pfx,r=this.ppfx;e.empty();var o=document.createDocumentFragment();return this.collection.each((function(e){return t.addToCollection(e,o)})),e.append(o),e.addClass("".concat(n,"sectors ").concat(r,"one-bg ").concat(r,"two-color")),this}}]),n}(l.View);function ue(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function pe(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};(0,i.bindAll)(this,'__clearStateTarget'),this.__initConfig(u,r);var o=this.config,a=o.em,s=o.pStylePrefix;s&&(o.stylePrefix=s+o.stylePrefix),this.builtIn=new re,t=new Ht([],{em:a,module:this}),e=new Xt([],pe(pe({},o),{},{module:this}));var c=new l.Model({targets:[]});this.model=c,this.__listenAdd(e,ge),this.__listenRemove(e,ve),this.__listenUpdate(e,me);var p='component:toggled component:update:classes change:state change:device frame:resized selector:type';this.upAll=(0,i.debounce)((function(){return n.__upSel()})),c.listenTo(a,p,this.upAll),c.listenTo(a,'component:toggled',this.__clearStateTarget);var f=(0,i.debounce)((function(){n.__upProps(),n.__trgCustom()}));c.listenTo(a,'styleable:change undo redo',f);var d=(0,i.debounce)((function(){return n.__trgCustom()}));return c.listenTo(a,"".concat(xe," ").concat(Oe),d),c.on('change:lastTarget',(function(){return a.trigger(Oe,n.getSelected())})),this},__upSel:function(){this.select(this.em.getSelectedAll())},__trgCustom:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.__ctn=this.__ctn||t.container,this.em.trigger(this.events.custom,{container:this.__ctn})},__trgEv:function(t){for(var e,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o2&&void 0!==arguments[2]?arguments[2]:{},o=this.getSector(t);return o||(n.id=t,o=e.add(n,r)),o},getSector:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.where({id:t})[0];return!r&&n.warn&&this._logNoSector(t),r||null},getSectors:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e&&e.models?t.array?(0,r.Z)(e.models):e:[];return t.visible?n.filter((function(t){return t.isVisible()})):n},removeSector:function(t){return this.getSectors().remove(this.getSector(t,{warn:1}))},addProperty:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.getSector(t,{warn:1}),o=null;return r&&(o=r.addProperty(e,n)),o},getProperty:function(t,e){var n,r=this.getSector(t,{warn:1});return r&&(n=r.get('properties').filter((function(t){return t.get('property')===e||t.get('id')===e}))[0]),n||null},getProperties:function(t){var e=null,n=this.getSector(t,{warn:1});return n&&(e=n.get('properties')),e},removeProperty:function(t,e){var n=this.getProperties(t);return n?n.remove(this.getProperty(t,e)):null},select:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.em,o=(0,i.isArray)(t)?t:[t],s=n.stylable,l=r.get('CssComposer'),c=[];o.filter(Boolean).forEach((function(t){var e=t;if((0,i.isString)(t)){var n=l.getRule(t)||l.setRule(t);!(0,i.isUndefined)(s)&&n.set({stylable:s}),e=n}c.push(e)}));var u=n.component||c.filter((function(t){return(0,a.isComponent)(t)})).reverse()[0];c=c.map((function(t){return e.getModelToStyle(t)}));var p=r.getState(),f=c.slice().reverse()[0],d=this.getParentRules(f,{state:p,component:u}),h=this.__getStateTarget();return r.skip((function(){var t;if(p&&null!=f&&null!==(t=f.getState)&&void 0!==t&&t.call(f)){var e=f.getStyle();h?h.setStyle(e):h=l.getAll().add({selectors:'gjs-selected',style:e,shallow:!0,important:!0})}else h&&(l.remove(h),h=null)})),this.model.set({targets:c,lastTarget:f,lastTargetParents:d,stateTarget:h,component:u}),this.__upProps(n),c},getSelected:function(){return this.model.get('lastTarget')||null},getSelectedAll:function(){return this.model.get('targets')},getSelectedParents:function(){return this.model.get('lastTargetParents')||[]},__getStateTarget:function(){return this.model.get('stateTarget')||null},addStyleTargets:function(t,e){this.getSelectedAll().map((function(n){return n.addStyle(t,e)}));var n=this.getSelected(),r=this.__getStateTarget();n&&(null==r||r.setStyle(n.getStyle(),e))},getBuiltIn:function(t){return this.builtIn.get(t)},getBuiltInAll:function(){return this.builtIn.props},addBuiltIn:function(t,e){return this.builtIn.add(t,e)},getModelToStyle:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.em,o=n.skipAdd;if(r&&null!==(e=t)&&void 0!==e&&e.toHTML){var i,a=r.getConfig(),s=r.get('UndoManager'),l=r.get('CssComposer'),c=r.get('SelectorManager'),u=c?c.getConfig():{},p=a.devicePreviewMode?'':r.get('state'),f=t.get('classes'),d=f.getStyleable(),h=d.length,g=!u.componentFirst||n.useClasses,v={noCount:1},m={state:p,addOpts:v};if(s.stop(),h&&g){var y=r.getCurrentMedia();(i=l.get(d,p,y))||o||(i=l.add(d,p,y,{},v))}else if(a.avoidInlineStyle){var b=t.getId();!(i=l.getIdRule(b,m))&&!o&&(i=l.setIdRule(b,{},m)),t.is('wrapper')&&i.set('wrapper',1,v)}i&&(t=i),s.start()}return t},getParentRules:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.state,r=e.component,o=this.em,a=[];if(o&&t){var s=r,l=o.get('CssComposer'),c=o.get('CodeManager').getGenerator('css'),u=t.toHTML?t:t.getComponent(),p={combination:!0,array:!0},f=[],d=[],h=[];u?(f=l.getRules("#".concat(u.getId())),h=(d=s?l.getRules(s.getSelectors().getFullName(p)):[]).concat(f)):(f=s?l.getRules("#".concat(s.getId())):[],d=l.getRules(t.getSelectors().getFullName(p)),h=f.concat(d));var g=h.filter((function(t){return(0,i.isUndefined)(n)?1:t.get('state')===n})).sort(c.sortRules).reverse();a=g.slice(g.indexOf(t)+1)}return a},addType:function(e,n){t.addType(e,n)},getType:function(e){return t.getType(e)},getTypes:function(){return t.getTypes()},createType:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.model,r=void 0===n?{}:n,o=e.view,i=void 0===o?{}:o,a=this.config,s=this.getType(t);if(s)return new s.view(pe({model:new s.model(r),config:a},i))},render:function(){var t=this.config,r=this.em,o=n&&n.el;return(n=new ce({el:o,em:r,config:t,collection:e,module:this})).render().el},_logNoSector:function(t){var e=this.em;e&&e.logWarning("'".concat(t,"' sector not found"))},__upProps:function(t){var n=this,r=this.getSelected();if(r){var o=this.model.get('component'),i=this.getSelectedParents(),a=r.getStyle(),s=i.map((function(t){return{target:t,style:t.getStyle()}}));e.map((function(e){e.getProperties().map((function(e){n.__upProp(e,a,s,t)}))})),e.forEach((function(t){var n=t.getProperties();n.forEach((function(t){var n=t.__checkVisibility({target:r,component:o,sectors:e});t.set('visible',n)}));var i=n.some((function(t){return t.isVisible()}));t.set('visible',i)}))}},__upProp:function(t,e,n,r){var o=this,i=t.getName(),a=e[i],s=ke(a),l='stack'===t.getType(),c='composite'===t.getType(),u=pe(pe({},r),{},{__up:!0}),p=!c&&!l,f=l?t.__getLayersFromStyle(e):[],d=c?t.__getPropsFromStyle(e):{},h=s?a:null,g=null;if(l&&null===f||c&&null===d){var v=l?'__getLayersFromStyle':'__getPropsFromStyle',m=n.filter((function(e){return null!==t[v](e.style)}))[0];if(m){h=m.style[i],g=m.target;var y=t[v](m.style);l?f=y:d=y}}else if(!s){h=null;var b=n.filter((function(t){return ke(t.style[i])}))[0];b&&(h=b.style[i],g=b.target)}if(t.__setParentTarget(g),p&&t.__getFullValue()!==h&&t.upValue(h,u),l&&t.__setLayers(f||[]),c){var w=t.getProperties();if(t.isDetached()){var _=t.__getPropsFromStyle(e,{byName:!0})||{},x=n.map((function(e){return pe(pe({},e),{},{style:t.__getPropsFromStyle(e.style,{byName:!0})||{}})}));w.map((function(t){return o.__upProp(t,_,x,r)}))}else t.__setProperties(d||{},u),t.getProperties().map((function(t){return t.__setParentTarget(g)}))}},destroy:function(){[t,e].forEach((function(t){t.reset(),t.stopListening()})),n&&n.remove(),this.model.stopListening(),this.upAll.cancel(),this.em={},this.config={},this.builtIn={},this.model={}}})}},6388:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>z,evAll:()=>V,evCustom:()=>H,evPfx:()=>B});var r=n(4942),o=n(9050),i=n(9304),a=n(2316),s=n.n(a);const l={stylePrefix:'trt-',appendTo:'',optionsTarget:[{value:!1},{value:'_blank'}]};var c=n(5671),u=n(3144),p=n(7326),f=n(9340),d=n(2963),h=n(1120),g=n(6602),v=n(885),m=n(1163);function y(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function b(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};(0,c.Z)(this,n),t=e.call(this,o),(0,r.Z)((0,p.Z)(t),"events",{}),(0,r.Z)((0,p.Z)(t),"appendInput",!0);var i=o.config,a=void 0===i?{}:i,s=(0,p.Z)(t),l=s.model,u=s.eventCapture,f=l.target,d=l.attributes.type;t.config=a,t.em=a.em,t.pfx=a.stylePrefix||'',t.ppfx=a.pStylePrefix||'',t.target=f;var h=(0,p.Z)(t),g=h.ppfx;return t.clsField="".concat(g,"field ").concat(g,"field-").concat(d),[['change:value',t.onValueChange],['remove',t.removeView]].forEach((function(e){var n=(0,v.Z)(e,2),r=n[0],o=n[1];l.off(r,o),t.listenTo(l,r,o)})),l.view=(0,p.Z)(t),t.listenTo(l,'change:label',t.render),t.listenTo(l,'change:placeholder',t.rerender),t.events={},u.forEach((function(e){return t.events[e]='onChange'})),t.delegateEvents(),t.init(),t}return(0,u.Z)(n,[{key:"attributes",value:function(){return this.model.get('attributes')}},{key:"templateLabel",value:function(){var t=this.ppfx,e=this.getLabel();return"").concat(e,"
")}},{key:"templateInput",value:function(){var t=this.clsField;return"
")}},{key:"getClbOpts",value:function(){return{component:this.target,trait:this.model,elInput:this.getInputElem()}}},{key:"removeView",value:function(){this.remove(),this.removed()}},{key:"init",value:function(){}},{key:"removed",value:function(){}},{key:"onRender",value:function(){}},{key:"onUpdate",value:function(){}},{key:"onEvent",value:function(){}},{key:"onChange",value:function(t){var e=this.getInputElem();e&&!(0,o.isUndefined)(e.value)&&this.model.set('value',e.value),this.onEvent(b(b({},this.getClbOpts()),{},{event:t}))}},{key:"getValueForTarget",value:function(){return this.model.get('value')}},{key:"setInputValue",value:function(t){var e=this.getInputElem();e&&(e.value=t)}},{key:"onValueChange",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(n.fromTarget)this.setInputValue(t.get('value')),this.postUpdate();else{var r=this.getValueForTarget();t.setTargetValue(r,n)}}},{key:"renderLabel",value:function(){var t=this.$el,e=this.target,n=this.getLabel(),r=this.templateLabel(e);this.createLabel&&(r=this.createLabel({label:n,component:e,trait:this})||''),t.find('[data-label]').append(r)}},{key:"getLabel",value:function(){var t=this.em,e=this.model.attributes,n=e.label,r=e.name;return t.t("traitManager.traits.labels.".concat(r))||(0,m.capitalize)(n||r).replace(/-/g,' ')}},{key:"getComponent",value:function(){return this.target}},{key:"getInputEl",value:function(){if(!this.$input){var t=this.em,e=this.model,n=e,r=e.attributes.name,i=n.get('placeholder')||n.get('default')||'',a=n.get('type')||'text',s=n.get('min'),l=n.get('max'),c=this.getModelValue(),u=_(" ")),p=t.t("traitManager.traits.attributes.".concat(r))||{};u.attr(b({placeholder:i},p)),(0,o.isUndefined)(c)||(n.set({value:c},{silent:!0}),u.prop('value',c)),s&&u.prop('min',s),l&&u.prop('max',l),this.$input=u}return this.$input.get(0)}},{key:"getInputElem",value:function(){var t=this.input,e=this.$input;return t||e&&e.get&&e.get(0)||this.getElInput()}},{key:"getModelValue",value:function(){var t,e=this.model,n=this.target,r=e.get('name');if(e.get('changeProp'))t=n.get(r);else{var i=n.get('attributes');t=e.get('value')||i[r]}return(0,o.isUndefined)(t)?'':t}},{key:"getElInput",value:function(){return this.elInput}},{key:"renderField",value:function(){var t=this.$el,e=this.appendInput,n=this.model,r=t.find('[data-input]'),i=r[r.length-1],a=n.el;a||(a=this.createInput?this.createInput(this.getClbOpts()):this.getInputEl()),(0,o.isString)(a)?(i.innerHTML=a,this.elInput=i.firstChild):(e?i.appendChild(a):i.insertBefore(a,i.firstChild),this.elInput=a),n.el=this.elInput}},{key:"hasLabel",value:function(){var t=this.model.attributes.label;return!this.noLabel&&!1!==t}},{key:"rerender",value:function(){this.model.el=null,this.render()}},{key:"postUpdate",value:function(){this.onUpdate(this.getClbOpts())}},{key:"render",value:function(){var t=this.$el,e=this.pfx,n=this.ppfx,r=this.model.attributes,i=r.type,a=r.id,s=this.hasLabel&&this.hasLabel(),l="".concat(e,"trait");this.$input=null;var c="\n ").concat(s?"
"):'',"\n
\n ").concat(this.templateInput?(0,o.isFunction)(this.templateInput)?this.templateInput(this.getClbOpts()):this.templateInput:'',"\n
\n
");return t.empty().append(c),s&&this.renderLabel(),this.renderField(),this.el.className="".concat(l,"__wrp ").concat(l,"__wrp-").concat(a),this.postUpdate(),this.onRender(this.getClbOpts()),this}}]),n}(s().View);function O(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,h.Z)(t);if(e){var o=(0,h.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,d.Z)(this,n)}}x.prototype.eventCapture=['change'];var C=function(t){(0,f.Z)(n,t);var e=O(n);function n(){var t,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;(0,c.Z)(this,n),t=e.call(this,o),(0,r.Z)((0,p.Z)(t),"reuseView",!0),t.itemsView=i;var a=o.config||{},s=a.stylePrefix||'',l=o.editor;return t.config=a,t.em=l,t.pfx=s,t.ppfx=a.pStylePrefix||'',t.className="".concat(s,"traits"),t.listenTo(l,'component:toggled',t.updatedCollection),t.updatedCollection(),t}return(0,u.Z)(n,[{key:"updatedCollection",value:function(){var t=this.ppfx,e=this.className,n=this.em.getSelected();this.el.className="".concat(e," ").concat(t,"one-bg ").concat(t,"two-color"),this.collection=n?n.get('traits'):[],this.render()}}]),n}(g.Z);function k(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,h.Z)(t);if(e){var o=(0,h.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,d.Z)(this,n)}}C.prototype.itemView=x;var S=s().$,P=function(t){(0,f.Z)(n,t);var e=k(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,c.Z)(this,n),(t=e.call(this,r)).listenTo(t.model,'change:options',t.rerender),t}return(0,u.Z)(n,[{key:"templateInput",value:function(){var t=this.ppfx,e=this.clsField;return"")}},{key:"getInputEl",value:function(){if(!this.$input){var t=this.model,e=this.em,n=t.get('name'),r=t.get('options')||[],i=[],a='';r.forEach((function(t){var r,s,l,c='';(0,o.isString)(t)?(r=t,s=t):(r=t.name||t.label||t.value,s="".concat((0,o.isUndefined)(t.value)?t.id:t.value).replace(/"/g,'"'),c+=(l=t.style?t.style.replace(/"/g,'"'):'')?" style=\"".concat(l,"\""):'');var u=e.t("traitManager.traits.options.".concat(n,".").concat(s))||r;a+="").concat(u," "),i.push(s)})),a+=' ',this.$input=S(a);var s=t.getTargetValue(),l=i.indexOf(s)>=0?s:t.get('default');!(0,o.isUndefined)(l)&&this.$input.val(l)}return this.$input.get(0)}}]),n}(x);function T(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,h.Z)(t);if(e){var o=(0,h.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,d.Z)(this,n)}}var E=function(t){(0,f.Z)(n,t);var e=T(n);function n(){var t;(0,c.Z)(this,n);for(var o=arguments.length,i=new Array(o),a=0;a\n \n ")}},{key:"onChange",value:function(){var t=this.getInputElem().checked;this.model.set('value',this.getCheckedValue(t))}},{key:"getCheckedValue",value:function(t){var e=t,n=this.model.attributes,r=n.valueTrue,i=n.valueFalse;return e&&!(0,o.isUndefined)(r)&&(e=r),e||(0,o.isUndefined)(i)||(e=i),e}},{key:"getInputEl",value:function(){for(var t=!this.$input,e=arguments.length,n=new Array(e),r=0;r").concat(a,"")}}]),n}(x);function I(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function F(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};this.__initConfig(l,n);var r=this.config,i=new a.Model;this.model=i;var s=this.em,c=r.pStylePrefix;this.types=F({},t),c&&(r.stylePrefix="".concat(c).concat(r.stylePrefix));var u=(0,o.debounce)((function(){return e.__upSel()}));i.listenTo(s,'component:toggled',u);var p=(0,o.debounce)((function(){return e.__onUp()}));return i.listenTo(s,'trait:update',p),this},__upSel:function(){this.select(this.em.getSelected())},__onUp:function(){this.select(this.getSelected())},select:function(t){var e=t?t.getTraits():[];this.model.set({component:t,traits:e}),this.__trgCustom()},getSelected:function(){return this.model.get('component')||null},getCurrent:function(){return this.model.get('traits')||[]},__trgCustom:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.__ctn=this.__ctn||t.container,this.em.trigger(this.events.custom,{container:this.__ctn})},postRender:function(){this.__appendTo()},getTraitsViewer:function(){return this.view},addType:function(t,e){var n=this.getType('text');this.types[t]=n.extend(e)},getType:function(t){return this.getTypes()[t]},getTypes:function(){return this.types},render:function(){var t=this.view,e=this.getConfig(),n=t&&t.el;return t=new C({el:n,collection:[],editor:e.em,config:e},this.getTypes()),this.view=t,t.el},destroy:function(){this.__destroy()}})}},7116:(t,e,n)=>{"use strict";n.d(e,{Z:()=>l});var r,o=n(2316),i=n.n(o),a=n(9050),s=void 0&&(void 0).__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});const l=function(t){function e(e,n,r){return t.call(this,n,{module:e,modelConstructor:r})||this}return s(e,t),e.prototype.add=function(e,n){var r,o=this,i=(0,a.isArray)(e)?e:(0,a.isUndefined)(e)?void 0:[e];return i=null!==(r=null==i?void 0:i.map((function(t){return t instanceof o.newModel?t:new o.newModel(o.module,t)})))&&void 0!==r?r:[void 0],t.prototype.add.call(this,(0,a.isArray)(e)?i:i[0],n)},e.prototype.preinitialize=function(t,e){this.newModel=e.modelConstructor,this.module=e.module},e}(i().Collection)},7904:(t,e,n)=>{"use strict";n.d(e,{Z:()=>s});var r,o=n(2316),i=n.n(o),a=void 0&&(void 0).__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});const s=function(t){function e(e,n,r){var o=t.call(this,n,r)||this;return o._module=e,o}return a(e,t),Object.defineProperty(e.prototype,"module",{get:function(){return this._module},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"config",{get:function(){return this._module.config},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"em",{get:function(){return this._module.em},enumerable:!1,configurable:!0}),e}(i().Model)},6434:(t,e,n)=>{"use strict";n.d(e,{O:()=>p,Z:()=>u});var r,o=n(9050),i=n(1163),a=void 0&&(void 0).__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=void 0&&(void 0).__assign||function(){return s=Object.assign||function(t){for(var e,n=1,r=arguments.length;n{"use strict";n.d(e,{Z:()=>s});var r,o=n(2316),i=n.n(o),a=void 0&&(void 0).__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});const s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),Object.defineProperty(e.prototype,"pfx",{get:function(){return this.ppfx+this.config.stylePrefix||''},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ppfx",{get:function(){return this.em.config.stylePrefix||''},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"module",{get:function(){var t,e;return null!==(e=null===(t=this.model)||void 0===t?void 0:t.module)&&void 0!==e?e:this.collection.module},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"em",{get:function(){return this.module.em},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"config",{get:function(){return this.module.config},enumerable:!1,configurable:!0}),e.prototype.preinitialize=function(t){this.className=''},e}(i().View)},5951:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>ot,evAdd:()=>U,evAll:()=>V,evClose:()=>K,evCustom:()=>q,evOpen:()=>G,evPfx:()=>B,evRemove:()=>W,evRemoveBefore:()=>$,evSelect:()=>H,evUpdate:()=>z,evUpload:()=>Y,evUploadEnd:()=>J,evUploadError:()=>Q,evUploadRes:()=>tt,evUploadStart:()=>X});var r=n(9050),o=n(6434);const i={assets:[],noAssets:'',stylePrefix:'am-',upload:'',uploadName:'files',headers:{},params:{},credentials:'include',multiUpload:!0,autoAdd:!0,customFetch:void 0,uploadFile:void 0,embedAsBase64:!0,handleAdd:void 0,beforeUpload:void 0,showUrlInput:!0,custom:!1,dropzone:!1,openAssetsOnDrop:!0,dropzoneContent:''};var a,s=n(2316),l=void 0&&(void 0).__extends||(a=function(t,e){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},a(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return l(e,t),e.getDefaults=function(){return(0,r.result)(this.prototype,'defaults')},e.prototype.defaults=function(){return{type:'',src:''}},e.prototype.getType=function(){return this.get('type')},e.prototype.getSrc=function(){return this.get('src')},e.prototype.getFilename=function(){return this.get('src').split('/').pop().split('?').shift()},e.prototype.getExtension=function(){return this.getFilename().split('.').pop()},e}(s.Model);const u=c;c.prototype.idAttribute='src';var p=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),f=void 0&&(void 0).__assign||function(){return f=Object.assign||function(t){for(var e,n=1,r=arguments.length;n\n ").concat(this.getPreview(),"\n \n \n ").concat(this.getInfo(),"\n
\n \n ⨯\n
\n ")},e.prototype.updateTarget=function(t){t&&t.set&&(t.set('attributes',(0,r.clone)(t.get('attributes'))),t.set('src',this.model.get('src')))},e.prototype.getPreview=function(){return''},e.prototype.getInfo=function(){return''},e.prototype.render=function(){var t=this.el;return t.innerHTML=this.template(this,this.model),t.className=this.className,this},e}(s.View);const v=g;var m=n(7539),y=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),b=void 0&&(void 0).__makeTemplateObject||function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t},w=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return y(e,t),e.prototype.getPreview=function(){var t=this,e=t.pfx,n=t.ppfx,r=t.model.get('src');return(0,m.Z)(x||(x=b(["\n
\n
\n "],["\n
\n
\n "])),e,r,e,n)},e.prototype.getInfo=function(){var t=this.pfx,e=this.model,n=e.get('name'),r=e.get('width'),o=e.get('height'),i=e.get('unitDim'),a=r&&o?"".concat(r,"x").concat(o).concat(i):'';return n=n||e.getFilename(),(0,m.Z)(O||(O=b(["\n ","
\n ","
\n "],["\n ","
\n ","
\n "])),t,n,t,a)},e.prototype.init=function(t){var e=this.pfx;this.className+=" ".concat(e,"asset-image")},e.prototype.onClick=function(){var t=this.model,e=this.pfx,n=this.__getBhv().select,o=this.config.onClick,i=this.collection;i.trigger('deselectAll'),this.$el.addClass(e+'highlight'),(0,r.isFunction)(n)?n(t,!1):(0,r.isFunction)(o)?o(t):this.updateTarget(i.target)},e.prototype.onDblClick=function(){var t=this.em,e=this.model,n=this.__getBhv().select,o=this.config.onDblClick,i=this.collection,a=i.target,s=i.onSelect;(0,r.isFunction)(n)?n(e,!0):(0,r.isFunction)(o)?o(e):(this.updateTarget(a),t&&t.get('Modal').close()),(0,r.isFunction)(s)&&s(e)},e.prototype.onRemove=function(t){t.stopImmediatePropagation(),this.model.collection.remove(this.model)},e}(v);const _=w;var x,O;w.prototype.events={'click [data-toggle=asset-remove]':'onRemove',click:'onClick',dblclick:'onDblClick'};var C=n(793),k=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),S=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return k(e,t),e}(s.Collection.extend(C.Z));const P=S;S.prototype.types=[{id:'image',model:d,view:_,isType:function(t){return'string'==typeof t?{type:'image',src:t}:t}}];var T=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),E=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this;n.options=e,n.config=e.config,n.pfx=n.config.stylePrefix||'',n.ppfx=n.config.pStylePrefix||'',n.em=n.config.em;var r=n.collection;return n.listenTo(r,'reset',n.renderAssets),n.listenTo(r,'add',n.addToAsset),n.listenTo(r,'remove',n.removedAsset),n.listenTo(r,'deselectAll',n.deselectAll),n}return T(e,t),e.prototype.template=function(t){var e=t.pfx,n=t.ppfx,r=t.em,o='';return this.config.showUrlInput&&(o="\n \n ")),"\n \n ")},e.prototype.handleSubmit=function(t){t.preventDefault();var e=this.getAddInput(),n=e&&e.value.trim(),r=this.config.handleAdd;if(n){e.value='';var o=this.getAssetsEl();o&&(o.scrollTop=0),r?r.bind(this)(n):this.options.globalCollection.add(n,{at:0})}},e.prototype.getAssetsEl=function(){return this.el.querySelector(".".concat(this.pfx,"assets"))},e.prototype.getAddInput=function(){return this.inputUrl&&this.inputUrl.value||(this.inputUrl=this.el.querySelector(".".concat(this.pfx,"add-asset input"))),this.inputUrl},e.prototype.removedAsset=function(t){this.collection.length||this.toggleNoAssets()},e.prototype.addToAsset=function(t){1==this.collection.length&&this.toggleNoAssets(!0),this.addAsset(t)},e.prototype.addAsset=function(t,e){void 0===e&&(e=null);var n=e,r=this.collection,o=this.config,i=new t.typeView({model:t,collection:r,config:o}).render().el;if(n)n.appendChild(i);else{var a=this.getAssetsEl();a&&a.insertBefore(i,a.firstChild)}return i},e.prototype.toggleNoAssets=function(t){void 0===t&&(t=!1);var e=this.$el.find(".".concat(this.pfx,"assets"));if(t)e.empty();else{var n=this.config.noAssets;n&&e.append(n)}},e.prototype.deselectAll=function(){var t=this.pfx;this.$el.find(".".concat(t,"highlight")).removeClass("".concat(t,"highlight"))},e.prototype.renderAssets=function(){var t=this,e=document.createDocumentFragment(),n=this.$el.find(".".concat(this.pfx,"assets"));n.empty(),this.toggleNoAssets(!!this.collection.length),this.collection.each((function(n){return t.addAsset(n,e)})),n.append(e)},e.prototype.render=function(){var t=this.options.fu.render().el;return this.$el.empty(),this.$el.append(t).append(this.template(this)),this.el.className="".concat(this.ppfx,"asset-manager"),this.renderAssets(),this},e}(s.View);const j=E;E.prototype.events={submit:'handleSubmit'};var A=n(6062),M=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),D=void 0&&(void 0).__makeTemplateObject||function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t},L=function(t){function e(n){void 0===n&&(n={});var r=t.call(this,n)||this;r.options=n;var o=n.config||{};r.module=n.module,r.config=o,r.em=r.config.em,r.pfx=o.stylePrefix||'',r.ppfx=o.pStylePrefix||'',r.target=r.options.globalCollection||{},r.uploadId=r.pfx+'uploadFile',r.disabled=void 0!==o.disableUpload?o.disableUpload:!o.upload&&!o.embedAsBase64,r.multiUpload=void 0===o.multiUpload||o.multiUpload;var i=o.uploadFile;return i?r.uploadFile=i.bind(r):!o.upload&&o.embedAsBase64&&(r.uploadFile=e.embedAsBase64),r.delegateEvents(),r}return M(e,t),e.prototype.template=function(t){var e=t.pfx,n=t.title,r=t.uploadId,o=t.disabled,i=t.multiUpload;return(0,m.Z)(Z||(Z=D(["\n \n "],["\n \n "])),e,n,r,o?'disabled':'',i?'multiple':'')},e.prototype.events=function(){return{'change [data-input]':'uploadFile'}},e.prototype.onUploadStart=function(){var t=this.module;t&&t.__propEv('asset:upload:start')},e.prototype.onUploadEnd=function(t){var e=this.$el,n=this.module;n&&n.__propEv('asset:upload:end',t);var r=e.find('input');r&&r.val('')},e.prototype.onUploadError=function(t){var e=this.module;console.error(t),this.onUploadEnd(t),e&&e.__propEv('asset:upload:error',t)},e.prototype.onUploadResponse=function(t,e){var n,r=this,o=r.module,i=r.config,a=r.target;try{n='string'==typeof t?JSON.parse(t):t}catch(e){n=t}o&&o.__propEv('asset:upload:response',n),i.autoAdd&&a&&a.add(n.data,{at:0}),this.onUploadEnd(t),null==e||e(n)},e.prototype.uploadFile=function(t,e){var n=this,r=t.dataTransfer?t.dataTransfer.files:t.target.files,o=this.config,i=o.beforeUpload;if(!1!==(i&&i(r))){var a=new FormData,s=o.params,l=o.customFetch;for(var c in s)a.append(c,s[c]);if(this.multiUpload)for(var u=0;u").concat(r.dropzoneContent,"")),p(),'draggable'in i&&[i,s].forEach((function(t){t.ondragover=f,t.ondragleave=d,t.ondrop=h}))},e.prototype.render=function(){var t=this,e=t.$el,n=t.pfx,r=t.em;return e.html(this.template({title:r&&r.t('assetManager.uploadTitle'),uploadId:this.uploadId,disabled:this.disabled,multiUpload:this.multiUpload,pfx:n})),this.initDrop(),e.attr('class',n+'file-uploader'),this},e.embedAsBase64=function(t,e){var n=this,r=t.dataTransfer?t.dataTransfer.files:t.target.files,o={data:[]};if(FileReader){for(var i=[],a=/^(.+)\/(.+)$/,s=function(t){var e=new Promise((function(e,n){var r=new FileReader;r.addEventListener('load',(function(o){var i,s=t.name,l=a.exec(t.type);if('image'===(i=l?l[1]:t.type)){var c={src:r.result,name:s,type:i,height:0,width:0},u=new Image;u.addEventListener('error',(function(t){n(t)})),u.addEventListener('load',(function(){c.height=u.height,c.width=u.width,e(c)})),u.src=c.src}else e(i?{src:r.result,name:s,type:i}:r.result)})),r.addEventListener('error',(function(t){n(t)})),r.addEventListener('abort',(function(t){n('Aborted')})),r.readAsDataURL(t)}));i.push(e)},l=0,c=r;l{"use strict";n.r(e),n.d(e,{default:()=>$,evAdd:()=>Z,evAll:()=>L,evCustom:()=>z,evDrag:()=>V,evDragStart:()=>B,evDragStop:()=>H,evPfx:()=>R,evRemove:()=>I,evRemoveBefore:()=>F,evUpdate:()=>N});var r=n(9050);const o={appendTo:'',blocks:[],appendOnClick:!1,custom:!1};var i,a=n(2316),s=void 0&&(void 0).__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});const l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s(e,t),e.prototype.defaults=function(){return{label:'',content:'',media:'',category:'',activate:!1,select:void 0,resetId:!1,disable:!1,onClick:void 0,attributes:{}}},e.prototype.getId=function(){return this.id},e.prototype.getLabel=function(){return this.get('label')},e.prototype.getMedia=function(){return this.get('media')},e.prototype.getContent=function(){return this.get('content')},e.prototype.getCategoryLabel=function(){var t=this.get('category');return(0,r.isFunction)(null==t?void 0:t.get)?t.get('label'):(null==t?void 0:t.label)?null==t?void 0:t.label:t},e}(a.Model);var c=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e}(a.Collection);const p=u;u.prototype.model=l;var f=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.prototype.defaults=function(){return{id:'',label:'',open:!0,attributes:{}}},e}(a.Model);var h=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),g=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e}(a.Collection);const v=g;g.prototype.model=d;var m=n(1163),y=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),b=function(t){function e(e,n){void 0===n&&(n={});var r=t.call(this,e)||this,o=r.model;return r.em=n.em,r.config=n,r.endDrag=r.endDrag.bind(r),r.ppfx=n.pStylePrefix||'',r.listenTo(o,'destroy remove',r.remove),r.listenTo(o,'change',r.render),r}return y(e,t),e.prototype.events=function(){return{click:'handleClick',mousedown:'startDrag',dragstart:'handleDragStart',drag:'handleDrag',dragend:'handleDragEnd'}},e.prototype.__getModule=function(){return this.em.Blocks},e.prototype.handleClick=function(t){var e=this,n=e.config,o=e.model,i=e.em,a=o.get('onClick')||n.appendOnClick;if(i.trigger('block:click',o,t),a){if((0,r.isFunction)(a))return a(o,null==i?void 0:i.getEditor(),{event:t});var s,l,c=n.getSorter(),u=o.get('content'),p=i.getSelected();if(c.setDropContent(u),p)if(c.validTarget(p.getEl(),u).valid)s=p;else{var f=p.parent();f&&c.validTarget(f.getEl(),u).valid&&(s=f,l=f.components().indexOf(p)+1)}if(!s){var d=i.getWrapper();c.validTarget(d.getEl(),u).valid&&(s=d)}var h=s&&s.append(u,{at:l})[0];h&&i.setSelected(h,{scroll:1})}},e.prototype.startDrag=function(t){var e=this,n=e.config,r=e.em,o=e.model,i=o.get('disable');if(0===t.button&&n.getSorter&&!this.el.draggable&&!i){r.refreshCanvas();var a=n.getSorter();a.__currentBlock=o,a.setDragHelper(this.el,t),a.setDropContent(this.model.get('content')),a.startSort(this.el),(0,m.on)(document,'mouseup',this.endDrag)}},e.prototype.handleDragStart=function(t){this.__getModule().__startDrag(this.model,t)},e.prototype.handleDrag=function(t){this.__getModule().__drag(t)},e.prototype.handleDragEnd=function(){this.__getModule().__endDrag()},e.prototype.endDrag=function(){(0,m.off)(document,'mouseup',this.endDrag);var t=this.config.getSorter();t.moved=0,t.endMove()},e.prototype.render=function(){var t,e=this,n=e.em,r=e.el,o=e.$el,i=e.ppfx,a=e.model,s=a.get('disable'),l=a.get('attributes')||{},c=l.class||'',u="".concat(i,"block"),p=n&&n.t("blockManager.labels.".concat(a.id))||a.get('label'),f=a.get('render'),d=a.get('media'),h=s?"".concat(u,"--disable"):"".concat(i,"four-color-h");o.attr(l),r.className="".concat(c," ").concat(u," ").concat(i,"one-bg ").concat(h).trim(),r.innerHTML="\n ".concat(d?"").concat(d,"
"):'',"\n ").concat(p,"
\n "),r.title=l.title||(null===(t=r.textContent)||void 0===t?void 0:t.trim()),r.setAttribute('draggable',"".concat(!(!(0,m.hasDnd)(n)||s)));var g=f&&f({el:r,model:a,className:u,prefix:i});return g&&(r.innerHTML=g),this},e}(a.View);const w=b;var _=n(7539),x=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),O=void 0&&(void 0).__makeTemplateObject||function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t},C=function(t){function e(e,n){var r=t.call(this,e)||this;r.config=n;var o=n.pStylePrefix||'';return r.em=n.em,r.pfx=o,r.caretR='fa fa-caret-right',r.caretD='fa fa-caret-down',r.iconClass="".concat(o,"caret-icon"),r.activeClass="".concat(o,"open"),r.className="".concat(o,"block-category"),r.listenTo(r.model,'change:open',r.updateVisibility),r.model.view=r,r}return x(e,t),e.prototype.events=function(){return{'click [data-title]':'toggle'}},e.prototype.template=function(t){var e=t.pfx,n=t.label;return(0,_.Z)(S||(S=O(["\n \n \n ","\n
\n
\n "],["\n \n \n ","\n
\n
\n "])),e,e,n,e)},e.prototype.attributes=function(){return this.model.get('attributes')||{}},e.prototype.updateVisibility=function(){this.model.get('open')?this.open():this.close()},e.prototype.open=function(){this.$el.addClass(this.activeClass),this.getIconEl().className="".concat(this.iconClass," ").concat(this.caretD),this.getBlocksEl().style.display=''},e.prototype.close=function(){this.$el.removeClass(this.activeClass),this.getIconEl().className="".concat(this.iconClass," ").concat(this.caretR),this.getBlocksEl().style.display='none'},e.prototype.toggle=function(){var t=this.model;t.set('open',!t.get('open'))},e.prototype.getIconEl=function(){return this.iconEl||(this.iconEl=this.el.querySelector(".".concat(this.iconClass))),this.iconEl},e.prototype.getBlocksEl=function(){return this.blocksEl||(this.blocksEl=this.el.querySelector(".".concat(this.pfx,"blocks-c"))),this.blocksEl},e.prototype.append=function(t){this.getBlocksEl().appendChild(t)},e.prototype.render=function(){var t=this,e=t.em,n=t.el,r=t.$el,o=t.model,i=t.pfx,a=e.t("blockManager.categories.".concat(o.id))||o.get('label');return n.innerHTML=this.template({pfx:i,label:a}),r.addClass(this.className),r.css({order:o.get('order')}),this.updateVisibility(),this},e}(a.View);const k=C;var S,P=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),T=void 0&&(void 0).__assign||function(){return T=Object.assign||function(t){for(var e,n=1,r=arguments.length;n\n \n "),this.collection.each((function(e){return t.add(e,n)})),this.append(n);var r="".concat(this.blockContClass,"s ").concat(e,"one-bg ").concat(e,"two-color");return this.$el.addClass(r),this.rendered=!0,this},e}(a.View);const j=E;var A=n(6434),M=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),D=void 0&&(void 0).__assign||function(){return D=Object.assign||function(t){for(var e,n=1,r=arguments.length;n{"use strict";n.r(e),n.d(e,{default:()=>W});var r=n(9050),o=n(6434),i=n(1163);const a={stylePrefix:'cv-',scripts:[],styles:[],customBadgeLabel:void 0,autoscrollLimit:50,extHl:!1,frameContent:'',frameStyle:"\n body { background-color: #fff }\n * ::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.1) }\n * ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2) }\n * ::-webkit-scrollbar { width: 10px }\n ",notTextable:['button','a','input[type=checkbox]','input[type=radio]']};var s,l=n(7904),c=n(7948),u=n(5241),p=n(3560),f=void 0&&(void 0).__extends||(s=function(t,e){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},s(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),d=function(t){function e(e){var n=this,r=e.em,o=e.config,i=o.scripts,a=o.styles;return(n=t.call(this,e,{scripts:i,styles:a})||this).set('frames',new p.Z(e)),n.listenTo(n,'change:zoom',n.onZoomChange),n.listenTo(r,"change:device ".concat(u.evUpdate),n.updateDevice),n.listenTo(r,c.evPageSelect,n._pageUpdated),n}return f(e,t),e.prototype.defaults=function(){return{frame:'',frames:[],rulers:!1,zoom:100,x:0,y:0,scripts:[],styles:[]}},Object.defineProperty(e.prototype,"frames",{get:function(){return this.get('frames')},enumerable:!1,configurable:!0}),e.prototype.init=function(){var t=this.em.get('PageManager').getMain();this.set('frames',t.getFrames()),this.updateDevice({frame:t.getMainFrame()})},e.prototype._pageUpdated=function(t,e){var n=this.em;n.setSelected(),n.get('readyCanvas')&&n.stopDefault(),null==e||e.getFrames().map((function(t){return t.disable()})),this.set('frames',t.getFrames()),this.updateDevice({frame:t.getMainFrame()})},e.prototype.updateDevice=function(t){void 0===t&&(t={});var e=this.em,n=e.getDeviceModel(),r=t.frame||e.getCurrentFrameModel();if(r&&n){var o=n.attributes,i=o.width,a=o.height;r.set({width:i,height:a},{noUndo:1})}},e.prototype.onZoomChange=function(){this.get('zoom')<1&&this.set('zoom',1)},e}(l.Z);const h=d;var g=n(6840),v=n(3059),m=n(8491),y=n(2316),b=n.n(y),w=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const _=function(t){function e(e,n){void 0===e&&(e={}),void 0===n&&(n=!1);var r=t.call(this,e)||this;return r.itemsView='',r.itemType='type',r.reuseView=!1,r.viewCollection=[],n&&r.listenTo(r.collection,'add',r.addTo),r}return w(e,t),e.prototype.addTo=function(t){this.add(t)},e.prototype.itemViewNotFound=function(t){},e.prototype.add=function(t,e){var n,r=this,o=r.reuseView,i=r.viewCollection,a=(r.itemsView,e||null),s=t.get(this.itemType);n=t.view&&o?t.view:this.renderView(t,s),i.push(n);var l=n.render().el;a?a.appendChild(l):this.$el.append(l)},e.prototype.render=function(){var t=this,e=document.createDocumentFragment();return this.clearItems(),this.$el.empty(),this.collection.length&&this.collection.each((function(n){return t.add(n,e)})),this.$el.append(e),this.onRender(),this},e.prototype.onRender=function(){},e.prototype.onRemoveBefore=function(t,e){},e.prototype.onRemove=function(t,e){},e.prototype.remove=function(t){void 0===t&&(t={});var e=this.viewCollection;return this.onRemoveBefore(e,t),this.clearItems(),b().View.prototype.remove.apply(this,t),this.onRemove(e,t),this},e.prototype.clearItems=function(){this.viewCollection},e}(v.Z);var x=n(9566),O=void 0&&(void 0).__assign||function(){return O=Object.assign||function(t){for(var e,n=1,r=arguments.length;n';if(n.stopDefault(),n.inAbsoluteMode()){var c=n.get('DomComponents').getWrapper(),u=c.append({})[0],p=n.get('Commands').run('core:component-drag',{event:t,guidesInfo:1,center:1,target:u,onEnd:function(t,n,i){var a;if(!i.cancelled){a=c.append(l)[0];var s=r.getOffset(),p=u.getStyle(),f=p.top,d=p.left,h=p.position;a.addStyle({left:parseFloat(d)-s.left+'px',top:parseFloat(f)-s.top+'px',position:h})}e.handleDragEnd(a,o),u.remove()}});i=function(e){return p.stop(t,{cancel:e})},a=function(t){return l=t}}else{var f=new s.Sorter(O({em:n,wmargin:1,nested:1,canvasRelative:1,direction:'a',container:this.el,placer:r.getPlacerEl(),containerSel:'*',itemSel:'*',pfx:'gjs-',onEndMove:function(t){return e.handleDragEnd(t,o)},document:this.el.ownerDocument},this.sortOpts||{}));f.setDropContent(l),f.startSort(),this.sorter=f,i=function(t){t&&(f.moved=0),f.endMove()},a=function(t){return f.setDropContent(t)}}this.dragStop=i,this.dragContent=a,n.trigger('canvas:dragenter',o,l)}},t.prototype.handleDragEnd=function(t,e){var n=this.em;this.over=!1,t&&(n.set('dragResult',t),n.trigger('canvas:drop',e,t)),n.runDefault({preserveSelected:1})},t.prototype.handleDragOver=function(t){t.preventDefault(),this.em.trigger('canvas:dragover',t)},t.prototype.handleDrop=function(t){t.preventDefault();var e=this.dragContent,n=t.dataTransfer,r=this.getContentByData(n).content;t.target.style.border='',r&&e&&e(r),this.endDrop(!r,t)},t.prototype.getContentByData=function(t){var e=this.em,n=t&&t.types,o=t&&t.files||[],i=e.get('dragContent'),a=t&&t.getData('text');if(o.length){a=[];for(var s=0;s=0)a=t&&t.getData('text/html').replace(/<\/?meta[^>]*>/g,'');else if((0,r.indexOf)(n,'text/uri-list')>=0)a={type:'link',attributes:{href:a},content:a};else if((0,r.indexOf)(n,'text/json')>=0){var u=t&&t.getData('text/json');u&&(a=JSON.parse(u))}else 1===n.length&&'text/plain'===n[0]&&(a="".concat(a,"
"));var p={content:a};return e.trigger('canvas:dragdata',t,p),p},t}();const k=C;var S=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),P=void 0&&(void 0).__assign||function(){return P=Object.assign||function(t){for(var e,n=1,r=arguments.length;ns&&(l+=i-s),!(0,r.isUndefined)(t)&&l!==o&&l>0&&l0){var l=e.shift(),u=(0,m.ut)('script',P({type:'text/javascript'},(0,r.isString)(l)?{src:l}:l));u.onerror=u.onload=c.bind(null,e),null===(o=n.contentDocument)||void 0===o||o.head.appendChild(u)}else t.renderBody(),i&&i.trigger(a,s)};n.onload=function(){var e=t.config.frameContent;if(e){var n=t.getDoc();n.open(),n.write(e),n.close()}i&&i.trigger("".concat(a,":before"),s),c(T([],l.get('scripts'),!0))}},e.prototype.renderStyles=function(t){void 0===t&&(t={});var e=this.getHead(),n=this.getCanvasModel(),o=function(t){return t.map((function(t){return{tag:'link',attributes:P({rel:'stylesheet'},(0,r.isString)(t)?{href:t}:t)}}))},i=o(t.prev||n.previous('styles')),a=o(n.get('styles')),s=[],l=[],c=function(t,e,n){t.forEach((function(t){var r=t.attributes.href;!e.some((function(t){return t.attributes.href===r}))&&n.push(t)}))};c(a,i,l),c(i,a,s),s.forEach((function(t){var n,r=e.querySelector("link[href=\"".concat(t.attributes.href,"\"]"));null===(n=null==r?void 0:r.parentNode)||void 0===n||n.removeChild(r)})),(0,m.SJ)(e,l)},e.prototype.renderBody=function(){var t,e,n=this,r=this,o=r.config,a=r.em,s=r.model,l=r.ppfx,c=this.getDoc(),u=this.getBody(),p=this.getWindow(),f=a.config;p._isEditor=!0,this.renderStyles({prev:[]});(0,m.R3)(u,""));var d=s.getComponent(),h=a.get('DomComponents').getType('wrapper').view;this.wrapper=new h({model:d,config:P(P({},d.config),{em:a,frameView:this})}).render(),(0,m.R3)(u,null===(t=this.wrapper)||void 0===t?void 0:t.el),(0,m.R3)(u,new x.Z({collection:s.getStyles(),config:P(P({},a.get('CssComposer').getConfig()),{frameView:this})}).render().el),(0,m.R3)(u,this.getJsContainer()),(0,i.on)(u,'click',(function(t){var e;return t&&'A'==(null===(e=t.target)||void 0===e?void 0:e.tagName)&&t.preventDefault()})),(0,i.on)(u,'submit',(function(t){return t&&t.preventDefault()})),[{event:'keydown keyup keypress',class:'KeyboardEvent'},{event:'mousedown mousemove mouseup',class:'MouseEvent'},{event:'pointerdown pointermove pointerup',class:'PointerEvent'},{event:'wheel',class:'WheelEvent'}].forEach((function(t){return t.event.split(' ').forEach((function(e){c.addEventListener(e,(function(e){return n.el.dispatchEvent((0,m.t3)(e,t.class))}))}))})),this._toggleEffects(!0),this.droppable=(0,i.hasDnd)(a)&&new k(a,null===(e=this.wrapper)||void 0===e?void 0:e.el),s.trigger('loaded')},e.prototype._toggleEffects=function(t){var e=t?i.on:i.off,n=this.getWindow();n&&e(n,"".concat(m.G1," resize"),this._emitUpdate)},e.prototype._emitUpdate=function(){this.model._emitUpdated()},e}(v.Z);const j=E;var A=n(8668),M=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),D=void 0&&(void 0).__assign||function(){return D=Object.assign||function(t){for(var e,n=1,r=arguments.length;n\n \n ").concat(i.get('name')||'',"\n
\n \n \n
\n
\n
\n ")).append(e.el);var l=(0,m.ut)('div',{class:"".concat(r,"tools"),style:'pointer-events:none; display: none'},"\n
\n
\n \n
\n
\n
\n \n
\n "));this.elTools=l;var c=null==o?void 0:o.toolsWrapper;return c&&c.appendChild(l),s&&s({el:a,elTop:a.querySelector('[data-frame-top]'),elRight:a.querySelector('[data-frame-right]'),elBottom:a.querySelector('[data-frame-bottom]'),elLeft:a.querySelector('[data-frame-left]'),frame:i,frameWrapperView:this,remove:this.remove,startDrag:this.startDrag}),this},e}(v.Z);var R=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Z=function(t){function e(e,n){void 0===e&&(e={});var r=t.call(this,e,!0)||this;return r.listenTo(r.collection,'reset',r.render),r.canvasView=n.canvasView,r._module=n.module,r}return R(e,t),e.prototype.onRemoveBefore=function(t,e){void 0===e&&(e={}),t.forEach((function(t){return t.remove(e)}))},e.prototype.onRender=function(){var t=this.$el,e=this.ppfx;t.attr({class:"".concat(e,"frames")})},e.prototype.renderView=function(t,e){return new L(t,this.canvasView)},e}(_);const N=Z;var I=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),F=void 0&&(void 0).__assign||function(){return F=Object.assign||function(t){for(var e,n=1,r=arguments.length;n\n
\n ")},e.prototype._onFramesUpdate=function(){this._initFrames(),this._renderFrames()},e.prototype._initFrames=function(){var t=this,e=t.frames,n=t.model,r=t.config,o=t.em,i=n.frames;o.set('readyCanvas',0),i.once('loaded:all',(function(){return o.set('readyCanvas',1)})),null==e||e.remove(),this.frames=new N({collection:i},F(F({},r),{canvasView:this}))},e.prototype.checkSelected=function(t,e){var n;void 0===e&&(e={});var r=e.scroll,o=this.em.get('currentFrame');r&&(null===(n=t.views)||void 0===n||n.forEach((function(t){t._getFrame()===o&&t.scrollIntoView(r)})))},e.prototype.remove=function(){for(var t,e=[],n=0;n=0&&a>=0&&o<=r.height&&a<=r.width},e.prototype.offset=function(t,e){var n,r;void 0===e&&(e={});var o=(0,i.getElRect)(t),a=null==t?void 0:t.ownerDocument.body,s=e.noScroll;return{top:o.top+(s?0:null!==(n=null==a?void 0:a.scrollTop)&&void 0!==n?n:0),left:o.left+(s?0:null!==(r=null==a?void 0:a.scrollLeft)&&void 0!==r?r:0),width:o.width,height:o.height}},e.prototype.clearOff=function(){this.frmOff=void 0,this.cvsOff=void 0},e.prototype.getFrameOffset=function(t){var e;if(!this.frmOff||t){var n=null===(e=this.frame)||void 0===e?void 0:e.el,r=null==t?void 0:t.ownerDocument.defaultView,o=r?r.frameElement:n;this.frmOff=this.offset(o||n)}return this.frmOff},e.prototype.getCanvasOffset=function(){return this.cvsOff||(this.cvsOff=this.offset(this.el)),this.cvsOff},e.prototype.getElementPos=function(t,e){void 0===e&&(e={});var n=this.getZoom(),r=e||{},o=this.getFrameOffset(t),i=this.el,a=this.getCanvasOffset(),s=this.offset(t,e),l=r.avoidFrameOffset?0:o.top,c=r.avoidFrameOffset?0:o.left;return{top:s.top*n+l-a.top+i.scrollTop,left:s.left*n+c-a.left+i.scrollLeft,height:s.height*n,width:s.width*n,zoom:n,rect:s}},e.prototype.getElementOffsets=function(t){var e=this;if(!t||(0,i.isTextNode)(t))return{};var n={},r=window.getComputedStyle(t);return['marginTop','marginRight','marginBottom','marginLeft','paddingTop','paddingRight','paddingBottom','paddingLeft'].forEach((function(t){n[t]=parseFloat(r[t])*e.getZoom()})),n},e.prototype.getPosition=function(t){var e;void 0===t&&(t={});var n=null===(e=this.frame)||void 0===e?void 0:e.el.contentDocument;if(n){var r=n.body,o=this.getZoom(),i=this.getFrameOffset(),a=this.getCanvasOffset(),s=t.noScroll;return{top:i.top+(s?0:r.scrollTop)*o-a.top,left:i.left+(s?0:r.scrollLeft)*o-a.left,width:a.width,height:a.height}}},e.prototype.updateScript=function(t){var e=t.model,n=e.getId();t.scriptContainer||(t.scriptContainer=(0,m.ut)('div',{'data-id':n}),this.getJsContainer().appendChild(t.scriptContainer)),t.el.id=n,t.scriptContainer.innerHTML='';var r=document.createElement('script'),o=e.getScriptString(),i=e.get('script-props')?o:"function(){\n".concat(o,"\n;}"),a=JSON.stringify(e.__getScriptProps());r.innerHTML="\n setTimeout(function() {\n var item = document.getElementById('".concat(n,"');\n if (!item) return;\n (").concat(i,".bind(item))(").concat(a,")\n }, 1);"),setTimeout((function(){var e=t.scriptContainer;null==e||e.appendChild(r)}),0)},e.prototype.getJsContainer=function(t){var e=this.getFrameView(t);return e&&e.getJsContainer()},e.prototype.getFrameView=function(t){return(null==t?void 0:t._getFrame())||this.em.get('currentFrame')},e.prototype._renderFrames=function(){if(this.ready){var t=this,e=t.model,n=t.frames,r=t.em,o=t.framesArea,i=e.frames;i.listenToLoad(),n.render();var a=i.at(0),s=null==a?void 0:a.view;r.setCurrentFrame(s),null==o||o.appendChild(n.el),this.frame=s}},e.prototype.render=function(){var t=this,e=t.el,n=t.$el,r=t.ppfx,o=t.config,a=t.em;n.html(this.template());var s=n.find('[data-frames]');this.framesArea=s.get(0);var l=n.find('[data-tools]');return this.toolsWrapper=l.get(0),l.append("\n \n \n ")),this.toolsEl=e.querySelector("#".concat(r,"tools")),this.hlEl=e.querySelector(".".concat(r,"highlighter")),this.badgeEl=e.querySelector(".".concat(r,"badge")),this.placerEl=e.querySelector(".".concat(r,"placeholder")),this.ghostEl=e.querySelector(".".concat(r,"ghost")),this.toolbarEl=e.querySelector(".".concat(r,"toolbar")),this.resizerEl=e.querySelector(".".concat(r,"resizer")),this.offsetEl=e.querySelector(".".concat(r,"offset-v")),this.fixedOffsetEl=e.querySelector(".".concat(r,"offset-fixed-v")),this.toolsGlobEl=e.querySelector(".".concat(r,"tools-gl")),this.el.className=(0,i.getUiClass)(a,this.className),this.ready=!0,this._renderFrames(),this},e}(v.Z);const B=V;var H=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),z=void 0&&(void 0).__assign||function(){return z=Object.assign||function(t){for(var e,n=1,r=arguments.length;ni.top+i.height?i.top+i.height:d,left:f,elementTop:i.top,elementLeft:i.left,elementWidth:i.width,elementHeight:i.height,targetWidth:t.offsetWidth,targetHeight:t.offsetHeight,canvasTop:o.top,canvasLeft:o.left,canvasWidth:o.width,canvasHeight:o.height};return c&&this.em&&this.em.trigger(c,h),h}},e.prototype.canvasRectOffset=function(t,e,n){var r=this;void 0===n&&(n={});var o=function(t,e,o){void 0===e&&(e=1);var i=r.em.getZoomDecimal(),a=e?'top':'left',s=t.ownerDocument,l=n.offset?function(t){var e=t.defaultView;return null==e?void 0:e.frameElement}(s):{},c=l.offsetTop,u=void 0===c?0:c,p=l.offsetLeft,f=void 0===p?0:p,d=s.body||{},h=d.scrollTop,g=void 0===h?0:h,v=d.scrollLeft,m=e?g:void 0===v?0:v,y=e?u:f;return o[a]-(m-y)*i};return{top:o(t,1,e),left:o(t,0,e)}},e.prototype.getTargetToElementFixed=function(t,e,n){var o;void 0===n&&(n={});var i=n.pos||this.getElementPos(t),a=n.canvasOff||this.canvasRectOffset(t,i),s=e.offsetHeight||0,l=e.offsetWidth||0,c=i.left+i.width,u=this.getCanvasView(),p=u.getPosition(),f=u.getFrameOffset(t),d=n.event,h=-s,g=(0,r.isUndefined)(n.left)?i.width-l:n.left;g=i.left<-g?-i.left:g;var v=null!==(o=null==p?void 0:p.width)&&void 0!==o?o:0;g=c>v?g-(c-v):g;var m=i.height+s,y=m{"use strict";n.d(e,{Z:()=>f});var r,o=n(9050),i=n(7904),a=n(1163),s=void 0&&(void 0).__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=void 0&&(void 0).__assign||function(){return l=Object.assign||function(t){for(var e,n=1,r=arguments.length;n=0&&this.head.splice(o,1)},e.prototype.addLink=function(t){var e='link';!this.getHeadByAttr('href',t,e)&&this.addHeadItem({tag:e,attributes:{href:t,rel:'stylesheet'}})},e.prototype.removeLink=function(t){this.removeHeadByAttr('href',t,'link')},e.prototype.addScript=function(t){var e='script';!this.getHeadByAttr('src',t,e)&&this.addHeadItem({tag:e,attributes:{src:t}})},e.prototype.removeScript=function(t){this.removeHeadByAttr('src',t,'script')},e.prototype.getPage=function(){var t;return null===(t=this.collection)||void 0===t?void 0:t.page},e.prototype._emitUpdated=function(t){void 0===t&&(t={}),this.em.trigger('frame:updated',l({frame:this},t))},e.prototype.toJSON=function(t){void 0===t&&(t={});var e=i.Z.prototype.toJSON.call(this,t),n=(0,o.result)(this,'defaults');return t.fromUndo&&delete e.component,delete e.styles,delete e.changesCount,e[u]&&delete e.width,e[p]&&delete e.height,(0,o.forEach)(e,(function(t,n){0===n.indexOf('_')&&delete e[n]})),(0,o.forEach)(n,(function(t,n){e[n]===t&&delete e[n]})),(0,o.forEach)(['attributes','head'],(function(t){(0,o.isEmpty)(e[t])&&delete e[t]})),e},e}(i.Z)},3560:(t,e,n)=>{"use strict";n.d(e,{Z:()=>l});var r,o=n(9050),i=n(7116),a=n(6840),s=void 0&&(void 0).__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});const l=function(t){function e(e,n){void 0===n&&(n=[]);var r=t.call(this,e,n,a.Z)||this;return r.loadedItems=0,r.itemsToLoad=0,(0,o.bindAll)(r,'itemLoaded'),r.on('reset',r.onReset),r.on('remove',r.onRemove),r}return s(e,t),e.prototype.onReset=function(t,e){var n=this;((null==e?void 0:e.previousModels)||[]).map((function(t){return n.onRemove(t)}))},e.prototype.onRemove=function(t){null==t||t.onRemove()},e.prototype.itemLoaded=function(){this.loadedItems++,this.loadedItems>=this.itemsToLoad&&(this.trigger('loaded:all'),this.listenToLoadItems(!1))},e.prototype.listenToLoad=function(){this.loadedItems=0,this.itemsToLoad=this.length,this.listenToLoadItems(!0)},e.prototype.listenToLoadItems=function(t){var e=this;this.forEach((function(n){return n[t?'on':'off']('loaded',e.itemLoaded)}))},e}(i.Z)},7290:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>j});var r=n(9050);const o={stylePrefix:'cm-',inlineCss:!1};var i,a=n(2316),s=void 0&&(void 0).__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=void 0&&(void 0).__rest||function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o\n ","
\n
\n \n "],["\n \n "])),e,e,n,e,r,e)},e.prototype.initialize=function(t){this.config=t.config||{},this.pfx=this.config.stylePrefix},e.prototype.render=function(){var t=this,e=t.model,n=t.pfx,r=t.$el,o=e.toJSON();return o.pfx=n,r.html(this.template(o)),r.attr('class',"".concat(n,"editor-c")),r.find("#".concat(n,"code")).append(e.get('input')),this},e}(a.View);var k,S=n(6434),P=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),T='CodeMirror',E=function(t){function e(e){var n=t.call(this,e,'CodeManager',o)||this;n.EditorView=C;var r=n.config,i=r.pStylePrefix;return i&&(r.stylePrefix=i+r.stylePrefix),n.generators={},n.viewers={},n.defGenerators={html:new c,css:new u.Z,json:new f,js:new h},n.defViewers={CodeMirror:new w},n.loadDefaultGenerators().loadDefaultViewers(),n}return P(e,t),e.prototype.addGenerator=function(t,e){return this.generators[t]=e,this},e.prototype.getGenerator=function(t){return this.generators[t]},e.prototype.getGenerators=function(){return this.generators},e.prototype.addViewer=function(t,e){return this.viewers[t]=e,this},e.prototype.getViewer=function(t){return this.viewers[t]},e.prototype.getViewers=function(){return this.viewers},e.prototype.createViewer=function(t){void 0===t&&(t={});var e=(0,r.isUndefined)(t.type)?T:t.type,n=this.getViewer(e)&&this.getViewer(e).clone(),o=document.createElement('div'),i=document.createElement('textarea');return o.appendChild(i),n.set(t),n.init(i),n.setElement(o),n},e.prototype.updateViewer=function(t,e){t.setContent(e)},e.prototype.getCode=function(t,e,n){void 0===n&&(n={}),n.em=this.em;var r=this.getGenerator(e);return r?r.build(t,n):''},e.prototype.loadDefaultGenerators=function(){for(var t in this.defGenerators)this.addGenerator(t,this.defGenerators[t]);return this},e.prototype.loadDefaultViewers=function(){for(var t in this.defViewers)this.addViewer(t,this.defViewers[t]);return this},e.prototype.destroy=function(){},e}(S.Z);const j=E},782:(t,e,n)=>{"use strict";n.d(e,{U:()=>c,Z:()=>u});var r,o=n(9050),i=n(2316),a=n(1163),s=void 0&&(void 0).__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=Number.MAX_VALUE,c=function(t){var e=/(-?\d*\.?\d+)\w{0,}/.exec(t);return e?e[0]:''};const u=function(t){function e(){var e=t.call(this)||this;return(0,o.bindAll)(e,'sortRules'),e.compCls=[],e.ids=[],e}return s(e,t),e.prototype.buildFromModel=function(t,e){var n=this;void 0===e&&(e={});var r='',o=this.em,i=o&&o.getConfig().avoidInlineStyle,a=t.styleToString(),s=t.get('classes');return this.ids.push("#".concat(t.getId())),s.forEach((function(t){return n.compCls.push(t.getFullName())})),!i&&a&&(r="#".concat(t.getId(),"{").concat(a,"}")),t.components().forEach((function(t){return r+=n.buildFromModel(t,e)})),r},e.prototype.build=function(t,e){var n=this;void 0===e&&(e={});var r=e.json,i=e.em,s=e.cssc||(null==i?void 0:i.Css);this.em=i,this.compCls=[],this.ids=[],this.model=t;var l=[],c=t?this.buildFromModel(t,e):'',u=(0,o.isUndefined)(e.clearStyles)&&i?i.getConfig().clearStyles:e.clearStyles;if(s){var p=e.rules||s.getAll(),f={},d=[];e.onlyMatched&&t&&(0,a.hasWin)()&&(p=this.matchedRules(t,p)),p.forEach((function(t){var o=t.getAtRule();if(o){var i=f[o];i?i.push(t):f[o]=[t]}else{var a=n.buildFromRule(t,d,e);r?l.push(a):c+=a}})),this.sortMediaObject(f).forEach((function(t){var o='',i=t.key;t.value.forEach((function(t){var a=n.buildFromRule(t,d,e);t.get('singleAtRule')?c+="".concat(i,"{").concat(a,"}"):o+=a,r&&l.push(a)})),o&&(c+="".concat(i,"{").concat(o,"}"))})),i&&u&&p.remove&&p.remove(d)}return r?l.filter((function(t){return t})):c},e.prototype.buildFromRule=function(t,e,n){var r,o=this;void 0===n&&(n={});var i,a='',s=this.model,l=t.selectorsToString({skipAdd:1}),c=t.get('selectorsAdd'),u=t.get('singleAtRule');if(null===(r=t.get('selectors'))||void 0===r||r.forEach((function(t){var e=t.getFullName();(o.compCls.indexOf(e)>=0||o.ids.indexOf(e)>=0||n.keepUnusedStyles)&&(i=1)})),l&&i||c||u||!s){var p=t.getDeclaration({body:1});p&&(n.json?a=t:a+=p)}else e.push(t);return a},e.prototype.matchedRules=function(t,e){var n=this,r=t.getEl(),o=[];return e.forEach((function(t){try{t.selectorsToString().split(',').some((function(t){return r.matches(n.__cleanSelector(t))}))&&o.push(t)}catch(t){}})),t.components().forEach((function(t){o=o.concat(n.matchedRules(t,e))})),o=o.filter((function(t,e){return o.indexOf(t)===e}))},e.prototype.getQueryLength=function(t){var e=/(-?\d*\.?\d+)\w{0,}/.exec(t);return e?parseFloat(e[1]):l},e.prototype.sortMediaObject=function(t){var e=this;void 0===t&&(t={});var n=[];return(0,o.each)(t,(function(t,e){return n.push({key:e,value:t})})),n.sort((function(t,n){var r=[t.key,n.key].every((function(t){return-1!==t.indexOf('min-width')})),o=r?t.key:n.key,i=r?n.key:t.key;return e.getQueryLength(o)-e.getQueryLength(i)}))},e.prototype.sortRules=function(t,e){var n=function(t){return t.get('mediaText')||''},r=[n(t),n(e)].every((function(t){return-1!==t.indexOf('min-width')})),o=n(r?t:e),i=n(r?e:t);return this.getQueryLength(o)-this.getQueryLength(i)},e.prototype.__cleanSelector=function(t){return t.split(' ').map((function(t){return t.split(':')[0]})).join(' ')},e}(i.Model)},4048:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>S});var r=n(9050),o=n(1163),i=n(966),a=n(5963);const s={stylePrefix:'css-',rules:[]};var l,c=n(2316),u=n(1519),p=n(782),f=void 0&&(void 0).__extends||(l=function(t,e){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},l(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}l(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),d=void 0&&(void 0).__assign||function(){return d=Object.assign||function(t){for(var e,n=1,r=arguments.length;n=0}))},e.prototype.setIdRule=function(t,e,n){void 0===e&&(e={}),void 0===n&&(n={});var o=n.addOpts,i=void 0===o?{}:o,s=n.mediaText,l=n.state||'',c=(0,r.isUndefined)(s)?this.em.getCurrentMedia():s,u=this.em.get('SelectorManager').add({name:t,type:a.Z.TYPE_ID},i),p=this.add(u,l,c,{},i);return p.setStyle(e,O(O({},n),i)),p},e.prototype.getIdRule=function(t,e){void 0===e&&(e={});var n=e.mediaText,o=e.state||'',i=(0,r.isUndefined)(n)?this.em.getCurrentMedia():n,s=this.em.get('SelectorManager').get(t,a.Z.TYPE_ID);return s&&this.get(s,o,i)},e.prototype.setClassRule=function(t,e,n){void 0===e&&(e={}),void 0===n&&(n={});var r=n.state||'',o=n.mediaText||this.em.getCurrentMedia(),i=this.em.get('SelectorManager').add({name:t,type:a.Z.TYPE_CLASS}),s=this.add(i,r,o);return s.setStyle(e,n),s},e.prototype.getClassRule=function(t,e){void 0===e&&(e={});var n=e.state||'',r=e.mediaText||this.em.getCurrentMedia(),o=this.em.get('SelectorManager').get(t,a.Z.TYPE_CLASS);return o&&this.get(o,n,r)},e.prototype.remove=function(t,e){var n=(0,r.isString)(t)?this.getRules(t):t,o=this.getAll().remove(n,e);return(0,r.isArray)(o)?o:[o]},e.prototype.clear=function(t){return void 0===t&&(t={}),this.getAll().reset([],t),this},e.prototype.getComponentRules=function(t,e){void 0===e&&(e={});var n=e.state,o=e.mediaText;e.current&&(n=this.em.get('state')||'',o=this.em.getCurrentMedia());var i=t.getId();return this.getAll().filter((function(t){return!(!(0,r.isUndefined)(n)&&t.get('state')!==n)&&(!(!(0,r.isUndefined)(o)&&t.get('mediaText')!==o)&&t.getSelectorsString()==="#".concat(i))}))},e.prototype.render=function(){var t;return null===(t=this.rulesView)||void 0===t||t.remove(),this.rulesView=new w.Z({collection:this.rules,config:this.config}),this.rulesView.render().el},e.prototype.destroy=function(){var t;this.rules.reset(),this.rules.stopListening(),null===(t=this.rulesView)||void 0===t||t.remove()},e}(_.O);const S=k},9566:(t,e,n)=>{"use strict";n.d(e,{Z:()=>d});var r,o=n(9050),i=n(2316),a=n(8491),s=void 0&&(void 0).__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});const l=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this;n.config=e.config||{};var r=n.model;return n.listenTo(r,'change',n.render),n.listenTo(r,'destroy remove',n.remove),n.listenTo(r.get('selectors'),'change',n.render),n}return s(e,t),e.prototype.tagName=function(){return'style'},e.prototype.render=function(){var t=this.model,e=this.el,n=t.get('important');return e.innerHTML=t.toCSS({important:n}),this},e}(i.View);var c=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype._createElement=function(){return document.createTextNode('')},e.prototype.render=function(){var t=this.model,e=t.get('important');return this.el.textContent=t.getDeclaration({important:e}),this},e}(l);var p=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),f=function(t,e){return"".concat(t).concat(e?"-".concat(parseFloat(e)):'')};const d=function(t){function e(e){var n=t.call(this,e)||this;(0,o.bindAll)(n,'sortRules');var r=e.config||{};n.atRules={},n.config=r,n.em=r.em,n.pfx=r.stylePrefix||'',n.className=n.pfx+'rules';var i=n.collection;return n.listenTo(i,'add',n.addTo),n.listenTo(i,'reset',n.render),n}return p(e,t),e.prototype.addTo=function(t){this.addToCollection(t)},e.prototype.addToCollection=function(t,e){if(this.renderStarted){var n,r,o=e||null,i={model:t,config:this.config};if('keyframes'===t.get('atRuleType')){var a=t.getAtRule(),s=this.atRules[a];if(!s){var c=document.createElement('style');s=document.createTextNode(''),c.appendChild(document.createTextNode("".concat(a,"{"))),c.appendChild(s),c.appendChild(document.createTextNode('}')),this.atRules[a]=s,n=c}r=new u(i),s.appendData(r.render().el.textContent)}else n=(r=new l(i)).render().el;var p=this.className,d=t.get('mediaText'),h=f(p),g=h;if(d&&(g=f(p,this.getMediaWidth(d))),n){var v=o||this.el,m=void 0;try{m=v.querySelector("#".concat(g))}catch(t){}m||(m=v.querySelector("#".concat(h))),null==m||m.appendChild(n)}return n}},e.prototype.getMediaWidth=function(t){return t&&t.replace("(".concat(this.em.getConfig().mediaCondition,": "),'').replace(')','')},e.prototype.sortRules=function(t,e){var n=-1!==(this.em.getConfig().mediaCondition||'').indexOf('min-width');return n?(n?t:e)-(n?e:t):0},e.prototype.render=function(){var t=this;this.renderStarted=!0,this.atRules={};var e=this,n=e.em,r=e.$el,o=e.collection,i=this.className,s=document.createDocumentFragment();r.empty();var l=n.get('DeviceManager').getAll().pluck('priority').sort(this.sortRules);return l.every((function(t){return t}))&&l.unshift(0),l.forEach((function(t){return s.appendChild((0,a.ut)('div',{id:f(i,t)}))})),o.each((function(e){return t.addToCollection(e,s)})),r.append(s),r.attr('class',i),this},e}(i.View)},5241:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>M,evAdd:()=>k,evAddBefore:()=>S,evAll:()=>w,evPfx:()=>_,evRemove:()=>P,evRemoveBefore:()=>T,evSelect:()=>x,evSelectBefore:()=>O,evUpdate:()=>C});var r=n(9050),o=n(6434);const i={default:'',devices:[{id:'desktop',name:'Desktop',width:''},{id:'tablet',name:'Tablet',width:'770px',widthMedia:'992px'},{id:'mobileLandscape',name:'Mobile landscape',width:'568px',widthMedia:'768px'},{id:'mobilePortrait',name:'Mobile portrait',width:'320px',widthMedia:'480px'}]};var a,s=n(2316),l=void 0&&(void 0).__extends||(a=function(t,e){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},a(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});const c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return l(e,t),e.prototype.defaults=function(){return{name:'',width:null,height:'',widthMedia:null,priority:null}},e.prototype.initialize=function(){var t=this;null===this.get('widthMedia')&&this.set('widthMedia',this.get('width')),null===this.get('width')&&this.set('width',this.get('widthMedia')),!this.get('priority')&&this.set('priority',parseFloat(this.get('widthMedia'))||0);['width','height','widthMedia'].forEach((function(e){return t.checkUnit(e)}))},e.prototype.checkUnit=function(t){var e=this.get(t)||'';(parseFloat(e)||0).toString()===e.toString()&&this.set(t,"".concat(e,"px"))},e.prototype.getName=function(){return this.get('name')||this.get('id')},e.prototype.getWidthMedia=function(){return this.get('widthMedia')||''},e}(s.Model);var u=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return u(e,t),e}(s.Collection);const f=p;p.prototype.model=c;var d=n(7539),h=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),g=void 0&&(void 0).__makeTemplateObject||function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t};const v=function(t){function e(e){var n=t.call(this,e)||this;return n.config=e.config||{},n.em=n.config.em,n.ppfx=n.config.pStylePrefix||'',n.listenTo(n.em,'change:device',n.updateSelect),n}return h(e,t),e.prototype.template=function(t){var e=t.ppfx,n=t.label;return(0,d.Z)(m||(m=g(["\n ","
\n \n + \n "],["\n ","
\n \n + \n "])),e,n,e,e,e,e,e,e,e)},e.prototype.events=function(){return{change:'updateDevice','click [data-add-trasp]':'startAdd'}},e.prototype.startAdd=function(){},e.prototype.updateDevice=function(){var t=this.em;if(t){var e=this.devicesEl;t.set('device',e?e.val():'')}},e.prototype.updateSelect=function(){var t=this.em,e=this.devicesEl;if(t&&t.getDeviceModel&&e){var n=t.getDeviceModel();e.val(n?n.get('id'):'')}},e.prototype.getOptions=function(){var t=this.collection,e=this.em,n='';return t.forEach((function(t){var r=t.attributes,o=r.name,i=r.id,a=e&&e.t&&e.t("deviceManager.devices.".concat(i))||o;n+="").concat(a," ")})),n},e.prototype.render=function(){var t=this,e=t.em,n=t.ppfx,r=t.$el,o=t.el,i=e&&e.t&&e.t('deviceManager.device');return r.html(this.template({ppfx:n,label:i})),this.devicesEl=r.find(".".concat(n,"devices")),this.devicesEl.append(this.getOptions()),this.devicesEl.val(e.get('device')),o.className="".concat(n,"devices-c"),this},e}(s.View);var m,y=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),b=void 0&&(void 0).__assign||function(){return b=Object.assign||function(t){for(var e,n=1,r=arguments.length;n{"use strict";n.r(e),n.d(e,{default:()=>Ue});var r=n(9050);const o={stylePrefix:'comp-',components:[],draggableComponents:1,processor:0,voidElements:['area','base','br','col','embed','hr','img','input','keygen','link','menuitem','meta','param','source','track','wbr']};var i=n(9138),a=n(8431),s=n(2169),l=n(5671),c=n(3144),u=n(9340),p=n(2963),f=n(1120);function d(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,f.Z)(t);if(e){var o=(0,f.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,p.Z)(this,n)}}var h=function(t){(0,u.Z)(n,t);var e=d(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"tagName",value:function(){return'div'}}]),n}(s.Z),g=n(3505),v=n(4942),m=n(1752),y=n(1163);function b(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function w(t){for(var e=1;e=0};const O=s.Z.extend({});function C(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function k(t){for(var e=1;e\n \n "),fallback:"\n \n "),file:''})}},{key:"initialize",value:function(t,e){i.ZP.prototype.initialize.apply(this,arguments);var n=this.get('attributes'),o=n.src;o&&(0,y.buildBase64UrlFromSvg)((0,r.result)(this,'defaults').src)!==o&&this.set('src',o,{silent:1})}},{key:"initToolbar",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n0&&void 0!==arguments[0]?arguments[0]:{},e=this.get(t.fallback?'fallback':'src')||'',n=e;return e&&'0&&void 0!==arguments[0]?arguments[0]:'',e={},n=t.substring(1).split('&'),r=0;r1&&void 0!==arguments[1]?arguments[1]:{};if('a'===(0,y.toLowerCase)(t.tagName)){var o=n.textTags||[];e={type:_t,editable:!1};var i=t.childNodes,a=i.length;a||delete e.editable,(0,r.forEach)(i,(function(t){var n=t.tagName;(3==t.nodeType&&''!==t.textContent.trim()||n&&o.indexOf((0,y.toLowerCase)(n))>=0)&&delete e.editable}))}return e};var Ot=n(5861),Ct=n(4687),kt=n.n(Ct);function St(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Pt(t){for(var e=1;e2&&void 0!==arguments[2]?arguments[2]:{};!n.fromDisable&&this.disableEditing()}},{key:"canActivate",value:function(){var t,e=this.model,n=this.rteEnabled,r=this.em,o=(null==r?void 0:r.getEditing())===e,i=!0,a=!1;if((n||!e.get('editable')||o||(a=e.isChildOf('text')))&&(i=!1,a&&!e.get('textable'))){for(var s=e.parent();s&&!s.isInstanceOf('text');)s=s.parent();s&&s.get('editable')?t=s:i=!0}return{result:i,delegate:t}}},{key:"onActive",value:(n=(0,Ot.Z)(kt().mark((function t(e){var n,r,o,i,a,s,l;return kt().wrap((function(t){for(;1;)switch(t.prev=t.next){case 0:if(r=this.rte,o=this.em,i=this.canActivate(),a=i.result,s=i.delegate,a){t.next=5;break}return s&&(null==e||null===(l=e.stopPropagation)||void 0===l||l.call(e),o.setSelected(s),s.trigger('active',e)),t.abrupt("return");case 5:if(null==e||null===(n=e.stopPropagation)||void 0===n||n.call(e),this.lastContent=this.getContent(),!r){t.next=17;break}return t.prev=8,t.next=11,r.enable(this,this.activeRte,{event:e});case 11:this.activeRte=t.sent,t.next=17;break;case 14:t.prev=14,t.t0=t["catch"](8),o.logError(t.t0);case 17:this.toggleEvents(1);case 18:case"end":return t.stop()}}),t,this,[[8,14]])}))),function(t){return n.apply(this,arguments)})},{key:"onDisable",value:function(){this.disableEditing()}},{key:"disableEditing",value:(e=(0,Ot.Z)(kt().mark((function t(){var e,n,r,o,i,a,s=arguments;return kt().wrap((function(t){for(;1;)switch(t.prev=t.next){case 0:if(e=s.length>0&&void 0!==s[0]?s[0]:{},n=this.model,r=this.rte,o=this.activeRte,i=this.em,a=n&&n.get('editable'),!r){t.next=13;break}return t.prev=4,t.next=7,r.disable(this,o);case 7:t.next=12;break;case 9:t.prev=9,t.t0=t["catch"](4),i.logError(t.t0);case 12:a&&this.getContent()!==this.lastContent&&(this.syncContent(e),this.lastContent='');case 13:this.toggleEvents();case 14:case"end":return t.stop()}}),t,this,[[4,9]])}))),function(){return e.apply(this,arguments)})},{key:"getContent",value:function(){var t=this.activeRte;return t&&'function'==typeof t.getContent?t.getContent():this.getChildrenContainer().innerHTML}},{key:"syncContent",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.model,n=this.rte,r=this.rteEnabled;if(r||t.force){var o=this.getContent(),i=e.components(),a=Pt({fromDisable:1},t);e.set('content','',a),n.customRte?(i.length&&i.reset(null,t),e.set('content',o,a)):i.resetFromString(o,t)}}},{key:"insertComponent",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.model,r=this.el,o=r.ownerDocument,i=o.getSelection();if(null!=i&&i.rangeCount){var a,s=i.getRangeAt(0),l=s.startContainer,c=s.startOffset,u=(0,y.getModel)(l),p=[];if(u&&null!==(a=u.is)&&void 0!==a&&a.call(u,'textnode')){var f=u.collection;f.forEach((function(e){if(e===u){var n='textnode',r=e.get('content');p.push({type:n,content:r.slice(0,c)}),p.push(t),p.push({type:n,content:r.slice(c)})}else p.push(e)}));var d=p.filter(Boolean),h=d.indexOf(t);return f.reset(d,e),f.at(h)}}return n.append(t,e)}},{key:"onInput",value:function(){var t=this.em,e='component',n=["".concat(e,":update"),"".concat(e,":input")].join(' ');t&&t.trigger(n,this.model)}},{key:"disablePropagation",value:function(t){t.stopPropagation()}},{key:"toggleEvents",value:function(t){var e=this.em,n=this.model,r=this.$el,o={on:y.on,off:y.off},i=t?'on':'off';e.setEditing(t?this:0),this.rteEnabled=!!t;var a=[this.el.ownerDocument,document];if(o.off(a,'mousedown',this.onDisable),o[i](a,'mousedown',this.onDisable),e[i]('toolbar:run:before',this.onDisable),n&&(n[i]('removed',this.onDisable),n.trigger("rte:".concat(t?'enable':'disable'))),r&&r.off('mousedown',this.disablePropagation),r&&r[i]('mousedown',this.disablePropagation),this.config.draggableComponents)for(var s=this.el;s;)s.draggable=!t,(s=s.parentNode)&&'BODY'==s.tagName&&(s=0)}}]),i}(s.Z);function At(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,f.Z)(t);if(e){var o=(0,f.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,p.Z)(this,n)}}var Mt=function(t){(0,u.Z)(n,t);var e=At(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"render",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n1&&void 0!==arguments[1]?arguments[1]:{};return!!e.inSvg};var he=function(t){(0,u.Z)(n,t);var e=de(n);function n(){return(0,l.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"_createElement",value:function(t){return document.createElementNS('http://www.w3.org/2000/svg',t)}}]),n}(s.Z);function ge(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ve(t){for(var e=1;e-1;return Be(Be({},i),!u||p?{reason:2}:{result:!0})},e.prototype.allById=function(){return this.componentsById},e.prototype.getById=function(t){return this.componentsById[t]||null},e.prototype.destroy=function(){var t,e=this.allById();Object.keys(e).forEach((function(t){return e[t]&&e[t].remove()})),null===(t=this.componentView)||void 0===t||t.remove(),[this.em,this.componentsById,this.componentView].forEach((function(t){return{}}))},e}(Fe.O);const Ue=ze},1519:(t,e,n)=>{"use strict";n.d(e,{Z:()=>p});var r,o=n(9050),i=n(1163),a=n(8592),s=n(2316),l=void 0&&(void 0).__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),c=void 0&&(void 0).__assign||function(){return c=Object.assign||function(t){for(var e,n=1,r=arguments.length;n=0:i,s="".concat(n[r]).concat(a?' !important':''),l='__'==r.substr(0,2);s&&!l&&e.push("".concat(r,":").concat(s,";"))}return e.join('')},e.prototype.getSelectors=function(){return this.get('selectors')||this.get('classes')},e.prototype.getSelectorsString=function(t){return this.selectorsToString?this.selectorsToString(t):this.getSelectors().getFullString()},e}(s.Model)},1716:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>p});var r=n(9050),o=n(6434),i=n(1163),a={placeholder:'eg. Text here'};const s={locale:'en',localeFallback:'en',detectLocale:!0,debug:!1,messages:{en:{assetManager:{addButton:'Add image',inputPlh:'http://path/to/the/image.jpg',modalTitle:'Select Image',uploadTitle:'Drop files here or click to upload'},blockManager:{labels:{},categories:{}},domComponents:{names:{'':'Box',wrapper:'Body',text:'Text',comment:'Comment',image:'Image',video:'Video',label:'Label',link:'Link',map:'Map',tfoot:'Table foot',tbody:'Table body',thead:'Table head',table:'Table',row:'Table row',cell:'Table cell'}},deviceManager:{device:'Device',devices:{desktop:'Desktop',tablet:'Tablet',mobileLandscape:'Mobile Landscape',mobilePortrait:'Mobile Portrait'}},panels:{buttons:{titles:{preview:'Preview',fullscreen:'Fullscreen','sw-visibility':'View components','export-template':'View code','open-sm':'Open Style Manager','open-tm':'Settings','open-layers':'Open Layer Manager','open-blocks':'Open Blocks'}}},selectorManager:{label:'Classes',selected:'Selected',emptyState:'- State -',states:{hover:'Hover',active:'Click','nth-of-type(2n)':'Even/Odd'}},styleManager:{empty:'Select an element before using Style Manager',layer:'Layer',fileButton:'Images',sectors:{general:'General',layout:'Layout',typography:'Typography',decorations:'Decorations',extra:'Extra',flex:'Flex',dimension:'Dimension'},properties:{'text-shadow-h':'X','text-shadow-v':'Y','text-shadow-blur':'Blur','text-shadow-color':'Color','box-shadow-h':'X','box-shadow-v':'Y','box-shadow-blur':'Blur','box-shadow-spread':'Spread','box-shadow-color':'Color','box-shadow-type':'Type','margin-top-sub':'Top','margin-right-sub':'Right','margin-bottom-sub':'Bottom','margin-left-sub':'Left','padding-top-sub':'Top','padding-right-sub':'Right','padding-bottom-sub':'Bottom','padding-left-sub':'Left','border-width-sub':'Width','border-style-sub':'Style','border-color-sub':'Color','border-top-left-radius-sub':'Top Left','border-top-right-radius-sub':'Top Right','border-bottom-right-radius-sub':'Bottom Right','border-bottom-left-radius-sub':'Bottom Left','transform-rotate-x':'Rotate X','transform-rotate-y':'Rotate Y','transform-rotate-z':'Rotate Z','transform-scale-x':'Scale X','transform-scale-y':'Scale Y','transform-scale-z':'Scale Z','transition-property-sub':'Property','transition-duration-sub':'Duration','transition-timing-function-sub':'Timing','background-image-sub':'Image','background-repeat-sub':'Repeat','background-position-sub':'Position','background-attachment-sub':'Attachment','background-size-sub':'Size'}},traitManager:{empty:'Select an element before using Trait Manager',label:'Component settings',traits:{labels:{},attributes:{id:a,alt:a,title:a,href:{placeholder:'eg. https://google.com'}},options:{target:{false:'This window',_blank:'New window'}}}},storageManager:{recover:'Do you want to recover unsaved changes?'}}},messagesAdd:void 0};var l,c=void 0&&(void 0).__extends||(l=function(t,e){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},l(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}l(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),u=function(t){function e(e){var n=t.call(this,e,'I18n',s)||this,r=n.config.messagesAdd;return r&&n.addMessages(r),n.config.detectLocale&&(n.config.locale=n._localLang()),n}return c(e,t),e.prototype.getConfig=function(){return this.config},e.prototype.setLocale=function(t){var e=this.em,n=this.config,r={value:t,valuePrev:n.locale};return e&&e.trigger('i18n:locale',r),n.locale=t,this},e.prototype.getLocale=function(){return this.config.locale},e.prototype.getMessages=function(t,e){void 0===e&&(e={});var n=this.config.messages;return t&&!n[t]&&this._debug("'".concat(t,"' i18n lang not found"),e),t?n[t]:n},e.prototype.setMessages=function(t){var e=this.em;return this.config.messages=t,e&&e.trigger('i18n:update',t),this},e.prototype.addMessages=function(t){var e=this.em,n=this.config.messages;return e&&e.trigger('i18n:add',t),this.setMessages((0,i.deepMerge)(n,t)),this},e.prototype.t=function(t,e){void 0===e&&(e={});var n=this.config,o=e.params||{},i=e.l||this.getLocale(),a=e.lFlb||n.localeFallback,s=this._getMsg(t,i,e);return s||(s=this._getMsg(t,a,e)),!s&&this._debug("'".concat(t,"' i18n key not found in '").concat(i,"' lang"),e),s=s&&(0,r.isString)(s)?this._addParams(s,o):s},e.prototype._localLang=function(){var t=(0,i.hasWin)()&&window.navigator||{},e=t.language||t.userLanguage;return e?e.split('-')[0]:'en'},e.prototype._addParams=function(t,e){var n=new RegExp('{([\\w\\d-]*)}','g');return t.replace(n,(function(t,n){return e[n]||''})).trim()},e.prototype._getMsg=function(t,e,n){void 0===n&&(n={});var o=this.getMessages(e,n);if(o){var i=o[t];return!i&&t.indexOf('.')>0&&(i=t.split('.').reduce((function(t,e){if(!(0,r.isUndefined)(t))return t[e]}),o)),i}},e.prototype._debug=function(t,e){void 0===e&&(e={});var n=this.em,r=this.config;(e.debug||r.debug)&&n&&n.logWarning(t)},e.prototype.destroy=function(){},e}(o.Z);const p=u},4421:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>A});var r,o=n(9050),i=n(1163),a={},s={16:!1,18:!1,17:!1,91:!1},l='all',c={'⇧':16,shift:16,'⌥':18,alt:18,option:18,'⌃':17,ctrl:17,control:17,'⌘':91,command:91},u={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,home:36,end:35,pageup:33,pagedown:34,',':188,'.':190,'/':191,'`':192,'-':189,'=':187,';':186,"'":222,'[':219,']':221,'\\':220},p=function(t){return u[t]||t.toUpperCase().charCodeAt(0)},f=[];for(r=1;r<20;r++)u['f'+r]=111+r;function d(t,e){for(var n=t.length;n--;)if(t[n]===e)return n;return-1}function h(t,e){if(t.length!=e.length)return!1;for(var n=0;n=0&&f.splice(r,1),93!=n&&224!=n||(n=91),n in s)for(e in s[n]=!1,c)c[e]==n&&(b[e]=!1)}function y(){for(r in s)s[r]=!1;for(r in c)b[r]=!1}function b(t,e,n){var r,o;r=_(t),void 0===n&&(n=e,e='all');for(var i=0;i1&&(o=x(t),t=[t[t.length-1]]),t=t[0],(t=p(t))in a||(a[t]=[]),a[t].push({shortcut:r[i],scope:e,method:n,key:r[i],mods:o})}for(r in c)b[r]=!1;function w(){return l||'all'}function _(t){var e;return''==(e=(t=t.replace(/\s/g,'')).split(','))[e.length-1]&&(e[e.length-2]+=','),e}function x(t){for(var e=t.slice(0,t.length-1),n=0;n1&&(l=x(r)),t=r[r.length-1],t=p(t),void 0===e&&(e=w()),!a[t])return;for(o=0;o0,s)(!s[r]&&d(n.mods,+r)>-1||s[r]&&-1==d(n.mods,+r))&&(i=!1);(0!=n.mods.length||s[16]||s[18]||s[17]||s[91])&&!i||!1===n.method(t,n)&&(t.preventDefault?t.preventDefault():t.returnValue=!1,t.stopPropagation&&t.stopPropagation(),t.cancelBubble&&(t.cancelBubble=!0))}}(t)})),O(t.document,'keyup',m),O(t,'focus',y)};const C=b;var k=n(6434);const S={defaults:{'core:undo':{keys:'⌘+z, ctrl+z',handler:'core:undo'},'core:redo':{keys:'⌘+shift+z, ctrl+shift+z',handler:'core:redo'},'core:copy':{keys:'⌘+c, ctrl+c',handler:'core:copy'},'core:paste':{keys:'⌘+v, ctrl+v',handler:'core:paste'},'core:component-next':{keys:'s',handler:'core:component-next'},'core:component-prev':{keys:'w',handler:'core:component-prev'},'core:component-enter':{keys:'d',handler:'core:component-enter'},'core:component-exit':{keys:'a',handler:'core:component-exit'},'core:component-delete':{keys:'backspace, delete',handler:'core:component-delete',opts:{prevent:!0}}}};var P,T=void 0&&(void 0).__extends||(P=function(t,e){return P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},P(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}P(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),E=void 0&&(void 0).__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o{"use strict";n.r(e),n.d(e,{default:()=>m});var r=n(9050),o=n(6434),i=n(8491);const a={stylePrefix:'mdl-',title:'',content:'',backdrop:!0,custom:!1,extend:{}};var s,l=n(7904),c=void 0&&(void 0).__extends||(s=function(t,e){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},s(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});const u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.defaults=function(){return{title:'',content:'',attributes:{},open:!1}},e.prototype.open=function(){this.set('open',!0)},e.prototype.close=function(){this.set('open',!1)},e}(l.Z);var p=n(3059),f=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),d=void 0&&(void 0).__assign||function(){return d=Object.assign||function(t){for(var e,n=1,r=arguments.length;n\n \n \n \n
")},e.prototype.events=function(){return{click:'onClick','click [data-close-modal]':'hide'}},e.prototype.onClick=function(t){this.config.backdrop&&t.target===this.el&&this.hide()},e.prototype.getCollector=function(){return this.$collector||(this.$collector=this.$el.find('.'+this.pfx+'collector')),this.$collector},e.prototype.getContent=function(){var t=this.pfx;return this.$content||(this.$content=this.$el.find(".".concat(t,"content #").concat(t,"c"))),this.$content},e.prototype.getTitle=function(t){return void 0===t&&(t={}),this.$title||(this.$title=this.$el.find('.'+this.pfx+'title')),t.$?this.$title:this.$title.get(0)},e.prototype.updateContent=function(){var t=this.getContent(),e=t.children(),n=this.getCollector(),r=this.model.get('content');e.length&&n.append(e),t.empty().append(r)},e.prototype.updateTitle=function(){var t=this.getTitle({$:!0});t&&t.empty().append(this.model.get('title'))},e.prototype.updateOpen=function(){this.el.style.display=this.model.get('open')?'':'none'},e.prototype.hide=function(){this.model.close()},e.prototype.show=function(){this.model.open()},e.prototype.updateAttr=function(t){var e=this,n=e.pfx,r=e.$el,o=e.el,i=[].slice.call(o.attributes).map((function(t){return t.name}));r.removeAttr(i.join(' ')),r.attr(d(d({},t||{}),{class:"".concat(n,"container ").concat(t&&t.class||'').trim()}))},e.prototype.render=function(){var t=this.$el,e=this.model.toJSON();return e.pfx=this.pfx,e.ppfx=this.ppfx,t.html(this.template(e)),this.updateAttr(),this.updateOpen(),this},e}(p.Z);var g=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),v=function(t){function e(e){var n=t.call(this,e,'Modal',a)||this;return n.model=new u(n),n.model.on('change:open',(function(t,n){e.trigger("modal:".concat(n?'open':'close'))})),n.model.on('change',(0,r.debounce)((function(){var t=n._evData(),o=n.config.custom;(0,r.isFunction)(o)&&o(t),e.trigger('modal',t)}),0)),n}return g(e,t),e.prototype._evData=function(){var t=this,e=this.getTitle(),n=this.getContent(),o=this.model.attributes;return{open:o.open,attributes:o.attributes,title:(0,r.isString)(e)?(0,i.rw)(e):e,content:(0,r.isString)(n)?(0,i.rw)(n):n.get?n.get(0):n,close:function(){return t.close()}}},e.prototype.postRender=function(t){var e=t.model.config.el||t.el,n=this.render();n&&(null==e||e.appendChild(n))},e.prototype.open=function(t){void 0===t&&(t={});var e=t.attributes||{};return t.title&&this.setTitle(t.title),t.content&&this.setContent(t.content),this.model.set('attributes',e),this.model.open(),this.modal&&this.modal.updateAttr(e),this},e.prototype.close=function(){return this.model.close(),this},e.prototype.onceClose=function(t){return this.em.once('modal:close',t),this},e.prototype.onceOpen=function(t){return this.em.once('modal:open',t),this},e.prototype.isOpen=function(){return!!this.model.get('open')},e.prototype.setTitle=function(t){return this.model.set('title',t),this},e.prototype.getTitle=function(){return this.model.get('title')},e.prototype.setContent=function(t){return this.model.set('content',' '),this.model.set('content',t),this},e.prototype.getContent=function(){return this.model.get('content')},e.prototype.getContentEl=function(){var t;return null===(t=this.modal)||void 0===t?void 0:t.getContent().get(0)},e.prototype.getModel=function(){return this.model},e.prototype.render=function(){var t;if(!this.config.custom){var e=h.extend(this.config.extend),n=this.modal&&this.modal.el;return this.modal=new e({el:n,model:this.model,config:this.config}),null===(t=this.modal)||void 0===t?void 0:t.render().el}},e.prototype.destroy=function(){var t;null===(t=this.modal)||void 0===t||t.remove()},e}(o.Z);const m=v},7892:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>j,evAll:()=>_,evComponent:()=>C,evCustom:()=>k,evPfx:()=>x,evRoot:()=>O});var r=n(9050),o=n(7904),i=n(6434),a=n(1163);const s={stylePrefix:'',appendTo:'',sortable:!0,hidable:!0,hideTextnode:!0,root:'',showWrapper:!0,showHover:!0,scrollCanvas:{behavior:'smooth',block:'nearest'},scrollLayers:{behavior:'auto',block:'nearest'},highlightHover:!0,custom:!1,onInit:function(){},onRender:function(){},extend:{}};var l,c=n(2316),u=n(2169),p=n(9138),f=void 0&&(void 0).__extends||(l=function(t,e){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},l(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}l(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),d=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this;n.items=[],n.opt=e;var r=e.config||{};n.config=r,n.parentView=e.parentView;var o=r.stylePrefix||'',i=r.pStylePrefix||'',a=n.collection;n.listenTo(a,'add',n.addTo),n.listenTo(a,'reset resetNavigator',n.render),n.listenTo(a,'remove',n.removeChildren),n.className="".concat(o,"layers");var s=r.em;if(r.sortable&&!n.opt.sorter){var l=s.get('Utils');n.opt.sorter=new l.Sorter({container:r.sortContainer||n.el,containerSel:".".concat(n.className),itemSel:".".concat(o,"layer"),ignoreViewChildren:1,onEndMove:function(t,e,n){var r=e.getSourceModel();s.setSelected(r,{forceChange:1}),s.trigger("".concat(p.OA,":end"),n)},avoidSelectOnEnd:1,nested:1,ppfx:i,pfx:o})}return n.$el.data('collection',a),e.parent&&n.$el.data('model',e.parent),n}return f(e,t),e.prototype.removeChildren=function(t){var e=t.viewLayer;e&&(e.remove(),delete t.viewLayer)},e.prototype.addTo=function(t){var e=this.collection.indexOf(t);this.addToCollection(t,null,e)},e.prototype.addToCollection=function(t,e,n){var r=this,o=r.parentView,i=r.opt,a=r.config,s=i.ItemView,l=i.opened,c=i.module,u=e||null,p=new s({ItemView:s,level:i.level,model:t,parentView:o,config:a,sorter:i.sorter,opened:l,module:c}),f=p.render().el;if(u)u.appendChild(f);else if(void 0!==n){var d='before';this.$el.children().length==n&&(n--,d='after'),n<0?this.$el.append(f):this.$el.children().eq(n)[d](f)}else this.$el.append(f);return this.items.push(p),f},e.prototype.remove=function(){for(var t=[],e=0;e\n ").concat(x," \n ").concat(O," \n "):'',"\n \n
\n
\n ").concat(C," \n ").concat(y?"").concat(y," "):'',"\n ").concat(m," \n
\n
\n
\n ").concat(u||'',"
\n ").concat(_||'',"
\n
")},Object.defineProperty(e.prototype,"em",{get:function(){return this.module.em},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ppfx",{get:function(){return this.em.getConfig().stylePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pfx",{get:function(){return this.config.stylePrefix},enumerable:!1,configurable:!0}),e.prototype.initComponent=function(){var t=this,e=this.model,n=this.config.onInit,r=e.components();this.listenTo(r,'remove add reset',this.checkChildren),[['change:status',this.updateStatus],['change:open',this.updateOpening],['change:layerable',this.updateLayerable],['change:style:display',this.updateVisibility],['rerender:layer',this.render],['change:name change:custom-name',this.updateName]].forEach((function(n){return t.listenTo(e,n[0],n[1])})),this.$el.data('model',e),this.$el.data('collection',r),e.viewLayer=this,n.bind(this)({component:e,render:this.__render,listenTo:this.listenTo})},e.prototype.updateName=function(){this.getInputName().innerText=this.model.getName()},e.prototype.getVisibilityEl=function(){return this.eyeEl||(this.eyeEl=this.$el.children(".".concat(this.pfx,"layer-vis"))),this.eyeEl},e.prototype.updateVisibility=function(){var t=this,e=t.pfx,n=t.model,r=t.module,o="".concat(e,"layer-hidden"),i=!r.isVisible(n)?'addClass':'removeClass';this.$el[i](o),this.getVisibilityEl()[i]("".concat(e,"layer-off"))},e.prototype.toggleVisibility=function(t){null==t||t.stopPropagation();var e=this.module,n=this.model;e.setVisible(n,!e.isVisible(n))},e.prototype.handleEdit=function(t){null==t||t.stopPropagation();var e=this,n=e.em,r=e.$el,o=e.clsNoEdit,i=e.clsEdit,a=this.getInputName();a[v]='true',a.focus(),document.execCommand('selectAll',!1),n.setEditing(!0),r.find(".".concat(this.inputNameCls)).removeClass(o).addClass(i)},e.prototype.handleEditKey=function(t){t.stopPropagation(),((0,a.isEscKey)(t)||(0,a.isEnterKey)(t))&&this.handleEditEnd(t)},e.prototype.handleEditEnd=function(t){null==t||t.stopPropagation();var e=this,n=e.em,r=e.$el,o=e.clsNoEdit,i=e.clsEdit,a=this.getInputName(),s=a.textContent;a.scrollLeft=0,a[v]='false',this.setName(s,{component:this.model,propName:'custom-name'}),n.setEditing(!1),r.find(".".concat(this.inputNameCls)).addClass(o).removeClass(i),this.updateName()},e.prototype.setName=function(t,e){var n=e.propName;this.model.set(n,t)},e.prototype.getInputName=function(){return this.inputName||(this.inputName=this.el.querySelector(".".concat(this.inputNameCls))),this.inputName},e.prototype.updateOpening=function(){var t=this,e=t.$el,n=t.model,r=t.pfx,o='open',i="".concat(r,"layer-open"),a=this.getCaret();this.module.isOpen(n)?(e.addClass(o),a.addClass(i)):(e.removeClass(o),a.removeClass(i))},e.prototype.toggleOpening=function(t){var e=this.model,n=this.module;null==t||t.stopImmediatePropagation(),e.get('components').length&&n.setOpen(e,!n.isOpen(e))},e.prototype.handleSelect=function(t){null==t||t.stopPropagation();var e=this.module,n=this.model;e.setLayerData(n,{selected:!0},{event:t})},e.prototype.handleHover=function(t){null==t||t.stopPropagation();var e=this.module,n=this.model;e.setLayerData(n,{hovered:!0})},e.prototype.handleHoverOut=function(t){null==t||t.stopPropagation();var e=this.module,n=this.model;e.setLayerData(n,{hovered:!1})},e.prototype.startSort=function(t){t.stopPropagation();var e=this.em,n=this.sorter;t.button&&0!==t.button||n&&(n.onStart=function(t){return e.trigger("".concat(p.OA,":start"),t)},n.onMoveClb=function(t){return e.trigger(p.OA,t)},n.startSort(t.target))},e.prototype.updateStatus=function(){u.Z.prototype.updateStatus.apply(this,[{avoidHover:!this.config.highlightHover,noExtHl:1}])},e.prototype.checkChildren=function(){var t=this,e=t.model,n=t.clsNoChild,r=t.$el,o=t.module,i=o.getComponents(e).length,a=r.children(".".concat(this.clsTitleC)).children(".".concat(this.clsTitle)),s=this.cnt;s||(s=r.children('[data-count]').get(0),this.cnt=s),a[i?'removeClass':'addClass'](n),s&&(s.innerHTML=i||''),!i&&o.setOpen(e,!1)},e.prototype.getCaret=function(){return this.caret&&this.caret.length||(this.caret=this.$el.children(".".concat(this.clsTitleC)).find(".".concat(this.clsCaret))),this.caret},e.prototype.setRoot=function(t){t=(0,r.isString)(t)?this.em.getWrapper().find(t)[0]:t;var e=(0,a.getModel)(t,0);e&&(this.stopListening(),this.model=e,this.initComponent(),this._rendered&&this.render())},e.prototype.updateLayerable=function(){(this.parentView||this).render()},e.prototype.__clearItems=function(){var t;null===(t=this.items)||void 0===t||t.remove()},e.prototype.remove=function(){for(var t=[],e=0;e{"use strict";n.r(e),n.d(e,{default:()=>E,evAll:()=>v,evPageAdd:()=>_,evPageAddBefore:()=>x,evPageRemove:()=>O,evPageRemoveBefore:()=>C,evPageSelect:()=>y,evPageSelectBefore:()=>b,evPageUpdate:()=>w,evPfx:()=>m});var r,o=n(9050),i=n(1163),a=n(7904),s=n(6434),l=n(2316),c=n(3560),u=void 0&&(void 0).__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});const p=function(t){function e(e,n){void 0===n&&(n={});var r=t.call(this,e,n)||this,o=n.em,i={};r.em=o,e.frames||(i.component=e.component,i.styles=e.styles,['component','styles'].map((function(t){return r.unset(t)})));var a=e.frames||[i],s=new c.Z(o.get('Canvas'),a);s.page=r,r.set('frames',s),!r.getId()&&r.set('id',null==o?void 0:o.get('PageManager')._createId());var l=null==o?void 0:o.get('UndoManager');return null==l||l.add(s),r}return u(e,t),e.prototype.defaults=function(){return{frames:[],_undo:!0}},e.prototype.onRemove=function(){this.getFrames().reset()},e.prototype.getFrames=function(){return this.get('frames')},e.prototype.getId=function(){return this.id},e.prototype.getName=function(){return this.get('name')},e.prototype.setName=function(t){return this.set({name:t})},e.prototype.getAllFrames=function(){return this.getFrames().models||[]},e.prototype.getMainFrame=function(){return this.getFrames().at(0)},e.prototype.getMainComponent=function(){var t=this.getMainFrame();return null==t?void 0:t.getComponent()},e.prototype.toJSON=function(t){void 0===t&&(t={});var e=l.Model.prototype.toJSON.call(this,t),n=(0,o.result)(this,'defaults');return(0,o.forEach)(e,(function(t,n){0===n.indexOf('_')&&delete e[n]})),(0,o.forEach)(n,(function(t,n){e[n]===t&&delete e[n]})),e},e}(l.Model);var f=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),d=void 0&&(void 0).__assign||function(){return d=Object.assign||function(t){for(var e,n=1,r=arguments.length;n{"use strict";n.r(e),n.d(e,{default:()=>V});var r=n(6434),o='sw-visibility',i='export-template',a='open-sm',s='open-tm',l='open-layers',c='open-blocks',u='fullscreen',p='preview';const f={stylePrefix:'pn-',defaults:[{id:'commands',buttons:[{}]},{id:'options',buttons:[{active:!0,id:o,className:'fa fa-square-o',command:'core:component-outline',context:o,attributes:{title:'View components'}},{id:p,className:'fa fa-eye',command:p,context:p,attributes:{title:'Preview'}},{id:u,className:'fa fa-arrows-alt',command:u,context:u,attributes:{title:'Fullscreen'}},{id:i,className:'fa fa-code',command:i,attributes:{title:'View code'}}]},{id:'views',buttons:[{id:a,className:'fa fa-paint-brush',command:a,active:!0,togglable:!1,attributes:{title:'Open Style Manager'}},{id:s,className:'fa fa-cog',command:s,togglable:!1,attributes:{title:'Settings'}},{id:l,className:'fa fa-bars',command:l,togglable:!1,attributes:{title:'Open Layer Manager'}},{id:c,className:'fa fa-th-large',command:c,togglable:!1,attributes:{title:'Open Blocks'}}]}]};var d,h=n(7116),g=n(7904),v=void 0&&(void 0).__extends||(d=function(t,e){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},d(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}d(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});const m=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.get('buttons').length&&r.set('buttons',new w(r.module,r.get('buttons'))),r}return v(e,t),e.prototype.defaults=function(){return{id:'',label:'',tagName:'span',className:'',command:'',context:'',buttons:[],attributes:{},options:{},active:!1,dragDrop:!1,togglable:!0,runDefaultCommand:!0,stopDefaultCommand:!1,disable:!1}},Object.defineProperty(e.prototype,"className",{get:function(){return this.get('className')},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"command",{get:function(){return this.get('command')},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"active",{get:function(){return this.get('active')},set:function(t){this.set('active',t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"togglable",{get:function(){return this.get('togglable')},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"runDefaultCommand",{get:function(){return this.get('runDefaultCommand')},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stopDefaultCommand",{get:function(){return this.get('stopDefaultCommand')},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"disable",{get:function(){return this.get('disable')},enumerable:!1,configurable:!0}),e}(g.Z);var y=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),b=function(t){function e(e,n){return t.call(this,e,n,m)||this}return y(e,t),e.prototype.deactivateAllExceptOne=function(t,e){this.forEach((function(n,r){n!==t&&(n.set('active',!1),e&&n.get('buttons').length&&n.get('buttons').deactivateAllExceptOne(t,e))}))},e.prototype.deactivateAll=function(t,e){var n=t||'';this.forEach((function(t){t.get('context')==n&&t!==e&&t.set('active',!1,{fromCollection:!0})}))},e.prototype.disableAllButtons=function(t){var e=t||'';this.forEach((function(t,n){t.get('context')==e&&t.set('disable',!0)}))},e.prototype.disableAllButtonsExceptOne=function(t,e){this.forEach((function(n,r){n!==t&&(n.set('disable',!0),e&&n.get('buttons').length&&n.get('buttons').disableAllButtonsExceptOne(t,e))}))},e}(h.Z);const w=b;b.prototype.model=m;var _=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();const x=function(t){function e(e,n){var r=t.call(this,e,n)||this,o=r.get('buttons')||[];return r.buttons=new w(e,o),r}return _(e,t),e.prototype.defaults=function(){return{id:'',content:'',visible:!0,buttons:[],attributes:{}}},Object.defineProperty(e.prototype,"buttons",{get:function(){return this.get('buttons')},set:function(t){this.set('buttons',t)},enumerable:!1,configurable:!0}),e}(g.Z);var O=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),C=function(t){function e(e,n){return t.call(this,e,n,x)||this}return O(e,t),e}(h.Z);const k=C;C.prototype.model=x;var S=n(3059),P=n(9050),T=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),E=void 0&&(void 0).__assign||function(){return E=Object.assign||function(t){for(var e,n=1,r=arguments.length;n{"use strict";n.r(e),n.d(e,{default:()=>w});var r=n(6434);const o={textTags:['br','b','i','u','a','ul','ol'],parserCss:void 0,parserHtml:void 0,optionsHtml:{htmlType:'text/html',allowScripts:!1,allowUnsafeAttr:!1,keepEmptyTextNodes:!1}};var i=n(9050),a={4:'media',5:'font-face',6:'page',7:'keyframes',11:'counter-style',12:'supports',13:'document',14:'font-feature-values',15:'viewport'},s=(0,i.keys)(a),l=['5','6','11','15'],c=['font-face','page','counter-style','viewport'],u=function(t){void 0===t&&(t='');for(var e=[],n=[],r=t.split(','),o=0,i=r.length;o=0&&(r.singleAtRule=!0),l&&(r.atRuleType=l),u&&(r.selectorsAdd=u),p&&(r.mediaText=p),s&&(t[o-1]=a[0],r.state=s,a.splice(a.length-1,1)),r.selectors=t,r.style=e,r},h=function(t){for(var e=[],n=t.cssRules||[],r=0,o=n.length;r=0;if(b)g=!0,v=a[c],m=f(i);else if(s.indexOf(c)>=0){var w=h(i);m=f(i);for(var _=0,x=w.length;_{"use strict";n.d(e,{Z:()=>c});var r=n(9050),o='text/html',i=o;var a=void 0&&(void 0).__assign||function(){return a=Object.assign||function(t){for(var e,n=1,r=arguments.length;n '!=="".concat(l.outerHTML).slice(-2)||(h.void=!0);var P=h.components;if(!h.type&&P){for(var T=1,E=0,j=0;j".concat(t,""),u=a.parseFromString(c,s);if(l){var p=u.head,f=u.body,d=p.querySelectorAll('script');(0,r.each)(d,(function(t){return f.appendChild(t)}));var h=[];(0,r.each)(p.children,(function(t){return h.push(t)})),(0,r.each)(h,(function(t,e){return f.insertBefore(t,f.children[e])})),n=f}else n=u.firstChild;return n}(n,h),v=g.querySelectorAll('script'),m=v.length;if(!((0,r.isUndefined)(p.allowScripts)?h.allowScripts:p.allowScripts))for(;m--;)v[m].parentNode.removeChild(v[m]);if(h.allowUnsafeAttr||this.__clearUnsafeAttr(g),s){for(var y=g.querySelectorAll('style'),b=y.length,w='';b--;)w=y[b].innerHTML+w,y[b].parentNode.removeChild(y[b]);w&&(f.css=s.parse(w))}t&&t.trigger("".concat(l,":root"),{input:n,root:g});var _=this.parseNode(g,d),x=1!==_.length||d.returnArray?_:_[0];return f.html=x,t&&t.trigger(l,{input:n,output:f}),f},__clearUnsafeAttr:function(t){var e=this,n=t.attributes||[],o=t.childNodes||[],i=[];(0,r.each)(n,(function(t){var e=t.nodeName||'';0===e.indexOf('on')&&i.push(e)})),i.map((function(e){return t.removeAttribute(e)})),(0,r.each)(o,(function(t){return e.__clearUnsafeAttr(t)}))}}}},4661:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>C});var r=n(1163),o=n(9050),i=void 0&&(void 0).__assign||function(){return i=Object.assign||function(t){for(var e,n=1,r=arguments.length;nB',attributes:{title:'Bold'},result:function(t){return t.exec('bold')}},italic:{name:'italic',icon:'I ',attributes:{title:'Italic'},result:function(t){return t.exec('italic')}},underline:{name:'underline',icon:'U ',attributes:{title:'Underline'},result:function(t){return t.exec('underline')}},strikethrough:{name:'strikethrough',icon:'S ',attributes:{title:'Strike-through'},result:function(t){return t.exec('strikeThrough')}},link:{icon:"\n \n ",name:'link',attributes:{style:'font-size:1.4rem;padding:0 4px 2px;',title:'Link'},state:function(t){return t&&t.selection()&&u(t)?s:l},result:function(t){u(t)?t.exec('unlink'):t.insertHTML("").concat(t.selection()," "),{select:!0})}},wrap:{name:'wrap',icon:"\n \n ",attributes:{title:'Wrap for style'},state:function(t){return(null==t?void 0:t.selection())&&u(t,'SPAN')?c:l},result:function(t){!u(t,'SPAN')&&t.insertHTML("").concat(t.selection()," "),{select:!0})}}};const d=function(){function t(t,e,n){void 0===n&&(n={});var r=this;if(this.em=t,this.settings=n,e[a])return e[a];e[a]=this,this.setEl(e),this.updateActiveActions=this.updateActiveActions.bind(this),this.__onKeydown=this.__onKeydown.bind(this),this.__onPaste=this.__onPaste.bind(this);var s=(n.actions||[]).map((function(t){var e=t;return(0,o.isString)(t)?e=i({},f[t]):f[t.name]&&(e=i(i({},f[t.name]),t)),e})),l=s.length?s:Object.keys(f).map((function(t){return f[t]}));n.classes=i({actionbar:'actionbar',button:'action',active:'active',disabled:'disabled',inactive:'inactive'},n.classes);var c=n.classes,u=n.actionbar;if(this.actionbar=u,this.classes=c,this.actions=l,!u){var p=n.actionbarContainer;(u=document.createElement('div')).className=c.actionbar,null==p||p.appendChild(u),this.actionbar=u,l.forEach((function(t){return r.addAction(t)}))}return n.styleWithCSS&&this.exec('styleWithCSS'),this}return t.prototype.destroy=function(){},t.prototype.setEl=function(t){this.el=t,this.doc=t.ownerDocument},t.prototype.updateActiveActions=function(){var t=this;this.getActions().forEach((function(e){var n=e.update,r=e.btn,o=t.classes,i=o.active,a=o.inactive,u=o.disabled,p=e.state,f=e.name,d=t.doc;if(r.className=r.className.replace(i,'').trim(),r.className=r.className.replace(a,'').trim(),r.className=r.className.replace(u,'').trim(),p)switch(p(t,d)){case s:r.className+=" ".concat(i);break;case l:r.className+=" ".concat(a);break;case c:r.className+=" ".concat(u)}else d.queryCommandSupported(f)&&d.queryCommandState(f)&&(r.className+=" ".concat(i));null==n||n(t,e)}))},t.prototype.enable=function(t){return this.enabled?this:this.__toggleEffects(!0,t)},t.prototype.disable=function(){return this.__toggleEffects(!1)},t.prototype.__toggleEffects=function(t,e){void 0===t&&(t=!1),void 0===e&&(e={});var n=t?r.on:r.off,o=this.el,i=this.doc;if(this.actionbarEl().style.display=t?'':'none',o.contentEditable="".concat(!!t),n(o,'mouseup keyup',this.updateActiveActions),n(i,'keydown',this.__onKeydown),n(i,'paste',this.__onPaste),this.enabled=t,t){var a=e.event;if(this.syncActions(),this.updateActiveActions(),a){var s=null;if(i.caretRangeFromPoint){var l=(0,r.getPointerEvent)(a);s=i.caretRangeFromPoint(l.clientX,l.clientY)}else a.rangeParent&&(s=i.createRange()).setStart(a.rangeParent,a.rangeOffset);var c=i.getSelection();null==c||c.removeAllRanges(),s&&(null==c||c.addRange(s))}o.focus()}return this},t.prototype.__onKeydown=function(t){var e=t,n=this.doc;'Enter'!==e.key||['insertOrderedList','insertUnorderedList'].some((function(t){return n.queryCommandState(t)}))||(n.execCommand('insertLineBreak'),e.preventDefault())},t.prototype.__onPaste=function(t){var e=t.clipboardData||window.clipboardData,n=e.getData('text'),r=e.getData('text/html');if(n&&!r){t.preventDefault();var o=n.replace(/(?:\r\n|\r|\n)/g,' ');this.doc.execCommand('insertHTML',!1,o)}},t.prototype.syncActions=function(){var t=this;this.getActions().forEach((function(e){if(t.actionbar&&(!e.state||e.state&&e.state(t,t.doc)>=0)){var n=e.event||'click';e.btn["on".concat(n)]=function(){e.result(t,e),t.updateActiveActions()}}}))},t.prototype.addAction=function(t,e){void 0===e&&(e={});var n=e.sync,r=document.createElement('span'),o=t.icon,i=t.attributes||{};for(var a in r.className=this.classes.button,t.btn=r,i)r.setAttribute(a,i[a]);'string'==typeof o?r.innerHTML=o:r.appendChild(o),this.actionbarEl().appendChild(r),n&&(this.actions.push(t),this.syncActions())},t.prototype.getActions=function(){return this.actions},t.prototype.selection=function(){return this.doc.getSelection()},t.prototype.exec=function(t,e){this.doc.execCommand(t,!1,e)},t.prototype.actionbarEl=function(){return this.actionbar},t.prototype.insertHTML=function(t,e){var n=(void 0===e?{}:e).select,i=this,a=i.em,s=i.doc,l=i.el,c=s.getSelection();if(c&&c.rangeCount){var u=(0,r.getModel)(l),f=s.createElement('div'),d=c.getRangeAt(0);d.deleteContents(),(0,o.isString)(t)?f.innerHTML=t:t&&f.appendChild(t),Array.prototype.slice.call(f.childNodes).forEach((function(t){d.insertNode(t)})),c.removeAllRanges(),c.addRange(d),l.focus(),n&&u&&(u.once('rte:disable',(function(){var t=u.find("[".concat(p,"]"))[0];t&&(a.setSelected(t),t.removeAttributes(p))})),u.trigger('disable'))}},t}();const h={stylePrefix:'rte-',adjustToolbar:!0,actions:['bold','italic','underline','strikethrough','link','wrap']};var g,v=n(6434),m=n(8491),y=void 0&&(void 0).__extends||(g=function(t,e){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},g(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}g(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),b=void 0&&(void 0).__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{l(r.next(t))}catch(t){i(t)}}function s(t){try{l(r["throw"](t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},w=void 0&&(void 0).__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r["return"]:i[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]{"use strict";n.r(e),n.d(e,{default:()=>U,evAdd:()=>N,evAll:()=>R,evCustom:()=>B,evPfx:()=>Z,evRemove:()=>F,evRemoveBefore:()=>V,evState:()=>H,evUpdate:()=>I});var r=n(9050),o=n(1163),i=n(9714),a=n(2316);const s={stylePrefix:'clm-',appendTo:'',selectors:[],states:[{name:'hover'},{name:'active'},{name:'nth-of-type(2n)'}],iconAdd:' ',iconSync:' ',iconTagOn:' ',iconTagOff:' ',iconTagRemove:' ',componentFirst:!1,custom:!1};var l,c=n(5963),u=n(966),p=void 0&&(void 0).__extends||(l=function(t,e){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},l(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}l(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return p(e,t),e.prototype.defaults=function(){return{name:'',label:''}},e.prototype.getName=function(){return this.get('name')},e.prototype.getLabel=function(){return this.get('label')||this.getName()},e}(a.Model);const d=f;f.prototype.idAttribute='name';var h=n(7539),g=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),v=void 0&&(void 0).__makeTemplateObject||function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t},m='contentEditable',y=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this,r=e.config||{};return n.config=r,n.module=e.module,n.coll=e.coll||null,n.pfx=r.stylePrefix||'',n.ppfx=r.pStylePrefix||'',n.em=r.em,n.listenTo(n.model,'change:active',n.updateStatus),n}return g(e,t),e.prototype.template=function(){var t=this,e=t.pfx,n=t.model,r=t.config,o=n.get('label')||'';return(0,h.Z)(w||(w=v(["\n \n "," \n $"," \n "],["\n \n "," \n $"," \n "])),e,e,e,o,e,e,r.iconTagRemove)},e.prototype.events=function(){return{'click [data-tag-remove]':'removeTag','click [data-tag-status]':'changeStatus','dblclick [data-tag-name]':'startEditTag','focusout [data-tag-name]':'endEditTag'}},e.prototype.getInputEl=function(){return this.inputEl||(this.inputEl=this.el.querySelector('[data-tag-name]')),this.inputEl},e.prototype.startEditTag=function(){var t=this.em,e=this.getInputEl();e[m]='true',e.focus(),t&&t.setEditing(1)},e.prototype.endEditTag=function(){var t=this.model,e=this.getInputEl(),n=e.textContent,r=this.em,o=r&&r.get('SelectorManager');if(e[m]='false',r&&r.setEditing(0),o){var i=o.escapeName(n);o.get(i)?e.innerText=t.get('label'):t.set({name:i,label:n})}},e.prototype.changeStatus=function(){var t=this.model;t.set('active',!t.get('active'))},e.prototype.removeTag=function(){this.module.removeSelected(this.model)},e.prototype.updateStatus=function(){var t=this,e=t.model,n=t.$el,r=t.config,o=r.iconTagOn,i=r.iconTagOff,a=n.find('[data-tag-status]');e.get('active')?(a.html(o),n.removeClass('opac50')):(a.html(i),n.addClass('opac50'))},e.prototype.render=function(){var t=this.pfx,e=this.ppfx;return this.$el.html(this.template()),this.$el.attr('class',"".concat(t,"tag ").concat(e,"three-bg")),this.updateStatus(),this},e}(a.View);const b=y;var w,_=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),x=void 0&&(void 0).__makeTemplateObject||function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t},O=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this;n.config=e.config||{},n.pfx=n.config.stylePrefix||'',n.ppfx=n.config.pStylePrefix||'',n.className=n.pfx+'tags',n.stateInputId=n.pfx+'states',n.stateInputC=n.pfx+'input-c',n.states=n.config.states||[];var o=n.config.em,i=n.collection;n.target=o;var a=o.get('SelectorManager');n.module=a,n.em=o,n.componentChanged=(0,r.debounce)(n.componentChanged.bind(n),0),n.checkSync=(0,r.debounce)(n.checkSync.bind(n),0);return n.listenTo(o,'component:toggled component:update:classes',n.componentChanged),n.listenTo(o,'styleManager:update',n.componentChanged),n.listenTo(o,'component:update:classes change:state',n.__handleStateChange),n.listenTo(o,'styleable:change change:device',n.checkSync),n.listenTo(i,'add',n.addNew),n.listenTo(i,'reset',n.renderClasses),n.listenTo(i,'remove',n.tagRemoved),n.listenTo(a.getAll(),a.events.state,(0,r.debounce)((function(){return n.renderStates()}),0)),n.delegateEvents(),n}return _(e,t),e.prototype.template=function(t){var e=t.labelInfo,n=t.labelHead,r=t.iconSync,o=t.iconAdd,i=t.pfx,a=t.ppfx;return(0,h.Z)(k||(k=x([" \n \n "],[" \n \n "])),i,i,i,i,n,i,i,i,a,a,a,i,a,a,i,a,i,i,i,i,i,o,i,i,r,i,i,e,i)},e.prototype.events=function(){return{'change [data-states]':'stateChanged','click [data-add]':'startNewTag','focusout [data-input]':'endNewTag','keyup [data-input]':'onInputKeyUp','click [data-sync-style]':'syncStyle'}},e.prototype.syncStyle=function(){var t,e=this.em,n=this.getTarget(),r=e.get('CssComposer'),o=this.getCommonSelectors({opts:{noDisabled:1}}),i=e.get('state'),a=e.getCurrentMedia(),s=[],l=r.get(o,i,a)||r.add(o,i,a);this.getTargets().forEach((function(e){var n=r.getIdRule(e.getId(),{state:i,mediaText:a});t=n.getStyle(),n.setStyle({}),s.push(n)})),t&&l.addStyle(t),e.trigger('component:toggled'),e.trigger('component:sync-style',{component:n,selectors:o,mediaText:a,rule:l,ruleComponents:s,state:i})},e.prototype.tagRemoved=function(t){this.updateStateVis()},e.prototype.addNew=function(t){this.addToClasses(t)},e.prototype.startNewTag=function(){var t,e;null===(t=this.$addBtn)||void 0===t||t.css({display:'none'}),null===(e=this.$input)||void 0===e||e.show().focus()},e.prototype.endNewTag=function(){var t,e;null===(t=this.$addBtn)||void 0===t||t.css({display:''}),null===(e=this.$input)||void 0===e||e.hide().val('')},e.prototype.onInputKeyUp=function(t){var e;13===t.keyCode?(t.preventDefault(),this.addNewTag(null===(e=this.$input)||void 0===e?void 0:e.val())):27===t.keyCode&&this.endNewTag()},e.prototype.checkStates=function(){var t=this.em.getState(),e=this.getStates();e&&e.val(t)},e.prototype.componentChanged=function(t){var e=(void 0===t?{}:t).targets;this.updateSelection(e)},e.prototype.updateSelection=function(t){var e=t||this.getTargets(),n=[];return(e=(0,r.isArray)(e)?e:[e])&&e.length&&(n=this.getCommonSelectors({targets:e}),this.checkSync({validSelectors:n})),this.collection.reset(n),this.updateStateVis(e),this.module.__trgCustom(),n},e.prototype.getCommonSelectors=function(t){var e=void 0===t?{}:t,n=e.targets,r=e.opts,o=void 0===r?{}:r,i=n||this.getTargets();return this.module.__getCommonSelectors(i,o)},e.prototype._commonSelectors=function(){for(var t,e=[],n=0;n",""],[""," "])),o,t);else{var c=null==t?void 0:t.getSelectors();if(!c)return'';var u=c.getStyleable(),p=a.get('state'),f=t.getId?(0,h.Z)(P||(P=x([""," \n #"," "],[""," \n #"," "])),o,t.getName(),o,t.getId()):'';e=(e=this.collection.getFullString(u))?(0,h.Z)(T||(T=x([""," "],[""," "])),o,e):t.get('selectorsAdd')||f,e=l&&f?f:e,e+=p?(0,h.Z)(E||(E=x([":"," "],[":"," "])),o,p):'',e=s?s({result:e,state:p,target:t}):e}return e&&"").concat(e," ")},e.prototype.stateChanged=function(t){var e=this.em,n=t.target.value;e.set('state',n)},e.prototype.addNewTag=function(t){var e=t.trim();e&&(this.module.addSelected({label:e}),this.endNewTag())},e.prototype.addToClasses=function(t,e){var n=e,r=this.getClasses(),o=new b({model:t,config:this.config,coll:this.collection,module:this.module}).render().el;return n?n.appendChild(o):r.append(o),o},e.prototype.renderClasses=function(){var t=this,e=document.createDocumentFragment(),n=this.getClasses();n.empty(),this.collection.each((function(n){return t.addToClasses(n,e)})),n.append(e)},e.prototype.getClasses=function(){return this.$el.find('[data-selectors]')},e.prototype.getStates=function(){if(!this.$states){var t=this.$el.find('[data-states]');this.$states=t[0]&&t}return this.$states},e.prototype.getStatesC=function(){return this.$statesC||(this.$statesC=this.$el.find('#'+this.stateInputC)),this.$statesC},e.prototype.renderStates=function(){var t=this.module,e=this.em,n=e.t('selectorManager.emptyState'),r=t.getStates().map((function(t){var n=e.t("selectorManager.states.".concat(t.id))||t.getLabel()||t.id;return"").concat(n," ")})).join(''),o=this.getStates();o&&o.html("".concat(n," ").concat(r)),this.checkStates()},e.prototype.render=function(){var t=this,e=t.em,n=t.pfx,r=t.ppfx,o=t.config,i=t.$el,a=t.el,s=o.render,l={iconSync:o.iconSync,iconAdd:o.iconAdd,labelHead:e.t('selectorManager.label'),labelInfo:e.t('selectorManager.selected'),ppfx:r,pfx:n,el:a};i.html(this.template(l));var c=s&&s(l);return c&&c!==a&&i.empty().append(c),this.$input=i.find('[data-input]'),this.$addBtn=i.find('[data-add]'),this.$classes=i.find('#'+n+'tags-c'),this.$btnSyncEl=i.find('[data-sync-style]'),this.$input.hide(),this.renderStates(),this.renderClasses(),i.attr('class',"".concat(this.className," ").concat(r,"one-bg ").concat(r,"two-color")),this},e}(a.View);const C=O;var k,S,P,T,E,j=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),A=void 0&&(void 0).__assign||function(){return A=Object.assign||function(t){for(var e,n=1,r=arguments.length;n=0})):e.slice(1).reduce((function(e,n){return t.__common(e,n)}),e[0]):[]},e.prototype.__updateSelectedByComponents=function(){this.selected.reset(this.__getCommon())},e}(i.Z);const U=z},5963:(t,e,n)=>{"use strict";n.d(e,{Z:()=>u});var r,o=n(9050),i=n(2316),a=void 0&&(void 0).__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=1,l=2,c=function(t){function e(n,r){void 0===r&&(r={});var o=t.call(this,n,r)||this,i=r.config,a=void 0===i?{}:i,s=o.get('name'),l=o.get('label');s?l||o.set('label',s):o.set('name',l);var c=o.get('name'),u=a.escapeName,p=u?u(c):e.escapeName(c);return o.set('name',p),o.em=r.em,o}return a(e,t),e.prototype.defaults=function(){return{name:'',label:'',type:s,active:!0,private:!1,protected:!1,_undo:!0}},e.prototype.isId=function(){return this.get('type')===l},e.prototype.isClass=function(){return this.get('type')===s},e.prototype.getFullName=function(t){void 0===t&&(t={});var e=t.escape,n=this.get('name'),r='';switch(this.get('type')){case s:r='.';break;case l:r='#'}return r+(e?e(n):n)},e.prototype.toString=function(){return this.getFullName()},e.prototype.getLabel=function(){return this.get('label')},e.prototype.setLabel=function(t){return this.set('label',t)},e.prototype.getActive=function(){return this.get('active')},e.prototype.setActive=function(t){return this.set('active',t)},e.prototype.toJSON=function(t){void 0===t&&(t={});var e=this.em,n=i.Model.prototype.toJSON.call(this,[t]),r=(0,o.result)(this,'defaults');if(e&&e.getConfig().avoidDefaults){(0,o.forEach)(r,(function(t,e){n[e]===t&&delete n[e]})),n.label===n.name&&delete n.label;var a=(0,o.keys)(n).length;1===a&&n.name&&(n=n.name),2===a&&n.name&&n.type&&(n=this.getFullName())}return n},e.escapeName=function(t){return"".concat(t).trim().replace(/([^a-z0-9\w-\:]+)/gi,'-')},e.TYPE_CLASS=s,e.TYPE_ID=l,e}(i.Model);const u=c;c.prototype.idAttribute='name'},966:(t,e,n)=>{"use strict";n.d(e,{Z:()=>u});var r,o=n(9050),i=n(2316),a=n(5963),s=void 0&&(void 0).__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(t,e){return t.reduce((function(n,r,o){return n.concat(l(t.slice(o+1),"".concat(e).concat(r)))}),[e])},c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s(e,t),e.prototype.modelId=function(t){return"".concat(t.name,"_").concat(t.type||a.Z.TYPE_CLASS)},e.prototype.getStyleable=function(){return(0,o.filter)(this.models,(function(t){return t.get('active')&&!t.get('private')}))},e.prototype.getValid=function(t){var e=(void 0===t?{}:t).noDisabled;return(0,o.filter)(this.models,(function(t){return!t.get('private')})).filter((function(t){return e?t.get('active'):1}))},e.prototype.getFullString=function(t,e){void 0===e&&(e={});var n=[];return(t||this).forEach((function(t){return n.push(t.getFullName(e))})),e.sort&&n.sort(),n.join('').trim()},e.prototype.getFullName=function(t){void 0===t&&(t={});var e=t.combination,n=t.array,r=[],o=this.map((function(e){return e.getFullName(t)})).sort();return e?o.forEach((function(t,e){r=r.concat(l(o.slice(e+1),t))})):r=o,n?r:e?r.join(','):r.join('')},e}(i.Collection);const u=c;c.prototype.model=a.Z},8221:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>g});var r=n(3410),o=n.n(r),i=n(9050),a=n(6434);const s={maximumStackLength:500,trackSelection:!0};var l,c=void 0&&(void 0).__extends||(l=function(t,e){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},l(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}l(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),u=void 0&&(void 0).__assign||function(){return u=Object.assign||function(t){for(var e,n=1,r=arguments.length;n=0})))return!1;if((0,i.isBoolean)(e))return!0;if((0,i.isArray)(e)&&d(t).some((function(t){return e.indexOf(t)>=0})))return!0}return!1},on:function(t,e,n){var o=this;!this.beforeCache&&(this.beforeCache=t.previousAttributes());var a=n||e||{};if(a.noUndo&&setTimeout((function(){o.beforeCache=null})),!f(a)){var s=t.toJSON({fromUndo:r}),l={object:t,before:this.beforeCache,after:s};if(this.beforeCache=null,!(0,i.isEmpty)(s))return l}}}),n.um.changeUndoType('add',{on:function(t,e,o){if(void 0===o&&(o={}),!f(o)&&n.isRegistered(e))return{object:e,before:void 0,after:t,options:u(u({},o),{fromUndo:r})}}}),n.um.changeUndoType('remove',{on:function(t,e,o){if(void 0===o&&(o={}),!f(o)&&n.isRegistered(e))return{object:e,before:t,after:void 0,options:u(u({},o),{fromUndo:r})}}}),n.um.changeUndoType('reset',{undo:function(t,e){t.reset(e,{fromUndo:r})},redo:function(t,e,n){t.reset(n,{fromUndo:r})},on:function(t,e){if(void 0===e&&(e={}),!f(e)&&n.isRegistered(t))return{object:t,before:e.previousModels,after:p([],t.models,!0),options:u(u({},e),{fromUndo:r})}}}),n.um.on('undo redo',(function(){e.trigger('change:canvasOffset'),e.getSelectedAll().map((function(t){return t.trigger('rerender:layer')}))})),['undo','redo'].forEach((function(t){return n.um.on(t,(function(){return e.trigger(t)}))})),n}return c(e,t),e.prototype.postLoad=function(){var t=this.config,e=this.em;t.trackSelection&&e&&this.add(e.get('selected'))},e.prototype.getConfig=function(){return this.config},e.prototype.add=function(t){return this.um.register(t),this},e.prototype.remove=function(t){return this.um.unregister(t),this},e.prototype.removeAll=function(){return this.um.unregisterAll(),this},e.prototype.start=function(){return this.um.startTracking(),this},e.prototype.stop=function(){return this.um.stopTracking(),this},e.prototype.undo=function(t){void 0===t&&(t=!0);var e=this.em,n=this.um;return!e.isEditing()&&n.undo(t),this},e.prototype.undoAll=function(){return this.um.undoAll(),this},e.prototype.redo=function(t){void 0===t&&(t=!0);var e=this.em,n=this.um;return!e.isEditing()&&n.redo(t),this},e.prototype.redoAll=function(){return this.um.redoAll(),this},e.prototype.hasUndo=function(){return!!this.um.isAvailable('undo')},e.prototype.hasRedo=function(){return!!this.um.isAvailable('redo')},e.prototype.isRegistered=function(t){return!!this.getInstance().objectRegistry.isRegistered(t)},e.prototype.getStack=function(){return this.um.stack},e.prototype.getStackGroup=function(){var t=[],e=[];return this.getStack().forEach((function(n){var r=n.get('magicFusionIndex');e.indexOf(r)<0&&(e.push(r),t.push(n))})),t},e.prototype.skip=function(t){this.stop(),t(),this.start()},e.prototype.getGroupedStack=function(){var t={},e=this.getStack();return e.forEach((function(e,n){var r=e.get('magicFusionIndex'),o=function(t,e){var n=t.attributes,r=n.type,o=n.after,i=n.before,a=n.object,s=n.options;return{index:e,type:r,after:o,before:i,object:a,options:void 0===s?{}:s}}(e,n);t[r]?t[r].push(o):t[r]=[o]})),Object.keys(t).map((function(e){var n=t[e];return{index:n[n.length-1].index,actions:n,labels:(0,i.unique)(n.reduce((function(t,e){var n,r=null===(n=e.options)||void 0===n?void 0:n.action;return r&&t.push(r),t}),[]))}}))},e.prototype.goToGroup=function(t){var e=this;if(t){var n=this.getPointer(),r=t.index-n;(0,i.times)(Math.abs(r),(function(){e[r<0?'undo':'redo'](!1)}))}},e.prototype.getPointer=function(){return this.getStack().pointer},e.prototype.clear=function(){return this.um.clear(),this},e.prototype.getInstance=function(){return this.um},e.prototype.destroy=function(){this.clear().removeAll()},e}(a.Z);const g=h},8668:(t,e,n)=>{"use strict";n.d(e,{Z:()=>s});var r=n(9050),o=n(1163),i=void 0&&(void 0).__assign||function(){return i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n=e&&t<=e+r||t<=e&&t>=e-r},t.prototype.setGuideLock=function(t,e){var n=(0,r.isUndefined)(t.x)?'Y':'X',o="trg".concat(n);return null!==e?(t.active=!0,t.lock=e,this[o]=t):(delete t.active,delete t.lock,delete this[o]),t},t.prototype.stop=function(t,e){void 0===e&&(e={});var n=this.delta,o=!!e.cancel,i=o?0:n.x,a=o?0:n.y;this.toggleDrag(),this.lockedAxis=null,this.move(i,a,!0);var s=this.opts.onEnd;(0,r.isFunction)(s)&&s(t,this,{cancelled:o})},t.prototype.keyHandle=function(t){(0,o.isEscKey)(t)&&this.stop(t,{cancel:!0})},t.prototype.move=function(t,e,n){var o=this.el,i=this.opts,a=this.startPosition;if(a){var s=i.setPosition,l=a.x+t,c=a.y+e;this.position={x:l,y:c,end:n},(0,r.isFunction)(s)&&s(this.position),o&&(o.style.left="".concat(l,"px"),o.style.top="".concat(c,"px"))}},t.prototype.getContainerEl=function(){var t=this.opts.container;return t?[t]:this.getDocumentEl()},t.prototype.getWindowEl=function(){return this.getContainerEl().map((function(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow}))},t.prototype.getDocumentEl=function(t){var e=this.opts.doc;if(t=t||this.el,!this.docs.length){var n=[document];t&&n.push(t.ownerDocument),e&&n.push(e),this.docs=n}return this.docs},t.prototype.getPointerPos=function(t){var e=this.opts.getPointerPosition,n=(0,o.getPointerEvent)(t);return e?e(t):{x:n.clientX,y:n.clientY}},t.prototype.getStartPosition=function(){var t=this.el,e=this.opts.getPosition,n={x:0,y:0};return(0,r.isFunction)(e)?n=e():t&&(n={x:parseFloat(t.style.left),y:parseFloat(t.style.top)}),n},t.prototype.getScrollInfo=function(){var t=this.opts.doc,e=t&&t.body;return{y:e?e.scrollTop:0,x:e?e.scrollLeft:0}},t.prototype.detectAxisLock=function(t,e){var n=t,r=e,o=Math.abs(n),i=Math.abs(r);return r>=o||r<=-o?'x':n>i||n<-i?'y':void 0},t}()},6895:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>vt});var r='undefined'!=typeof document?document:null,o='undefined'!=typeof window?window:null,i=Array.prototype,a=i.filter,s=i.indexOf,l=i.map,c=i.push,u=i.reverse,p=i.slice,f=i.splice,d=/^#[\w-]*$/,h=/^\.[\w-]*$/,g=/<.+>/,v=/^\w+$/;function m(t,e){return void 0===e&&(e=r),h.test(t)?e.getElementsByClassName(t.slice(1)):v.test(t)?e.getElementsByTagName(t):e.querySelectorAll(t)}function y(t,e){if(void 0===e&&(e=r),t){if(t.__cash)return t;var n=t;if(T(t)){if(e.__cash&&(e=e[0]),!(n=d.test(t)?e.getElementById(t.slice(1)):g.test(t)?dt(t):m(t,e)))return}else if(P(t))return this.ready(t);(n.nodeType||n===o)&&(n=[n]),this.length=n.length;for(var i=0,a=this.length;i=0})):n.value=o}))},w.clone=function(){return this.map((function(t,e){return e.cloneNode(!0)}))},w.detach=function(){return this.each((function(t,e){e.parentNode&&e.parentNode.removeChild(e)}))};var ut,pt=/^\s*<(\w+)[^>]*>/,ft=/^\s*<(\w+)\s*\/?>(?:<\/\1>)?\s*$/;function dt(t){if(function(){if(!ut){var t=r.createElement('table'),e=r.createElement('tr');ut={'*':r.createElement('div'),tr:r.createElement('tbody'),td:e,th:e,thead:t,tbody:t,tfoot:t}}}(),!T(t))return[];if(ft.test(t))return[r.createElement(RegExp.$1)];var e=pt.test(t)&&RegExp.$1,n=ut[e]||ut['*'];return n.innerHTML=t,b(n.childNodes).detach().get()}function ht(t,e,n){if(void 0!==e){var r=T(e);!r&&e.length?C(e,(function(e){return ht(t,e,n)})):C(t,r?function(t){t.insertAdjacentHTML(n?'afterbegin':'beforeend',e)}:function(t,r){return function(t,e,n){n?t.insertBefore(e,t.childNodes[0]):t.appendChild(e)}(t,r?e.cloneNode(!0):e,n)})}}b.parseHTML=dt,w.empty=function(){var t=this[0];if(t)for(;t.firstChild;)t.removeChild(t.firstChild);return this},w.append=function(){var t=this;return C(arguments,(function(e){ht(t,e)})),this},w.appendTo=function(t){return ht(b(t),this),this},w.html=function(t){if(void 0===t)return this[0]&&this[0].innerHTML;var e=t.nodeType?t[0].outerHTML:t;return this.each((function(t,n){n.innerHTML=e}))},w.insertAfter=function(t){var e=this;return b(t).each((function(t,n){var r=n.parentNode;e.each((function(e,o){r.insertBefore(t?o.cloneNode(!0):o,n.nextSibling)}))})),this},w.after=function(){var t=this;return C(u.apply(arguments),(function(e){u.apply(b(e).slice()).insertAfter(t)})),this},w.insertBefore=function(t){var e=this;return b(t).each((function(t,n){var r=n.parentNode;e.each((function(e,o){r.insertBefore(t?o.cloneNode(!0):o,n)}))})),this},w.before=function(){var t=this;return C(arguments,(function(e){b(e).insertBefore(t)})),this},w.prepend=function(){var t=this;return C(arguments,(function(e){ht(t,e,!0)})),this},w.prependTo=function(t){return ht(b(t),u.apply(this.slice()),!0),this},w.remove=function(){return this.detach().off()},w.replaceWith=function(t){var e=this;return this.each((function(n,r){var o=r.parentNode;if(o){var i=n?b(t).clone():b(t);if(!i[0])return e.remove(),!1;o.replaceChild(i[0],r),b(i[0]).after(i.slice(1))}}))},w.replaceAll=function(t){return b(t).replaceWith(this),this},w.text=function(t){return void 0===t?this[0]?this[0].textContent:'':this.each((function(e,n){n.textContent=t}))};var gt=r&&r.documentElement;w.offset=function(){var t=this[0];if(t){var e=t.getBoundingClientRect();return{top:e.top+o.pageYOffset-gt.clientTop,left:e.left+o.pageXOffset-gt.clientLeft}}},w.offsetParent=function(){return b(this[0]&&this[0].offsetParent)},w.position=function(){var t=this[0];if(t)return{left:t.offsetLeft,top:t.offsetTop}},w.children=function(t){var e=[];return this.each((function(t,n){c.apply(e,n.children)})),e=b(L(e)),t?e.filter((function(e,n){return S(n,t)})):e},w.contents=function(){var t=[];return this.each((function(e,n){c.apply(t,'IFRAME'===n.tagName?[n.contentDocument]:n.childNodes)})),b(t.length&&L(t))},w.find=function(t){for(var e=[],n=0,r=this.length;n{"use strict";n.d(e,{$Q:()=>d,FW:()=>u,G1:()=>a,L_:()=>l,Mx:()=>s,R3:()=>h,SJ:()=>y,dL:()=>f,pn:()=>p,rw:()=>v,sE:()=>c,t3:()=>m,ut:()=>g});var r=n(9050),o='tag',i='attributes',a='transitionend oTransitionEnd transitionend webkitTransitionEnd',s=function(t){return t&&9===t.nodeType},l=function(t){var e=t&&t.parentNode;e&&e.removeChild(t)},c=function(t,e){return t.querySelectorAll(e)},u=function(t,e){return void 0===e&&(e={}),t&&t.setAttribute&&(0,r.each)(e,(function(e,n){return t.setAttribute(n,e)}))},p=function(t){return t&&!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},f=function(t,e){var n;null===(n=t.parentNode)||void 0===n||n.replaceChild(e,t)},d=function(t,e,n){var o=t.childNodes,i=o.length,a=(0,r.isUndefined)(n)?i:n;(0,r.isString)(e)&&(t.insertAdjacentHTML('beforeEnd',e),e=t.lastChild,t.removeChild(e)),a>=i?t.appendChild(e):t.insertBefore(e,o[a])},h=function(t,e){return d(t,e)},g=function(t,e,n){void 0===e&&(e={});var o=document.createElement(t);return e&&(0,r.each)(e,(function(t,e){return o.setAttribute(e,t)})),n&&((0,r.isString)(n)?o.innerHTML=n:o.appendChild(n)),o},v=function(t){return document.createTextNode(t)},m=function(t,e){var n,r=t.type;try{n=new window[e](r,t)}catch(t){(n=document.createEvent(e)).initEvent(r,!0,!0)}return n._parentEvent=t,0===r.indexOf('key')&&(n.keyCodeVal=t.keyCode,['keyCode','which'].forEach((function(t){Object.defineProperty(n,t,{get:function(){return this.keyCodeVal}})}))),n},y=function(t,e){void 0===e&&(e=[]),(Array.isArray(e)?e:[e]).forEach((function(e){var n=e[o]||'div',a=e[i]||{},s=document.createElement(n);(0,r.each)(a,(function(t,e){s.setAttribute(e,t)})),t.appendChild(s)}))}},6062:(t,e,n)=>{"use strict";n.d(e,{Z:()=>m});var r=n(1002);const o=function(t){var e=this.constructor;return this.then((function(n){return e.resolve(t()).then((function(){return n}))}),(function(n){return e.resolve(t()).then((function(){return e.reject(n)}))}))};const i=function(t){return new this((function(e,n){if(!t||void 0===t.length)return n(new TypeError((0,r.Z)(t)+' '+t+' is not iterable(cannot read property Symbol(Symbol.iterator))'));var o=Array.prototype.slice.call(t);if(0===o.length)return e([]);var i=o.length;function a(t,n){if(n&&('object'===(0,r.Z)(n)||'function'==typeof n)){var s=n.then;if('function'==typeof s)return void s.call(n,(function(e){a(t,e)}),(function(n){o[t]={status:'rejected',reason:n},0==--i&&e(o)}))}o[t]={status:'fulfilled',value:n},0==--i&&e(o)}for(var s=0;s{"use strict";n.d(e,{Z:()=>o});var r=n(1163);function o(t){for(var e=[],n=1;n{"use strict";n.r(e),n.d(e,{default:()=>w});var r=n(8668),o=n(4942),i=n(2316),a=n.n(i),s=n(9050),l=n(1163);function c(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function u(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{},s=this.em,c=this.itemSel,u=this.containerSel,p=this.plh,f=this.getContainerEl(a.container),d=this.getDocuments(t);this.dropModel=null,this.target=null,this.prevTarget=null,this.moved=0,t&&!this.matches(t,"".concat(c,", ").concat(u))&&(t=this.closest(t,c)),this.sourceEl=t,p||(this.plh=this.createPlaceholder(),f.appendChild(this.plh)),t&&((i=this.getSourceModel(t))&&i.set&&i.set('status','freezed'),this.srcModel=i),(0,l.on)(f,'mousemove dragover',this.onMove),(0,l.on)(d,'mouseup dragend touchend',this.endMove),(0,l.on)(d,'keydown',this.rollback),this.onStart({sorter:this,target:i,parent:i&&(null===(e=(n=i).parent)||void 0===e?void 0:e.call(n)),index:i&&(null===(r=(o=i).index)||void 0===r?void 0:r.call(o))}),null==s||s.clearSelection(),this.toggleSortCursor(1),null==s||s.trigger('sorter:drag:start',t,i)},getTargetModel:function(t){var e=t||this.target;return p(e).data('model')},getSourceModel:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.target,o=n.avoidChildren,i=void 0===o?1:o,a=this.em,s=this.sourceEl,l=t||s,c=this.dropModel,f=this.dropContent,d=function(t){return t&&r&&t.opt&&t.opt.avoidChildren&&e.isTextableActive(t,r)};if(f&&a){if(d(c)&&(c=null),!c){var h=a.get('DomComponents').getComponents(),g={avoidChildren:i,avoidStore:1,avoidUpdateStyle:1},v=h.add(f,u(u({},g),{},{temporary:1}));if(c=(c=h.remove(v,g))instanceof Array?c[0]:c,this.dropModel=c,d(c))return this.getSourceModel(l,{target:r,avoidChildren:0})}return c}return l&&p(l).data('model')},selectTargetModel:function(t,e){if(!(t instanceof a().Collection||e&&e===t)){var n=this.targetModel;n&&n!==this.srcModel&&n.set('status',''),t&&t.set&&(t.set('status','selected-parent'),this.targetModel=t)}},onMove:function(t){var e=t,n=this.em,r=this.onMoveClb,o=this.plh,i=this.customTarget;this.moved=1;var a=o.style.display;a&&'none'!==a||(o.style.display='block');var l=this.offset(this.el);this.elT=this.wmargin?Math.abs(l.top):l.top,this.elL=this.wmargin?Math.abs(l.left):l.left;var c=t.pageY-this.elT+this.el.scrollTop,u=t.pageX-this.elL+this.el.scrollLeft;if(this.canvasRelative&&n){var f=n.get('Canvas').getMouseRelativeCanvas(t,{noScroll:1});u=f.x,c=f.y}this.rX=u,this.rY=c,this.eventMove=t;var d=this.getSourceModel(),h=i?i({sorter:this,event:t}):t.target,g=this.dimsFromTarget(h,u,c),v=this.target,m=v&&this.getTargetModel(v);if(this.selectTargetModel(m,d),m||(o.style.display='none'),v){this.lastDims=g;var y=this.findPosition(g,u,c);this.isTextableActive(d,m)?(this.activeTextModel=m,o.style.display='none',this.lastPos=y,this.updateTextViewCursorPosition(e)):(this.disableTextable(),this.activeTextModel=null,this.lastPos&&this.lastPos.index==y.index&&this.lastPos.method==y.method||(this.movePlaceholder(this.plh,g,y,this.prevTargetDim),this.$plh||(this.$plh=p(this.plh)),this.canvasRelative||(this.offTop&&this.$plh.css('top','+='+this.offTop+'px'),this.offLeft&&this.$plh.css('left','+='+this.offLeft+'px')),this.lastPos=y)),(0,s.isFunction)(r)&&r({event:t,target:d,parent:m,index:y.index+('after'==y.method?1:0)}),n&&n.trigger('sorter:drag',{target:v,targetModel:m,sourceModel:d,dims:g,pos:y,x:u,y:c})}},isTextableActive:function(t,e){var n;return(null==t||null===(n=t.get)||void 0===n?void 0:n.call(t,'textable'))&&(null==e?void 0:e.isInstanceOf('text'))},disableTextable:function(){var t=this.activeTextModel;t&&t.getView().disableEditing(),this.setContentEditable(t,!1)},isInFlow:function(t,e){if(!t)return!1;e=e||document.body;var n=t;return n.offsetHeight,!!this.styleInFlow(n,e)},styleInFlow:function(t,e){if(!(0,l.isTextNode)(t)){var n=t.style||{},r=p(t),o=e&&p(e);if(!n.overflow||'visible'===n.overflow){var i=r.css('float');if(!(i&&'none'!==i||o&&'flex'==o.css('display')&&'column'!==o.css('flex-direction'))){switch(n.position){case'static':case'relative':case'':break;default:return}switch(t.tagName){case'TR':case'TBODY':case'THEAD':case'TFOOT':return!0}switch(r.css('display')){case'block':case'list-item':case'table':case'flex':return!0}}}}},validTarget:function(t,e){var n=this.getTargetModel(t),r=this.getSourceModel(e,{target:n}),o={valid:!0,src:e=r&&r.view&&r.view.el,srcModel:r,trg:t=n&&n.view&&n.view.el,trgModel:n};if(!e||!t)return o.valid=!1,o;var i=r.get('draggable');if((0,s.isFunction)(i)){var l=i(r,n);o.dragInfo=l,o.draggable=l,i=l}else i=i instanceof Array?i.join(', '):i,o.dragInfo=i,i=(0,s.isString)(i)?this.matches(t,i):i,o.draggable=i;var c=n.get('droppable');if((0,s.isFunction)(c)){var u=c(r,n);o.droppable=u,o.dropInfo=u,c=u}else c=(c=c instanceof a().Collection?1:c)instanceof Array?c.join(', '):c,o.dropInfo=c,c=(0,s.isString)(c)?this.matches(e,c):c,c=i&&this.isTextableActive(r,n)?1:c,o.droppable=c;return c&&i||(o.valid=!1),o},dimsFromTarget:function(t,e,n){var r=this.em,o=[];if(!t)return o;if(this.matches(t,"".concat(this.itemSel,", ").concat(this.containerSel))||(t=this.closest(t,this.itemSel)),this.draggable instanceof Array&&(t=this.closest(t,this.draggable.join(','))),!t)return o;if(this.prevTarget&&this.prevTarget!=t&&(this.prevTarget=null),!this.prevTarget){this.targetP=this.closest(t,this.containerSel);var i=this.validTarget(t);if(r&&r.trigger('sorter:drag:validation',i),!i.valid&&this.targetP)return this.dimsFromTarget(this.targetP,e,n);this.prevTarget=t,this.prevTargetDim=this.getDim(t),this.cacheDimsP=this.getChildrenDim(this.targetP),this.cacheDims=this.getChildrenDim(t)}if(this.prevTarget==t&&(o=this.cacheDims),this.target=this.prevTarget,this.nearBorders(this.prevTargetDim,e,n)||!this.nested&&!this.cacheDims.length){var a=this.targetP;a&&this.validTarget(a).valid&&(o=this.cacheDimsP,this.target=a)}return this.lastPos=null,o},getTargetFromEl:function(t){var e,n=t,r=this.targetPrev,o=this.em,i=this.containerSel,a=this.itemSel;if(this.matches(n,"".concat(a,", ").concat(i))||(n=this.closest(n,a)),this.draggable instanceof Array&&(n=this.closest(n,this.draggable.join(','))),r&&r!=n&&(this.targetPrev=''),!this.targetPrev){e=this.closest(n,i);var s=this.validTarget(n);if(o&&o.trigger('sorter:drag:validation',s),!s.valid&&e)return this.getTargetFromEl(e);this.targetPrev=n}return this.nearElBorders(n)&&(e=this.closest(n,i))&&this.validTarget(e).valid&&(n=e),n},nearElBorders:function(t){var e=10,n=t.getBoundingClientRect(),r=t.ownerDocument.body,o=this.getCurrentPos(),i=o.x,a=o.y,s=n.top+r.scrollTop,l=n.left+r.scrollLeft,c=n.width,u=n.height;if(as+u-e||il+c-e)return 1},getCurrentPos:function(){var t=this.eventMove;return{x:t.pageX||0,y:t.pageY||0}},getDim:function(t){var e,n,r,o,i=this.em,a=this.canvasRelative,s=i&&i.get('Canvas'),l=s?s.getElementOffsets(t):{};if(a&&i){var c=s.getElementPos(t,{noScroll:1});e=c.top,n=c.left,r=c.height,o=c.width}else{var u=this.offset(t);e=this.relative?t.offsetTop:u.top-(this.wmargin?-1:1)*this.elT,n=this.relative?t.offsetLeft:u.left-(this.wmargin?-1:1)*this.elL,r=t.offsetHeight,o=t.offsetWidth}return{top:e,left:n,height:r,width:o,offsets:l}},getChildrenDim:function(t){var e=this,n=[];if(!t)return n;var r=this.getTargetModel(t);if(r&&r.view&&!this.ignoreViewChildren){var o=r.getCurrentView?r.getCurrentView():r.view;t=o.getChildrenContainer()}return(0,s.each)(t.children,(function(r,o){var i=(0,l.getModel)(r,p),a=i&&i.index?i.index():o;if((0,l.isTextNode)(r)||e.matches(r,e.itemSel)){var s=e.getDim(r),c=e.direction;c='v'==c||'h'!=c&&e.isInFlow(r,t),s.dir=c,s.el=r,s.indexEl=a,n.push(s)}})),n},nearBorders:function(t,e,n){var r=0,o=this.borderOffset,i=e||0,a=n||0,s=t.top,l=t.left,c=t.height,u=t.width;return(s+o>a||a>s+c-o||l+o>i||i>l+u-o)&&(r=1),!!r},findPosition:function(t,e,n){for(var r={index:0,indexEl:0,method:'before'},o=0,i=0,a=0,s=0,l=0,c=0,u=0,p=0,f=t.length;pi||a&&l>=a||o&&g+mx&&(w.at=d-1))}r&&(_?(delete w.at,o=v.getView().insertComponent(r,w)):o=g.add(r,w)),this.dropContent=null,this.prevTarget=null}else if(i){var C=h.dropInfo||(null==v?void 0:v.get('droppable')),k=h.dragInfo||(null==m?void 0:m.get('draggable'));!g&&f.push('Target collection not found'),!b&&C&&f.push("Target is not droppable, accepts [".concat(C,"]")),!y&&k&&f.push("Component not draggable, acceptable by [".concat(k,"]")),i.logWarning('Invalid target position',{errors:f,model:m,context:'sorter',target:v})}return null==i||i.trigger('sorter:drag:end',{targetCollection:g,modelToDrop:r,warns:f,validResult:h,dst:t,srcEl:u}),o},rollback:function(t){(0,l.off)(this.getDocuments(),'keydown',this.rollback),27==(t.which||t.keyCode)&&(this.moved=0,this.endMove())}});var h=void 0&&(void 0).__assign||function(){return h=Object.assign||function(t){for(var e,n=1,r=arguments.length;nb?v.h=Math.round(v.w/b):v.w=Math.round(v.h*b)}return~m.indexOf('l')&&(v.l=o.w-v.w),~m.indexOf('t')&&(v.t=o.h-v.h),v}},t}();var v,m=n(6434),y=void 0&&(void 0).__extends||(v=function(t,e){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},v(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}v(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),b=void 0&&(void 0).__assign||function(){return b=Object.assign||function(t){for(var e,n=1,r=arguments.length;n{"use strict";n.r(e),n.d(e,{appendStyles:()=>d,buildBase64UrlFromSvg:()=>W,camelCase:()=>b,capitalize:()=>F,createId:()=>U,deepMerge:()=>E,escape:()=>P,escapeNodeContent:()=>T,find:()=>S,getElRect:()=>A,getElement:()=>x,getGlobal:()=>l,getKeyChar:()=>L,getKeyCode:()=>D,getModel:()=>j,getPointerEvent:()=>M,getUiClass:()=>f,getUnitFromValue:()=>m,getViewEl:()=>H,hasDnd:()=>_,hasWin:()=>s,isCommentNode:()=>C,isComponent:()=>V,isDef:()=>a,isEmptyObj:()=>I,isEnterKey:()=>Z,isEscKey:()=>R,isObject:()=>N,isRule:()=>B,isTaggableNode:()=>k,isTextNode:()=>O,matches:()=>p,normalizeFloat:()=>w,off:()=>v,on:()=>g,setViewEl:()=>z,shallowDiff:()=>h,toLowerCase:()=>c,upFirst:()=>y});var r=n(9050),o=void 0&&(void 0).__assign||function(){return o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n=0?a!==s&&(n[i]=s):n[i]=null}for(var i in e)e.hasOwnProperty(i)&&(0,r.isUndefined)(t[i])&&(n[i]=e[i]);return n},g=function(t,e,n,r){var o=e.split(/\s+/);t=t instanceof Array?t:[t];for(var i=function(e){t.forEach((function(t){return t&&t.addEventListener(o[e],n,r)}))},a=0;a /g,'>').replace(/"/g,'"').replace(/'/g,''').replace(/`/g,'`')},T=function(t){return void 0===t&&(t=''),"".concat(t).replace(/&/g,'&').replace(//g,'>')},E=function(){for(var t=[],e=0;e{var r={"./CanvasClear":7202,"./CanvasClear.js":7202,"./CanvasMove":327,"./CanvasMove.js":327,"./CommandAbstract":238,"./CommandAbstract.js":238,"./ComponentDelete":5820,"./ComponentDelete.js":5820,"./ComponentDrag":6694,"./ComponentDrag.js":6694,"./ComponentEnter":1947,"./ComponentEnter.js":1947,"./ComponentExit":3888,"./ComponentExit.js":3888,"./ComponentNext":5883,"./ComponentNext.js":5883,"./ComponentPrev":7508,"./ComponentPrev.js":7508,"./ComponentStyleClear":8769,"./ComponentStyleClear.js":8769,"./CopyComponent":2213,"./CopyComponent.js":2213,"./DeleteComponent":5049,"./DeleteComponent.js":5049,"./ExportTemplate":3775,"./ExportTemplate.js":3775,"./Fullscreen":58,"./Fullscreen.js":58,"./MoveComponent":8658,"./MoveComponent.js":8658,"./OpenAssets":9617,"./OpenAssets.js":9617,"./OpenBlocks":5821,"./OpenBlocks.js":5821,"./OpenLayers":3452,"./OpenLayers.js":3452,"./OpenStyleManager":2840,"./OpenStyleManager.js":2840,"./OpenTraitManager":8644,"./OpenTraitManager.js":8644,"./PasteComponent":560,"./PasteComponent.js":560,"./Preview":4944,"./Preview.js":4944,"./Resize":7538,"./Resize.js":7538,"./SelectComponent":5130,"./SelectComponent.js":5130,"./SelectPosition":8463,"./SelectPosition.js":8463,"./ShowOffset":7994,"./ShowOffset.js":7994,"./SwitchVisibility":8352,"./SwitchVisibility.js":8352};function o(t){var e=i(t);return n(e)}function i(t){if(!n.o(r,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code='MODULE_NOT_FOUND',e}return r[t]}o.keys=function(){return Object.keys(r)},o.resolve=i,t.exports=o,o.id=2828},7061:(t,e,n)=>{var r=n(8698)["default"];function o(){"use strict";t.exports=o=function(){return e},t.exports.__esModule=!0,t.exports["default"]=t.exports;var e={},n=Object.prototype,i=n.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function p(t,e,n,r){var o=e&&e.prototype instanceof h?e:h,i=Object.create(o.prototype),a=new S(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return T()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=O(a,n);if(s){if(s===d)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=f(t,e,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(t,n,a),i}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=p;var d={};function h(){}function g(){}function v(){}var m={};u(m,s,(function(){return this}));var y=Object.getPrototypeOf,b=y&&y(y(P([])));b&&b!==n&&i.call(b,s)&&(m=b);var w=v.prototype=h.prototype=Object.create(m);function _(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function n(o,a,s,l){var c=f(t[o],t,a);if("throw"!==c.type){var u=c.arg,p=u.value;return p&&"object"==r(p)&&i.call(p,"__await")?e.resolve(p.__await).then((function(t){n("next",t,s,l)}),(function(t){n("throw",t,s,l)})):e.resolve(p).then((function(t){u.value=t,s(u)}),(function(t){return n("throw",t,s,l)}))}l(c.arg)}var o;this._invoke=function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}}function O(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator["return"]&&(e.method="return",e.arg=void 0,O(t,e),"throw"===e.method))return d;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var r=f(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,d;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,d):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function P(t){if(t){var e=t[s];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n=0;--r){var o=this.tryEntries[r],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=i.call(o,"catchLoc"),l=i.call(o,"finallyLoc");if(s&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),k(n),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;k(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:P(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),d}},e}t.exports=o,t.exports.__esModule=!0,t.exports["default"]=t.exports},8698:t=>{function e(n){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports["default"]=t.exports,e(n)}t.exports=e,t.exports.__esModule=!0,t.exports["default"]=t.exports},4687:(t,e,n)=>{var r=n(7061)();t.exports=r;try{regeneratorRuntime=r}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},907:(t,e,n)=>{"use strict";function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nr})},7326:(t,e,n)=>{"use strict";function r(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}n.d(e,{Z:()=>r})},5861:(t,e,n)=>{"use strict";function r(t,e,n,r,o,i,a){try{var s=t[i](a),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(r,o)}function o(t){return function(){var e=this,n=arguments;return new Promise((function(o,i){var a=t.apply(e,n);function s(t){r(a,o,i,s,l,"next",t)}function l(t){r(a,o,i,s,l,"throw",t)}s(void 0)}))}}n.d(e,{Z:()=>o})},5671:(t,e,n)=>{"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}n.d(e,{Z:()=>r})},3144:(t,e,n)=>{"use strict";function r(t,e){for(var n=0;no})},4942:(t,e,n)=>{"use strict";function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n.d(e,{Z:()=>r})},1752:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});var r=n(1120);function o(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=(0,r.Z)(t)););return t}function i(){return i="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=o(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},i.apply(this,arguments)}},1120:(t,e,n)=>{"use strict";function r(t){return r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},r(t)}n.d(e,{Z:()=>r})},9340:(t,e,n)=>{"use strict";function r(t,e){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},r(t,e)}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&r(t,e)}n.d(e,{Z:()=>o})},4925:(t,e,n)=>{"use strict";function r(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r