PATH:
home
/
letacommog
/
broderie
/
wp-content
/
themes
/
Divi
/
includes
/
builder
/
frontend-builder
/
build
/*! This minified app bundle contains open source software from several third party developers. Please review CREDITS.md in the root directory or LICENSE.md in the current directory for complete licensing, copyright and patent information. This bundle.js file and the included code may not be redistributed without the attributions listed in LICENSE.md, including associate copyright notices and licensing information. */ (window.webpackETJsonp=window.webpackETJsonp||[]).push([[2],Array(1047).concat([function(e,t,n){ // CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE e.exports=function(){"use strict";var e=(window.top||window).document,t=navigator.userAgent,n=navigator.platform,r=/gecko\/\d/i.test(t),o=/MSIE \d/.test(t),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(t),a=/Edge\/(\d+)/.exec(t),s=o||i||a,l=s&&(o?e.documentMode||6:+(a||i)[1]),u=!a&&/WebKit\//.test(t),c=u&&/Qt\/\d+\.\d+/.test(t),d=!a&&/Chrome\//.test(t),p=/Opera\//.test(t),f=/Apple Computer/.test(navigator.vendor),h=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(t),g=/PhantomJS/.test(t),m=!a&&/AppleWebKit/.test(t)&&/Mobile\/\w+/.test(t),v=/Android/.test(t),b=m||v||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(t),y=m||/Mac/.test(n),_=/\bCrOS\b/.test(t),k=/win/i.test(n),w=p&&t.match(/Version\/(\d*\.\d*)/);w&&(w=Number(w[1])),w&&w>=15&&(p=!1,u=!0);var C=y&&(c||p&&(null==w||w<12.11)),S=r||s&&l>=9;function E(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var O,T=function(e,t){var n=e.className,r=E(t).exec(n);if(r){var o=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(o?r[1]+o:"")}};function x(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function M(e,t){return x(e).appendChild(t)}function D(t,n,r,o){var i=e.createElement(t);if(r&&(i.className=r),o&&(i.style.cssText=o),"string"==typeof n)i.appendChild(e.createTextNode(n));else if(n)for(var a=0;a<n.length;++a)i.appendChild(n[a]);return i}function P(e,t,n,r){var o=D(e,t,n,r);return o.setAttribute("role","presentation"),o}function N(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do{if(11==t.nodeType&&(t=t.host),t==e)return!0}while(t=t.parentNode)}function L(){var t;try{t=e.activeElement}catch(n){t=e.body||null}for(;t&&t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;return t}function F(e,t){var n=e.className;E(t).test(n)||(e.className+=(n?" ":"")+t)}function A(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!E(n[r]).test(t)&&(t+=" "+n[r]);return t}O=e.createRange?function(t,n,r,o){var i=e.createRange();return i.setEnd(o||t,r),i.setStart(t,n),i}:function(t,n,r){var o=e.body.createTextRange();try{o.moveToElementText(t.parentNode)}catch(e){return o}return o.collapse(!0),o.moveEnd("character",r),o.moveStart("character",n),o};var j=function(e){e.select()};function I(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function R(e,t,n){for(var r in t||(t={}),e)!e.hasOwnProperty(r)||!1===n&&t.hasOwnProperty(r)||(t[r]=e[r]);return t}function B(e,t,n,r,o){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var i=r||0,a=o||0;;){var s=e.indexOf("\t",i);if(s<0||s>=t)return a+(t-i);a+=s-i,a+=n-a%n,i=s+1}}m?j=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:s&&(j=function(e){try{e.select()}catch(e){}});var H=function(){this.id=null};function W(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}H.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var V=30,G={toString:function(){return"CodeMirror.Pass"}},U={scroll:!1},z={origin:"*mouse"},q={origin:"+move"};function K(e,t,n){for(var r=0,o=0;;){var i=e.indexOf("\t",r);-1==i&&(i=e.length);var a=i-r;if(i==e.length||o+a>=t)return r+Math.min(a,t-o);if(o+=i-r,r=i+1,(o+=n-o%n)>=t)return r}}var $=[""];function X(e){for(;$.length<=e;)$.push(Y($)+" ");return $[e]}function Y(e){return e[e.length-1]}function J(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function Q(){}function Z(e,t){var n;return Object.create?n=Object.create(e):(Q.prototype=e,n=new Q),t&&R(t,n),n}var ee=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function te(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||ee.test(e))}function ne(e,t){return t?!!(t.source.indexOf("\\w")>-1&&te(e))||t.test(e):te(e)}function re(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var oe=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function ie(e){return e.charCodeAt(0)>=768&&oe.test(e)}function ae(e,t,n){for(;(n<0?t>0:t<e.length)&&ie(e.charAt(t));)t+=n;return t}function se(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var o=(t+n)/2,i=r<0?Math.ceil(o):Math.floor(o);if(i==t)return e(i)?t:n;e(i)?n=i:t=i+r}}function le(e,t,n){var o=this;this.input=n,o.scrollbarFiller=D("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=D("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=P("div",null,"CodeMirror-code"),o.selectionDiv=D("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=D("div",null,"CodeMirror-cursors"),o.measure=D("div",null,"CodeMirror-measure"),o.lineMeasure=D("div",null,"CodeMirror-measure"),o.lineSpace=P("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var i=P("div",[o.lineSpace],"CodeMirror-lines");o.mover=D("div",[i],null,"position: relative"),o.sizer=D("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=D("div",null,null,"position: absolute; height: "+V+"px; width: 1px;"),o.gutters=D("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=D("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=D("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),s&&l<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),u||r&&b||(o.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(o.wrapper):e(o.wrapper)),o.viewFrom=o.viewTo=t.first,o.reportedViewFrom=o.reportedViewTo=t.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,n.init(o)}function ue(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var o=n.children[r],i=o.chunkSize();if(t<i){n=o;break}t-=i}return n.lines[t]}function ce(e,t,n){var r=[],o=t.line;return e.iter(t.line,n.line+1,function(e){var i=e.text;o==n.line&&(i=i.slice(0,n.ch)),o==t.line&&(i=i.slice(t.ch)),r.push(i),++o}),r}function de(e,t,n){var r=[];return e.iter(t,n,function(e){r.push(e.text)}),r}function pe(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function fe(e){if(null==e.parent)return null;for(var t=e.parent,n=W(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var o=0;r.children[o]!=t;++o)n+=r.children[o].chunkSize();return n+t.first}function he(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var o=e.children[r],i=o.height;if(t<i){e=o;continue e}t-=i,n+=o.chunkSize()}return n}while(!e.lines);for(var a=0;a<e.lines.length;++a){var s=e.lines[a],l=s.height;if(t<l)break;t-=l}return n+a}function ge(e,t){return t>=e.first&&t<e.first+e.size}function me(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function ve(e,t,n){if(void 0===n&&(n=null),!(this instanceof ve))return new ve(e,t,n);this.line=e,this.ch=t,this.sticky=n}function be(e,t){return e.line-t.line||e.ch-t.ch}function ye(e,t){return e.sticky==t.sticky&&0==be(e,t)}function _e(e){return ve(e.line,e.ch)}function ke(e,t){return be(e,t)<0?t:e}function we(e,t){return be(e,t)<0?e:t}function Ce(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function Se(e,t){if(t.line<e.first)return ve(e.first,0);var n=e.first+e.size-1;return t.line>n?ve(n,ue(e,n).text.length):function(e,t){var n=e.ch;return null==n||n>t?ve(e.line,t):n<0?ve(e.line,0):e}(t,ue(e,t.line).text.length)}function Ee(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=Se(e,t[r]);return n}var Oe=!1,Te=!1;function xe(e,t,n){this.marker=e,this.from=t,this.to=n}function Me(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function De(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function Pe(e,t){if(t.full)return null;var n=ge(e,t.from.line)&&ue(e,t.from.line).markedSpans,r=ge(e,t.to.line)&&ue(e,t.to.line).markedSpans;if(!n&&!r)return null;var o=t.from.ch,i=t.to.ch,a=0==be(t.from,t.to),s=function(e,t,n){var r;if(e)for(var o=0;o<e.length;++o){var i=e[o],a=i.marker,s=null==i.from||(a.inclusiveLeft?i.from<=t:i.from<t);if(s||i.from==t&&"bookmark"==a.type&&(!n||!i.marker.insertLeft)){var l=null==i.to||(a.inclusiveRight?i.to>=t:i.to>t);(r||(r=[])).push(new xe(a,i.from,l?null:i.to))}}return r}(n,o,a),l=function(e,t,n){var r;if(e)for(var o=0;o<e.length;++o){var i=e[o],a=i.marker,s=null==i.to||(a.inclusiveRight?i.to>=t:i.to>t);if(s||i.from==t&&"bookmark"==a.type&&(!n||i.marker.insertLeft)){var l=null==i.from||(a.inclusiveLeft?i.from<=t:i.from<t);(r||(r=[])).push(new xe(a,l?null:i.from-t,null==i.to?null:i.to-t))}}return r}(r,i,a),u=1==t.text.length,c=Y(t.text).length+(u?o:0);if(s)for(var d=0;d<s.length;++d){var p=s[d];if(null==p.to){var f=Me(l,p.marker);f?u&&(p.to=null==f.to?null:f.to+c):p.to=o}}if(l)for(var h=0;h<l.length;++h){var g=l[h];if(null!=g.to&&(g.to+=c),null==g.from){var m=Me(s,g.marker);m||(g.from=c,u&&(s||(s=[])).push(g))}else g.from+=c,u&&(s||(s=[])).push(g)}s&&(s=Ne(s)),l&&l!=s&&(l=Ne(l));var v=[s];if(!u){var b,y=t.text.length-2;if(y>0&&s)for(var _=0;_<s.length;++_)null==s[_].to&&(b||(b=[])).push(new xe(s[_].marker,null,null));for(var k=0;k<y;++k)v.push(b);v.push(l)}return v}function Ne(e){for(var t=0;t<e.length;++t){var n=e[t];null!=n.from&&n.from==n.to&&!1!==n.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function Le(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function Fe(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function Ae(e){return e.inclusiveLeft?-1:0}function je(e){return e.inclusiveRight?1:0}function Ie(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var r=e.find(),o=t.find(),i=be(r.from,o.from)||Ae(e)-Ae(t);if(i)return-i;var a=be(r.to,o.to)||je(e)-je(t);return a||t.id-e.id}function Re(e,t){var n,r=Te&&e.markedSpans;if(r)for(var o=void 0,i=0;i<r.length;++i)(o=r[i]).marker.collapsed&&null==(t?o.from:o.to)&&(!n||Ie(n,o.marker)<0)&&(n=o.marker);return n}function Be(e){return Re(e,!0)}function He(e){return Re(e,!1)}function We(e,t,n,r,o){var i=ue(e,t),a=Te&&i.markedSpans;if(a)for(var s=0;s<a.length;++s){var l=a[s];if(l.marker.collapsed){var u=l.marker.find(0),c=be(u.from,n)||Ae(l.marker)-Ae(o),d=be(u.to,r)||je(l.marker)-je(o);if(!(c>=0&&d<=0||c<=0&&d>=0)&&(c<=0&&(l.marker.inclusiveRight&&o.inclusiveLeft?be(u.to,n)>=0:be(u.to,n)>0)||c>=0&&(l.marker.inclusiveRight&&o.inclusiveLeft?be(u.from,r)<=0:be(u.from,r)<0)))return!0}}}function Ve(e){for(var t;t=Be(e);)e=t.find(-1,!0).line;return e}function Ge(e,t){var n=ue(e,t),r=Ve(n);return n==r?t:fe(r)}function Ue(e,t){if(t>e.lastLine())return t;var n,r=ue(e,t);if(!ze(e,r))return t;for(;n=He(r);)r=n.find(1,!0).line;return fe(r)+1}function ze(e,t){var n=Te&&t.markedSpans;if(n)for(var r=void 0,o=0;o<n.length;++o)if((r=n[o]).marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&qe(e,t,r))return!0}}function qe(e,t,n){if(null==n.to){var r=n.marker.find(1,!0);return qe(e,r.line,Me(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var o=void 0,i=0;i<t.markedSpans.length;++i)if((o=t.markedSpans[i]).marker.collapsed&&!o.marker.widgetNode&&o.from==n.to&&(null==o.to||o.to!=n.from)&&(o.marker.inclusiveLeft||n.marker.inclusiveRight)&&qe(e,t,o))return!0}function Ke(e){e=Ve(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var o=n.lines[r];if(o==e)break;t+=o.height}for(var i=n.parent;i;i=(n=i).parent)for(var a=0;a<i.children.length;++a){var s=i.children[a];if(s==n)break;t+=s.height}return t}function $e(e){if(0==e.height)return 0;for(var t,n=e.text.length,r=e;t=Be(r);){var o=t.find(0,!0);r=o.from.line,n+=o.from.ch-o.to.ch}for(r=e;t=He(r);){var i=t.find(0,!0);n-=r.text.length-i.from.ch,r=i.to.line,n+=r.text.length-i.to.ch}return n}function Xe(e){var t=e.display,n=e.doc;t.maxLine=ue(n,n.first),t.maxLineLength=$e(t.maxLine),t.maxLineChanged=!0,n.iter(function(e){var n=$e(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)})}var Ye=null;function Je(e,t,n){var r;Ye=null;for(var o=0;o<e.length;++o){var i=e[o];if(i.from<t&&i.to>t)return o;i.to==t&&(i.from!=i.to&&"before"==n?r=o:Ye=o),i.from==t&&(i.from!=i.to&&"before"!=n?r=o:Ye=o)}return null!=r?r:Ye}var Qe=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,r=/[stwN]/,o=/[LRr]/,i=/[Lb1n]/,a=/[1n]/;function s(e,t,n){this.level=e,this.from=t,this.to=n}return function(l,u){var c,d="ltr"==u?"L":"R";if(0==l.length||"ltr"==u&&!n.test(l))return!1;for(var p=l.length,f=[],h=0;h<p;++h)f.push((c=l.charCodeAt(h))<=247?e.charAt(c):1424<=c&&c<=1524?"R":1536<=c&&c<=1785?t.charAt(c-1536):1774<=c&&c<=2220?"r":8192<=c&&c<=8203?"w":8204==c?"b":"L");for(var g=0,m=d;g<p;++g){var v=f[g];"m"==v?f[g]=m:m=v}for(var b=0,y=d;b<p;++b){var _=f[b];"1"==_&&"r"==y?f[b]="n":o.test(_)&&(y=_,"r"==_&&(f[b]="R"))}for(var k=1,w=f[0];k<p-1;++k){var C=f[k];"+"==C&&"1"==w&&"1"==f[k+1]?f[k]="1":","!=C||w!=f[k+1]||"1"!=w&&"n"!=w||(f[k]=w),w=C}for(var S=0;S<p;++S){var E=f[S];if(","==E)f[S]="N";else if("%"==E){var O=void 0;for(O=S+1;O<p&&"%"==f[O];++O);for(var T=S&&"!"==f[S-1]||O<p&&"1"==f[O]?"1":"N",x=S;x<O;++x)f[x]=T;S=O-1}}for(var M=0,D=d;M<p;++M){var P=f[M];"L"==D&&"1"==P?f[M]="L":o.test(P)&&(D=P)}for(var N=0;N<p;++N)if(r.test(f[N])){var L=void 0;for(L=N+1;L<p&&r.test(f[L]);++L);for(var F="L"==(N?f[N-1]:d),A="L"==(L<p?f[L]:d),j=F==A?F?"L":"R":d,I=N;I<L;++I)f[I]=j;N=L-1}for(var R,B=[],H=0;H<p;)if(i.test(f[H])){var W=H;for(++H;H<p&&i.test(f[H]);++H);B.push(new s(0,W,H))}else{var V=H,G=B.length;for(++H;H<p&&"L"!=f[H];++H);for(var U=V;U<H;)if(a.test(f[U])){V<U&&B.splice(G,0,new s(1,V,U));var z=U;for(++U;U<H&&a.test(f[U]);++U);B.splice(G,0,new s(2,z,U)),V=U}else++U;V<H&&B.splice(G,0,new s(1,V,H))}return"ltr"==u&&(1==B[0].level&&(R=l.match(/^\s+/))&&(B[0].from=R[0].length,B.unshift(new s(0,0,R[0].length))),1==Y(B).level&&(R=l.match(/\s+$/))&&(Y(B).to-=R[0].length,B.push(new s(0,p-R[0].length,p)))),"rtl"==u?B.reverse():B}}();function Ze(e,t){var n=e.order;return null==n&&(n=e.order=Qe(e.text,t)),n}var et=[],tt=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||et).concat(n)}};function nt(e,t){return e._handlers&&e._handlers[t]||et}function rt(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,o=r&&r[t];if(o){var i=W(o,n);i>-1&&(r[t]=o.slice(0,i).concat(o.slice(i+1)))}}}function ot(e,t){var n=nt(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),o=0;o<n.length;++o)n[o].apply(null,r)}function it(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),ot(e,n||t.type,e,t),dt(t)||t.codemirrorIgnore}function at(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)-1==W(n,t[r])&&n.push(t[r])}function st(e,t){return nt(e,t).length>0}function lt(e){e.prototype.on=function(e,t){tt(this,e,t)},e.prototype.off=function(e,t){rt(this,e,t)}}function ut(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ct(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function dt(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function pt(e){ut(e),ct(e)}function ft(e){return e.target||e.srcElement}function ht(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),y&&e.ctrlKey&&1==t&&(t=3),t}var gt,mt,vt=function(){if(s&&l<9)return!1;var e=D("div");return"draggable"in e||"dragDrop"in e}();function bt(t){if(null==gt){var n=D("span","\u200b");M(t,D("span",[n,e.createTextNode("x")])),0!=t.firstChild.offsetHeight&&(gt=n.offsetWidth<=1&&n.offsetHeight>2&&!(s&&l<8))}var r=gt?D("span","\u200b"):D("span","\xa0",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}function yt(t){if(null!=mt)return mt;var n=M(t,e.createTextNode("A\u062eA")),r=O(n,0,1).getBoundingClientRect(),o=O(n,1,2).getBoundingClientRect();return x(t),!(!r||r.left==r.right)&&(mt=o.right-r.right<3)}var _t,kt=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){var o=e.indexOf("\n",t);-1==o&&(o=e.length);var i=e.slice(t,"\r"==e.charAt(o-1)?o-1:o),a=i.indexOf("\r");-1!=a?(n.push(i.slice(0,a)),t+=a+1):(n.push(i),t=o+1)}return n}:function(e){return e.split(/\r\n?|\n/)},wt=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Ct="oncopy"in(_t=D("div"))||(_t.setAttribute("oncopy","return;"),"function"==typeof _t.oncopy),St=null,Et={},Ot={};function Tt(e){if("string"==typeof e&&Ot.hasOwnProperty(e))e=Ot[e];else if(e&&"string"==typeof e.name&&Ot.hasOwnProperty(e.name)){var t=Ot[e.name];"string"==typeof t&&(t={name:t}),(e=Z(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Tt("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Tt("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function xt(e,t){t=Tt(t);var n=Et[t.name];if(!n)return xt(e,"text/plain");var r=n(e,t);if(Mt.hasOwnProperty(t.name)){var o=Mt[t.name];for(var i in o)o.hasOwnProperty(i)&&(r.hasOwnProperty(i)&&(r["_"+i]=r[i]),r[i]=o[i])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)r[a]=t.modeProps[a];return r}var Mt={};function Dt(e,t){var n=Mt.hasOwnProperty(e)?Mt[e]:Mt[e]={};R(t,n)}function Pt(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var o=t[r];o instanceof Array&&(o=o.concat([])),n[r]=o}return n}function Nt(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Lt(e,t,n){return!e.startState||e.startState(t,n)}var Ft=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};Ft.prototype.eol=function(){return this.pos>=this.string.length},Ft.prototype.sol=function(){return this.pos==this.lineStart},Ft.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ft.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Ft.prototype.eat=function(e){var t=this.string.charAt(this.pos);if("string"==typeof e?t==e:t&&(e.test?e.test(t):e(t)))return++this.pos,t},Ft.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Ft.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ft.prototype.skipToEnd=function(){this.pos=this.string.length},Ft.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ft.prototype.backUp=function(e){this.pos-=e},Ft.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=B(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?B(this.string,this.lineStart,this.tabSize):0)},Ft.prototype.indentation=function(){return B(this.string,null,this.tabSize)-(this.lineStart?B(this.string,this.lineStart,this.tabSize):0)},Ft.prototype.match=function(e,t,n){if("string"!=typeof e){var r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var o=function(e){return n?e.toLowerCase():e},i=this.string.substr(this.pos,e.length);if(o(i)==o(e))return!1!==t&&(this.pos+=e.length),!0},Ft.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ft.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ft.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ft.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var At=function(e,t){this.state=e,this.lookAhead=t},jt=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function It(e,t,n,r){var o=[e.state.modeGen],i={};qt(e,t.text,e.doc.mode,n,function(e,t){return o.push(e,t)},i,r);for(var a=n.state,s=function(r){n.baseTokens=o;var s=e.state.overlays[r],l=1,u=0;n.state=!0,qt(e,t.text,s.mode,n,function(e,t){for(var n=l;u<e;){var r=o[l];r>e&&o.splice(l,1,e,o[l+1],r),l+=2,u=Math.min(e,r)}if(t)if(s.opaque)o.splice(n,l-n,e,"overlay "+t),l=n+2;else for(;n<l;n+=2){var i=o[n+1];o[n+1]=(i?i+" ":"")+"overlay "+t}},i),n.state=a,n.baseTokens=null,n.baseTokenPos=1},l=0;l<e.state.overlays.length;++l)s(l);return{styles:o,classes:i.bgClass||i.textClass?i:null}}function Rt(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=Bt(e,fe(t)),o=t.text.length>e.options.maxHighlightLength&&Pt(e.doc.mode,r.state),i=It(e,t,r);o&&(r.state=o),t.stateAfter=r.save(!o),t.styles=i.styles,i.classes?t.styleClasses=i.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Bt(e,t,n){var r=e.doc,o=e.display;if(!r.mode.startState)return new jt(r,!0,t);var i=function(e,t,n){for(var r,o,i=e.doc,a=n?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>a;--s){if(s<=i.first)return i.first;var l=ue(i,s-1),u=l.stateAfter;if(u&&(!n||s+(u instanceof At?u.lookAhead:0)<=i.modeFrontier))return s;var c=B(l.text,null,e.options.tabSize);(null==o||r>c)&&(o=s-1,r=c)}return o}(e,t,n),a=i>r.first&&ue(r,i-1).stateAfter,s=a?jt.fromSaved(r,a,i):new jt(r,Lt(r.mode),i);return r.iter(i,t,function(n){Ht(e,n.text,s);var r=s.line;n.stateAfter=r==t-1||r%5==0||r>=o.viewFrom&&r<o.viewTo?s.save():null,s.nextLine()}),n&&(r.modeFrontier=s.line),s}function Ht(e,t,n,r){var o=e.doc.mode,i=new Ft(t,e.options.tabSize,n);for(i.start=i.pos=r||0,""==t&&Wt(o,n.state);!i.eol();)Vt(o,i,n.state),i.start=i.pos}function Wt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=Nt(e,t);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function Vt(e,t,n,r){for(var o=0;o<10;o++){r&&(r[0]=Nt(e,n).mode);var i=e.token(t,n);if(t.pos>t.start)return i}throw new Error("Mode "+e.name+" failed to advance stream.")}jt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},jt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},jt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},jt.fromSaved=function(e,t,n){return t instanceof At?new jt(e,Pt(e.mode,t.state),n,t.lookAhead):new jt(e,Pt(e.mode,t),n)},jt.prototype.save=function(e){var t=!1!==e?Pt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new At(t,this.maxLookAhead):t};var Gt=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function Ut(e,t,n,r){var o,i=e.doc,a=i.mode;t=Se(i,t);var s,l=ue(i,t.line),u=Bt(e,t.line,n),c=new Ft(l.text,e.options.tabSize,u);for(r&&(s=[]);(r||c.pos<t.ch)&&!c.eol();)c.start=c.pos,o=Vt(a,c,u.state),r&&s.push(new Gt(c,o,Pt(i.mode,u.state)));return r?s:new Gt(c,o,u.state)}function zt(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";null==t[r]?t[r]=n[2]:new RegExp("(?:^|s)"+n[2]+"(?:$|s)").test(t[r])||(t[r]+=" "+n[2])}return e}function qt(e,t,n,r,o,i,a){var s=n.flattenSpans;null==s&&(s=e.options.flattenSpans);var l,u=0,c=null,d=new Ft(t,e.options.tabSize,r),p=e.options.addModeClass&&[null];for(""==t&&zt(Wt(n,r.state),i);!d.eol();){if(d.pos>e.options.maxHighlightLength?(s=!1,a&&Ht(e,t,r,d.pos),d.pos=t.length,l=null):l=zt(Vt(n,d,r.state,p),i),p){var f=p[0].name;f&&(l="m-"+(l?f+" "+l:f))}if(!s||c!=l){for(;u<d.start;)u=Math.min(d.start,u+5e3),o(u,c);c=l}d.start=d.pos}for(;u<d.pos;){var h=Math.min(d.pos,u+5e3);o(h,c),u=h}}var Kt=function(e,t,n){this.text=e,Fe(this,t),this.height=n?n(this):1};function $t(e){e.parent=null,Le(e)}Kt.prototype.lineNo=function(){return fe(this)},lt(Kt);var Xt={},Yt={};function Jt(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Yt:Xt;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Qt(e,t){var n=P("span",null,null,u?"padding-right: .1px":null),r={pre:P("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:(s||u)&&e.getOption("lineWrapping")};t.measure={};for(var o=0;o<=(t.rest?t.rest.length:0);o++){var i=o?t.rest[o-1]:t.line,a=void 0;r.pos=0,r.addToken=en,yt(e.display.measure)&&(a=Ze(i,e.doc.direction))&&(r.addToken=tn(r.addToken,a)),r.map=[];var l=t!=e.display.externalMeasured&&fe(i);rn(i,r,Rt(e,i,l)),i.styleClasses&&(i.styleClasses.bgClass&&(r.bgClass=A(i.styleClasses.bgClass,r.bgClass||"")),i.styleClasses.textClass&&(r.textClass=A(i.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(bt(e.display.measure))),0==o?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(u){var c=r.content.lastChild;(/\bcm-tab\b/.test(c.className)||c.querySelector&&c.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return ot(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=A(r.pre.className,r.textClass||"")),r}function Zt(e){var t=D("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function en(t,n,r,o,i,a,u){if(n){var c,d=t.splitSpaces?function(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",o=0;o<e.length;o++){var i=e.charAt(o);" "!=i||!n||o!=e.length-1&&32!=e.charCodeAt(o+1)||(i="\xa0"),r+=i,n=" "==i}return r}(n,t.trailingSpace):n,p=t.cm.state.specialChars,f=!1;if(p.test(n)){c=e.createDocumentFragment();for(var h=0;;){p.lastIndex=h;var g=p.exec(n),m=g?g.index-h:n.length-h;if(m){var v=e.createTextNode(d.slice(h,h+m));s&&l<9?c.appendChild(D("span",[v])):c.appendChild(v),t.map.push(t.pos,t.pos+m,v),t.col+=m,t.pos+=m}if(!g)break;h+=m+1;var b=void 0;if("\t"==g[0]){var y=t.cm.options.tabSize,_=y-t.col%y;(b=c.appendChild(D("span",X(_),"cm-tab"))).setAttribute("role","presentation"),b.setAttribute("cm-text","\t"),t.col+=_}else"\r"==g[0]||"\n"==g[0]?((b=c.appendChild(D("span","\r"==g[0]?"\u240d":"\u2424","cm-invalidchar"))).setAttribute("cm-text",g[0]),t.col+=1):((b=t.cm.options.specialCharPlaceholder(g[0])).setAttribute("cm-text",g[0]),s&&l<9?c.appendChild(D("span",[b])):c.appendChild(b),t.col+=1);t.map.push(t.pos,t.pos+1,b),t.pos++}}else t.col+=n.length,c=e.createTextNode(d),t.map.push(t.pos,t.pos+n.length,c),s&&l<9&&(f=!0),t.pos+=n.length;if(t.trailingSpace=32==d.charCodeAt(n.length-1),r||o||i||f||u){var k=r||"";o&&(k+=o),i&&(k+=i);var w=D("span",[c],k,u);return a&&(w.title=a),t.content.appendChild(w)}t.content.appendChild(c)}}function tn(e,t){return function(n,r,o,i,a,s,l){o=o?o+" cm-force-border":"cm-force-border";for(var u=n.pos,c=u+r.length;;){for(var d=void 0,p=0;p<t.length&&!((d=t[p]).to>u&&d.from<=u);p++);if(d.to>=c)return e(n,r,o,i,a,s,l);e(n,r.slice(0,d.to-u),o,i,null,s,l),i=null,r=r.slice(d.to-u),u=d.to}}}function nn(t,n,r,o){var i=!o&&r.widgetNode;i&&t.map.push(t.pos,t.pos+n,i),!o&&t.cm.display.input.needsContentAttribute&&(i||(i=t.content.appendChild(e.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(t.cm.display.input.setUneditable(i),t.content.appendChild(i)),t.pos+=n,t.trailingSpace=!1}function rn(e,t,n){var r=e.markedSpans,o=e.text,i=0;if(r)for(var a,s,l,u,c,d,p,f=o.length,h=0,g=1,m="",v=0;;){if(v==h){l=u=c=d=s="",p=null,v=1/0;for(var b=[],y=void 0,_=0;_<r.length;++_){var k=r[_],w=k.marker;"bookmark"==w.type&&k.from==h&&w.widgetNode?b.push(w):k.from<=h&&(null==k.to||k.to>h||w.collapsed&&k.to==h&&k.from==h)?(null!=k.to&&k.to!=h&&v>k.to&&(v=k.to,u=""),w.className&&(l+=" "+w.className),w.css&&(s=(s?s+";":"")+w.css),w.startStyle&&k.from==h&&(c+=" "+w.startStyle),w.endStyle&&k.to==v&&(y||(y=[])).push(w.endStyle,k.to),w.title&&!d&&(d=w.title),w.collapsed&&(!p||Ie(p.marker,w)<0)&&(p=k)):k.from>h&&v>k.from&&(v=k.from)}if(y)for(var C=0;C<y.length;C+=2)y[C+1]==v&&(u+=" "+y[C]);if(!p||p.from==h)for(var S=0;S<b.length;++S)nn(t,0,b[S]);if(p&&(p.from||0)==h){if(nn(t,(null==p.to?f+1:p.to)-h,p.marker,null==p.from),null==p.to)return;p.to==h&&(p=!1)}}if(h>=f)break;for(var E=Math.min(f,v);;){if(m){var O=h+m.length;if(!p){var T=O>E?m.slice(0,E-h):m;t.addToken(t,T,a?a+l:l,c,h+T.length==v?u:"",d,s)}if(O>=E){m=m.slice(E-h),h=E;break}h=O,c=""}m=o.slice(i,i=n[g++]),a=Jt(n[g++],t.cm.options)}}else for(var x=1;x<n.length;x+=2)t.addToken(t,o.slice(i,i=n[x]),Jt(n[x+1],t.cm.options))}function on(e,t,n){this.line=t,this.rest=function(e){for(var t,n;t=He(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}(t),this.size=this.rest?fe(Y(this.rest))-n+1:1,this.node=this.text=null,this.hidden=ze(e,t)}function an(e,t,n){for(var r,o=[],i=t;i<n;i=r){var a=new on(e.doc,ue(e.doc,i),i);r=i+a.size,o.push(a)}return o}var sn=null,ln=null;function un(e,t){var n=nt(e,t);if(n.length){var r,o=Array.prototype.slice.call(arguments,2);sn?r=sn.delayedCallbacks:ln?r=ln:(r=ln=[],setTimeout(cn,0));for(var i=function(e){r.push(function(){return n[e].apply(null,o)})},a=0;a<n.length;++a)i(a)}}function cn(){var e=ln;ln=null;for(var t=0;t<e.length;++t)e[t]()}function dn(e,t,n,r){for(var o=0;o<t.changes.length;o++){var i=t.changes[o];"text"==i?hn(e,t):"gutter"==i?mn(e,t,n,r):"class"==i?gn(e,t):"widget"==i&&vn(e,t,r)}t.changes=null}function pn(e){return e.node==e.text&&(e.node=D("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),s&&l<8&&(e.node.style.zIndex=2)),e.node}function fn(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Qt(e,t)}function hn(e,t){var n=t.text.className,r=fn(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,gn(e,t)):n&&(t.text.className=n)}function gn(e,t){!function(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=pn(t);t.background=r.insertBefore(D("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}(e,t),t.line.wrapClass?pn(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function mn(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var o=pn(t);t.gutterBackground=D("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),o.insertBefore(t.gutterBackground,t.text)}var i=t.line.gutterMarkers;if(e.options.lineNumbers||i){var a=pn(t),s=t.gutter=D("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(s),a.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=" "+t.line.gutterClass),!e.options.lineNumbers||i&&i["CodeMirror-linenumbers"]||(t.lineNumber=s.appendChild(D("div",me(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),i)for(var l=0;l<e.options.gutters.length;++l){var u=e.options.gutters[l],c=i.hasOwnProperty(u)&&i[u];c&&s.appendChild(D("div",[c],"CodeMirror-gutter-elt","left: "+r.gutterLeft[u]+"px; width: "+r.gutterWidth[u]+"px"))}}}function vn(e,t,n){t.alignable&&(t.alignable=null);for(var r=t.node.firstChild,o=void 0;r;r=o)o=r.nextSibling,"CodeMirror-linewidget"==r.className&&t.node.removeChild(r);yn(e,t,n)}function bn(e,t,n,r){var o=fn(e,t);return t.text=t.node=o.pre,o.bgClass&&(t.bgClass=o.bgClass),o.textClass&&(t.textClass=o.textClass),gn(e,t),mn(e,t,n,r),yn(e,t,r),t.node}function yn(e,t,n){if(_n(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)_n(e,t.rest[r],t,n,!1)}function _n(e,t,n,r,o){if(t.widgets)for(var i=pn(n),a=0,s=t.widgets;a<s.length;++a){var l=s[a],u=D("div",[l.node],"CodeMirror-linewidget");l.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),kn(l,u,n,r),e.display.input.setUneditable(u),o&&l.above?i.insertBefore(u,n.gutter||n.text):i.appendChild(u),un(l,"redraw")}}function kn(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var o=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(o-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=o+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function wn(t){if(null!=t.height)return t.height;var n=t.doc.cm;if(!n)return 0;if(!N(e.body,t.node)){var r="position: relative;";t.coverGutter&&(r+="margin-left: -"+n.display.gutters.offsetWidth+"px;"),t.noHScroll&&(r+="width: "+n.display.wrapper.clientWidth+"px;"),M(n.display.measure,D("div",[t.node],null,r))}return t.height=t.node.parentNode.offsetHeight}function Cn(e,t){for(var n=ft(t);n!=e.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==e.sizer&&n!=e.mover)return!0}function Sn(e){return e.lineSpace.offsetTop}function En(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function On(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=M(e.measure,D("pre","x")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(r.left)||isNaN(r.right)||(e.cachedPaddingH=r),r}function Tn(e){return V-e.display.nativeBarWidth}function xn(e){return e.display.scroller.clientWidth-Tn(e)-e.display.barWidth}function Mn(e){return e.display.scroller.clientHeight-Tn(e)-e.display.barHeight}function Dn(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var o=0;o<e.rest.length;o++)if(fe(e.rest[o])>n)return{map:e.measure.maps[o],cache:e.measure.caches[o],before:!0}}function Pn(e,t,n,r){return Fn(e,Ln(e,t),n,r)}function Nn(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[ur(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function Ln(e,t){var n=fe(t),r=Nn(e,n);r&&!r.text?r=null:r&&r.changes&&(dn(e,r,n,or(e)),e.curOp.forceUpdate=!0),r||(r=function(e,t){var n=fe(t=Ve(t)),r=e.display.externalMeasured=new on(e.doc,t,n);r.lineN=n;var o=r.built=Qt(e,r);return r.text=o.pre,M(e.display.lineMeasure,o.pre),r}(e,t));var o=Dn(r,t,n);return{line:t,view:r,rect:null,map:o.map,cache:o.cache,before:o.before,hasHeights:!1}}function Fn(e,t,n,r,o){t.before&&(n=-1);var i,a=n+(r||"");return t.cache.hasOwnProperty(a)?i=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(function(e,t,n){var r=e.options.lineWrapping,o=r&&xn(e);if(!t.measure.heights||r&&t.measure.width!=o){var i=t.measure.heights=[];if(r){t.measure.width=o;for(var a=t.text.firstChild.getClientRects(),s=0;s<a.length-1;s++){var l=a[s],u=a[s+1];Math.abs(l.bottom-u.bottom)>2&&i.push((l.bottom+u.top)/2-n.top)}}i.push(n.bottom-n.top)}}(e,t.view,t.rect),t.hasHeights=!0),(i=function(e,t,n,r){var o,i=In(t.map,n,r),a=i.node,u=i.start,c=i.end,d=i.collapse;if(3==a.nodeType){for(var p=0;p<4;p++){for(;u&&ie(t.line.text.charAt(i.coverStart+u));)--u;for(;i.coverStart+c<i.coverEnd&&ie(t.line.text.charAt(i.coverStart+c));)++c;if((o=s&&l<9&&0==u&&c==i.coverEnd-i.coverStart?a.parentNode.getBoundingClientRect():Rn(O(a,u,c).getClientRects(),r)).left||o.right||0==u)break;c=u,u-=1,d="right"}s&&l<11&&(o=function(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(e){if(null!=St)return St;var t=M(e,D("span","x")),n=t.getBoundingClientRect(),r=O(t,0,1).getBoundingClientRect();return St=Math.abs(n.left-r.left)>1}(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}(e.display.measure,o))}else{var f;u>0&&(d=r="right"),o=e.options.lineWrapping&&(f=a.getClientRects()).length>1?f["right"==r?f.length-1:0]:a.getBoundingClientRect()}if(s&&l<9&&!u&&(!o||!o.left&&!o.right)){var h=a.parentNode.getClientRects()[0];o=h?{left:h.left,right:h.left+rr(e.display),top:h.top,bottom:h.bottom}:jn}for(var g=o.top-t.rect.top,m=o.bottom-t.rect.top,v=(g+m)/2,b=t.view.measure.heights,y=0;y<b.length-1&&!(v<b[y]);y++);var _=y?b[y-1]:0,k=b[y],w={left:("right"==d?o.right:o.left)-t.rect.left,right:("left"==d?o.left:o.right)-t.rect.left,top:_,bottom:k};return o.left||o.right||(w.bogus=!0),e.options.singleCursorHeightPerLine||(w.rtop=g,w.rbottom=m),w}(e,t,n,r)).bogus||(t.cache[a]=i)),{left:i.left,right:i.right,top:o?i.rtop:i.top,bottom:o?i.rbottom:i.bottom}}var An,jn={left:0,right:0,top:0,bottom:0};function In(e,t,n){for(var r,o,i,a,s,l,u=0;u<e.length;u+=3)if(s=e[u],l=e[u+1],t<s?(o=0,i=1,a="left"):t<l?i=1+(o=t-s):(u==e.length-3||t==l&&e[u+3]>t)&&(o=(i=l-s)-1,t>=l&&(a="right")),null!=o){if(r=e[u+2],s==l&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==o)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)r=e[2+(u-=3)],a="left";if("right"==n&&o==l-s)for(;u<e.length-3&&e[u+3]==e[u+4]&&!e[u+5].insertLeft;)r=e[(u+=3)+2],a="right";break}return{node:r,start:o,end:i,collapse:a,coverStart:s,coverEnd:l}}function Rn(e,t){var n=jn;if("left"==t)for(var r=0;r<e.length&&(n=e[r]).left==n.right;r++);else for(var o=e.length-1;o>=0&&(n=e[o]).left==n.right;o--);return n}function Bn(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function Hn(e){e.display.externalMeasure=null,x(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Bn(e.display.view[t])}function Wn(e){Hn(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Vn(){return d&&v?-(e.body.getBoundingClientRect().left-parseInt(getComputedStyle(e.body).marginLeft)):window.pageXOffset||(e.documentElement||e.body).scrollLeft}function Gn(){return d&&v?-(e.body.getBoundingClientRect().top-parseInt(getComputedStyle(e.body).marginTop)):window.pageYOffset||(e.documentElement||e.body).scrollTop}function Un(e){var t=0;if(e.widgets)for(var n=0;n<e.widgets.length;++n)e.widgets[n].above&&(t+=wn(e.widgets[n]));return t}function zn(e,t,n,r,o){if(!o){var i=Un(t);n.top+=i,n.bottom+=i}if("line"==r)return n;r||(r="local");var a=Ke(t);if("local"==r?a+=Sn(e.display):a-=e.display.viewOffset,"page"==r||"window"==r){var s=e.display.lineSpace.getBoundingClientRect();a+=s.top+("window"==r?0:Gn());var l=s.left+("window"==r?0:Vn());n.left+=l,n.right+=l}return n.top+=a,n.bottom+=a,n}function qn(e,t,n){if("div"==n)return t;var r=t.left,o=t.top;if("page"==n)r-=Vn(),o-=Gn();else if("local"==n||!n){var i=e.display.sizer.getBoundingClientRect();r+=i.left,o+=i.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:r-a.left,top:o-a.top}}function Kn(e,t,n,r,o){return r||(r=ue(e.doc,t.line)),zn(e,r,Pn(e,r,t.ch,o),n)}function $n(e,t,n,r,o,i){function a(t,a){var s=Fn(e,o,t,a?"right":"left",i);return a?s.left=s.right:s.right=s.left,zn(e,r,s,n)}r=r||ue(e.doc,t.line),o||(o=Ln(e,r));var s=Ze(r,e.doc.direction),l=t.ch,u=t.sticky;if(l>=r.text.length?(l=r.text.length,u="before"):l<=0&&(l=0,u="after"),!s)return a("before"==u?l-1:l,"before"==u);function c(e,t,n){var r=s[t],o=1==r.level;return a(n?e-1:e,o!=n)}var d=Je(s,l,u),p=Ye,f=c(l,d,"before"==u);return null!=p&&(f.other=c(l,p,"before"!=u)),f}function Xn(e,t){var n=0;t=Se(e.doc,t),e.options.lineWrapping||(n=rr(e.display)*t.ch);var r=ue(e.doc,t.line),o=Ke(r)+Sn(e.display);return{left:n,right:n,top:o,bottom:o+r.height}}function Yn(e,t,n,r,o){var i=ve(e,t,n);return i.xRel=o,r&&(i.outside=!0),i}function Jn(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return Yn(r.first,0,null,!0,-1);var o=he(r,n),i=r.first+r.size-1;if(o>i)return Yn(r.first+r.size-1,ue(r,i).text.length,null,!0,1);t<0&&(t=0);for(var a=ue(r,o);;){var s=tr(e,a,o,t,n),l=He(a),u=l&&l.find(0,!0);if(!l||!(s.ch>u.from.ch||s.ch==u.from.ch&&s.xRel>0))return s;o=fe(a=u.to.line)}}function Qn(e,t,n,r){r-=Un(t);var o=t.text.length,i=se(function(t){return Fn(e,n,t-1).bottom<=r},o,0);return o=se(function(t){return Fn(e,n,t).top>r},i,o),{begin:i,end:o}}function Zn(e,t,n,r){n||(n=Ln(e,t));var o=zn(e,t,Fn(e,n,r),"line").top;return Qn(e,t,n,o)}function er(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function tr(e,t,n,r,o){o-=Ke(t);var i=Ln(e,t),a=Un(t),s=0,l=t.text.length,u=!0,c=Ze(t,e.doc.direction);if(c){var d=(e.options.lineWrapping?function(e,t,n,r,o,i,a){var s=Qn(e,t,r,a),l=s.begin,u=s.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var c=null,d=null,p=0;p<o.length;p++){var f=o[p];if(!(f.from>=u||f.to<=l)){var h=1!=f.level,g=Fn(e,r,h?Math.min(u,f.to)-1:Math.max(l,f.from)).right,m=g<i?i-g+1e9:g-i;(!c||d>m)&&(c=f,d=m)}}return c||(c=o[o.length-1]),c.from<l&&(c={from:l,to:c.to,level:c.level}),c.to>u&&(c={from:c.from,to:u,level:c.level}),c}:function(e,t,n,r,o,i,a){var s=se(function(s){var l=o[s],u=1!=l.level;return er($n(e,ve(n,u?l.to:l.from,u?"before":"after"),"line",t,r),i,a,!0)},0,o.length-1),l=o[s];if(s>0){var u=1!=l.level,c=$n(e,ve(n,u?l.from:l.to,u?"after":"before"),"line",t,r);er(c,i,a,!0)&&c.top>a&&(l=o[s-1])}return l})(e,t,n,i,c,r,o);u=1!=d.level,s=u?d.from:d.to-1,l=u?d.to:d.from-1}var p,f,h=null,g=null,m=se(function(t){var n=Fn(e,i,t);return n.top+=a,n.bottom+=a,!!er(n,r,o,!1)&&(n.top<=o&&n.left<=r&&(h=t,g=n),!0)},s,l),v=!1;if(g){var b=r-g.left<g.right-r,y=b==u;m=h+(y?0:1),f=y?"after":"before",p=b?g.left:g.right}else{u||m!=l&&m!=s||m++,f=0==m?"after":m==t.text.length?"before":Fn(e,i,m-(u?1:0)).bottom+a<=o==u?"after":"before";var _=$n(e,ve(n,m,f),"line",t,i);p=_.left,v=o<_.top||o>=_.bottom}return m=ae(t.text,m,1),Yn(n,m,f,v,r-p)}function nr(t){if(null!=t.cachedTextHeight)return t.cachedTextHeight;if(null==An){An=D("pre");for(var n=0;n<49;++n)An.appendChild(e.createTextNode("x")),An.appendChild(D("br"));An.appendChild(e.createTextNode("x"))}M(t.measure,An);var r=An.offsetHeight/50;return r>3&&(t.cachedTextHeight=r),x(t.measure),r||1}function rr(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=D("span","xxxxxxxxxx"),n=D("pre",[t]);M(e.measure,n);var r=t.getBoundingClientRect(),o=(r.right-r.left)/10;return o>2&&(e.cachedCharWidth=o),o||10}function or(e){for(var t=e.display,n={},r={},o=t.gutters.clientLeft,i=t.gutters.firstChild,a=0;i;i=i.nextSibling,++a)n[e.options.gutters[a]]=i.offsetLeft+i.clientLeft+o,r[e.options.gutters[a]]=i.clientWidth;return{fixedPos:ir(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function ir(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ar(e){var t=nr(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/rr(e.display)-3);return function(o){if(ze(e.doc,o))return 0;var i=0;if(o.widgets)for(var a=0;a<o.widgets.length;a++)o.widgets[a].height&&(i+=o.widgets[a].height);return n?i+(Math.ceil(o.text.length/r)||1)*t:i+t}}function sr(e){var t=e.doc,n=ar(e);t.iter(function(e){var t=n(e);t!=e.height&&pe(e,t)})}function lr(e,t,n,r){var o=e.display;if(!n&&"true"==ft(t).getAttribute("cm-not-content"))return null;var i,a,s=o.lineSpace.getBoundingClientRect();try{i=t.clientX-s.left,a=t.clientY-s.top}catch(t){return null}var l,u=Jn(e,i,a);if(r&&1==u.xRel&&(l=ue(e.doc,u.line).text).length==u.ch){var c=B(l,l.length,e.options.tabSize)-l.length;u=ve(u.line,Math.max(0,Math.round((i-On(e.display).left)/rr(e.display))-c))}return u}function ur(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;r<n.length;r++)if((t-=n[r].size)<0)return r}function cr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function dr(t,n){void 0===n&&(n=!0);for(var r=t.doc,o={},i=o.cursors=e.createDocumentFragment(),a=o.selection=e.createDocumentFragment(),s=0;s<r.sel.ranges.length;s++)if(n||s!=r.sel.primIndex){var l=r.sel.ranges[s];if(!(l.from().line>=t.display.viewTo||l.to().line<t.display.viewFrom)){var u=l.empty();(u||t.options.showCursorWhenSelecting)&&pr(t,l.head,i),u||hr(t,l,a)}}return o}function pr(e,t,n){var r=$n(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),o=n.appendChild(D("div","\xa0","CodeMirror-cursor"));if(o.style.left=r.left+"px",o.style.top=r.top+"px",o.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var i=n.appendChild(D("div","\xa0","CodeMirror-cursor CodeMirror-secondarycursor"));i.style.display="",i.style.left=r.other.left+"px",i.style.top=r.other.top+"px",i.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function fr(e,t){return e.top-t.top||e.left-t.left}function hr(t,n,r){var o=t.display,i=t.doc,a=e.createDocumentFragment(),s=On(t.display),l=s.left,u=Math.max(o.sizerWidth,xn(t)-o.sizer.offsetLeft)-s.right,c="ltr"==i.direction;function d(e,t,n,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),a.appendChild(D("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==n?u-e:n)+"px;\n height: "+(r-t)+"px"))}function p(e,n,r){var o,a,s=ue(i,e),p=s.text.length;function f(n,r){return Kn(t,ve(e,n),"div",s,r)}function h(e,n,r){var o=Zn(t,s,null,e),i="ltr"==n==("after"==r)?"left":"right",a="after"==r?o.begin:o.end-(/\s/.test(s.text.charAt(o.end-1))?2:1);return f(a,i)[i]}var g=Ze(s,i.direction);return function(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var o=!1,i=0;i<e.length;++i){var a=e[i];(a.from<n&&a.to>t||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr",i),o=!0)}o||r(t,n,"ltr")}(g,n||0,null==r?p:r,function(e,t,i,s){var m="ltr"==i,v=f(e,m?"left":"right"),b=f(t-1,m?"right":"left"),y=null==n&&0==e,_=null==r&&t==p,k=0==s,w=!g||s==g.length-1;if(b.top-v.top<=3){var C=(c?y:_)&&k,S=(c?_:y)&&w,E=C?l:(m?v:b).left,O=S?u:(m?b:v).right;d(E,v.top,O-E,v.bottom)}else{var T,x,M,D;m?(T=c&&y&&k?l:v.left,x=c?u:h(e,i,"before"),M=c?l:h(t,i,"after"),D=c&&_&&w?u:b.right):(T=c?h(e,i,"before"):l,x=!c&&y&&k?u:v.right,M=!c&&_&&w?l:b.left,D=c?h(t,i,"after"):u),d(T,v.top,x-T,v.bottom),v.bottom<b.top&&d(l,v.bottom,null,b.top),d(M,b.top,D-M,b.bottom)}(!o||fr(v,o)<0)&&(o=v),fr(b,o)<0&&(o=b),(!a||fr(v,a)<0)&&(a=v),fr(b,a)<0&&(a=b)}),{start:o,end:a}}var f=n.from(),h=n.to();if(f.line==h.line)p(f.line,f.ch,h.ch);else{var g=ue(i,f.line),m=ue(i,h.line),v=Ve(g)==Ve(m),b=p(f.line,f.ch,v?g.text.length+1:null).end,y=p(h.line,v?0:null,h.ch).start;v&&(b.top<y.top-2?(d(b.right,b.top,null,b.bottom),d(l,y.top,y.left,y.bottom)):d(b.right,b.top,y.left-b.right,b.bottom)),b.bottom<y.top&&d(l,b.bottom,null,y.top)}r.appendChild(a)}function gr(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){return t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function mr(e){e.state.focused||(e.display.input.focus(),br(e))}function vr(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,yr(e))},100)}function br(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(ot(e,"focus",e,t),e.state.focused=!0,F(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),u&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),gr(e))}function yr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(ot(e,"blur",e,t),e.state.focused=!1,T(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function _r(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var o=t.view[r],i=void 0;if(!o.hidden){if(s&&l<8){var a=o.node.offsetTop+o.node.offsetHeight;i=a-n,n=a}else{var u=o.node.getBoundingClientRect();i=u.bottom-u.top}var c=o.line.height-i;if(i<2&&(i=nr(t)),(c>.005||c<-.005)&&(pe(o.line,i),kr(o.line),o.rest))for(var d=0;d<o.rest.length;d++)kr(o.rest[d])}}}function kr(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function wr(e,t,n){var r=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-Sn(e));var o=n&&null!=n.bottom?n.bottom:r+e.wrapper.clientHeight,i=he(t,r),a=he(t,o);if(n&&n.ensure){var s=n.ensure.from.line,l=n.ensure.to.line;s<i?(i=s,a=he(t,Ke(ue(t,s))+e.wrapper.clientHeight)):Math.min(l,t.lastLine())>=a&&(i=he(t,Ke(ue(t,l))-e.wrapper.clientHeight),a=l)}return{from:i,to:Math.max(a,i+1)}}function Cr(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=ir(t)-t.scroller.scrollLeft+e.doc.scrollLeft,o=t.gutters.offsetWidth,i=r+"px",a=0;a<n.length;a++)if(!n[a].hidden){e.options.fixedGutter&&(n[a].gutter&&(n[a].gutter.style.left=i),n[a].gutterBackground&&(n[a].gutterBackground.style.left=i));var s=n[a].alignable;if(s)for(var l=0;l<s.length;l++)s[l].style.left=i}e.options.fixedGutter&&(t.gutters.style.left=r+o+"px")}}function Sr(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=me(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var o=r.measure.appendChild(D("div",[D("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),i=o.firstChild.offsetWidth,a=o.offsetWidth-i;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(i,r.lineGutter.offsetWidth-a)+1,r.lineNumWidth=r.lineNumInnerWidth+a,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",uo(e),!0}return!1}function Er(e,t){var n=e.display,r=nr(e.display);t.top<0&&(t.top=0);var o=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,i=Mn(e),a={};t.bottom-t.top>i&&(t.bottom=t.top+i);var s=e.doc.height+En(n),l=t.top<r,u=t.bottom>s-r;if(t.top<o)a.scrollTop=l?0:t.top;else if(t.bottom>o+i){var c=Math.min(t.top,(u?s:t.bottom)-i);c!=o&&(a.scrollTop=c)}var d=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft,p=xn(e)-(e.options.fixedGutter?n.gutters.offsetWidth:0),f=t.right-t.left>p;return f&&(t.right=t.left+p),t.left<10?a.scrollLeft=0:t.left<d?a.scrollLeft=Math.max(0,t.left-(f?0:10)):t.right>p+d-3&&(a.scrollLeft=t.right+(f?0:10)-p),a}function Or(e,t){null!=t&&(Mr(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Tr(e){Mr(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function xr(e,t,n){null==t&&null==n||Mr(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function Mr(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=Xn(e,t.from),r=Xn(e,t.to);Dr(e,n,r,t.margin)}}function Dr(e,t,n,r){var o=Er(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});xr(e,o.scrollLeft,o.scrollTop)}function Pr(e,t){Math.abs(e.doc.scrollTop-t)<2||(r||lo(e,{top:t}),Nr(e,t,!0),r&&lo(e),ro(e,100))}function Nr(e,t,n){t=Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Lr(e,t,n,r){t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,Cr(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Fr(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+En(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Tn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Ar=function(e,t,n){this.cm=n;var r=this.vert=D("div",[D("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=D("div",[D("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(r),e(o),tt(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),tt(o,"scroll",function(){o.clientWidth&&t(o.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,s&&l<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Ar.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var o=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+o)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var i=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+i)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},Ar.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Ar.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Ar.prototype.zeroWidthHack=function(){var e=y&&!h?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new H,this.disableVert=new H},Ar.prototype.enableZeroWidthBar=function(t,n,r){t.style.pointerEvents="auto",n.set(1e3,function o(){var i=t.getBoundingClientRect(),a="vert"==r?e.elementFromPoint(i.right-1,(i.top+i.bottom)/2):e.elementFromPoint((i.right+i.left)/2,i.bottom-1);a!=t?t.style.pointerEvents="none":n.set(1e3,o)})},Ar.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var jr=function(){};function Ir(e,t){t||(t=Fr(e));var n=e.display.barWidth,r=e.display.barHeight;Rr(e,t);for(var o=0;o<4&&n!=e.display.barWidth||r!=e.display.barHeight;o++)n!=e.display.barWidth&&e.options.lineWrapping&&_r(e),Rr(e,Fr(e)),n=e.display.barWidth,r=e.display.barHeight}function Rr(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}jr.prototype.update=function(){return{bottom:0,right:0}},jr.prototype.setScrollLeft=function(){},jr.prototype.setScrollTop=function(){},jr.prototype.clear=function(){};var Br={native:Ar,null:jr};function Hr(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&T(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Br[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),tt(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){"horizontal"==n?Lr(e,t):Pr(e,t)},e),e.display.scrollbars.addClass&&F(e.display.wrapper,e.display.scrollbars.addClass)}var Wr=0;function Vr(e){var t;e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Wr},t=e.curOp,sn?sn.ops.push(t):t.ownsGroup=sn={ops:[t],delayedCallbacks:[]}}function Gr(e){var t=e.curOp;!function(e,t){var n=e.ownsGroup;if(n)try{!function(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var o=e.ops[r];if(o.cursorActivityHandlers)for(;o.cursorActivityCalled<o.cursorActivityHandlers.length;)o.cursorActivityHandlers[o.cursorActivityCalled++].call(null,o.cm)}}while(n<t.length)}(n)}finally{sn=null,t(n)}}(t,function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;!function(e){for(var t=e.ops,n=0;n<t.length;n++)Ur(t[n]);for(var r=0;r<t.length;r++)(o=t[r]).updatedDisplay=o.mustUpdate&&ao(o.cm,o.update);for(var o,i=0;i<t.length;i++)zr(t[i]);for(var a=0;a<t.length;a++)qr(t[a]);for(var s=0;s<t.length;s++)Kr(t[s])}(e)})}function Ur(e){var t=e.cm,n=t.display;!function(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Tn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Tn(e)+"px",t.scrollbarsClipped=!0)}(t),e.updateMaxLine&&Xe(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new io(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function zr(e){var t=e.cm,n=t.display;e.updatedDisplay&&_r(t),e.barMeasure=Fr(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Pn(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Tn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-xn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function qr(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Lr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==L();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Ir(t,e.barMeasure),e.updatedDisplay&&co(t,e.barMeasure),e.selectionChanged&&gr(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&mr(e.cm)}function Kr(t){var n=t.cm,r=n.display,o=n.doc;if(t.updatedDisplay&&so(n,t.update),null==r.wheelStartX||null==t.scrollTop&&null==t.scrollLeft&&!t.scrollToPos||(r.wheelStartX=r.wheelStartY=null),null!=t.scrollTop&&Nr(n,t.scrollTop,t.forceScroll),null!=t.scrollLeft&&Lr(n,t.scrollLeft,!0,!0),t.scrollToPos){var i=function(e,t,n,r){var o;null==r&&(r=0),e.options.lineWrapping||t!=n||(t=t.ch?ve(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t,n="before"==t.sticky?ve(t.line,t.ch+1,"before"):t);for(var i=0;i<5;i++){var a=!1,s=$n(e,t),l=n&&n!=t?$n(e,n):s;o={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-r,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+r};var u=Er(e,o),c=e.doc.scrollTop,d=e.doc.scrollLeft;if(null!=u.scrollTop&&(Pr(e,u.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(a=!0)),null!=u.scrollLeft&&(Lr(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(a=!0)),!a)break}return o}(n,Se(o,t.scrollToPos.from),Se(o,t.scrollToPos.to),t.scrollToPos.margin);!function(t,n){if(!it(t,"scrollCursorIntoView")){var r=window.top||window,o=t.display,i=o.sizer.getBoundingClientRect(),a=null;if(n.top+i.top<0?a=!0:n.bottom+i.top>(r.innerHeight||e.documentElement.clientHeight)&&(a=!1),null!=a&&!g){var s=D("div","\u200b",null,"position: absolute;\n top: "+(n.top-o.viewOffset-Sn(t.display))+"px;\n height: "+(n.bottom-n.top+Tn(t)+o.barHeight)+"px;\n left: "+n.left+"px; width: "+Math.max(2,n.right-n.left)+"px;");t.display.lineSpace.appendChild(s),s.scrollIntoView(a),t.display.lineSpace.removeChild(s)}}}(n,i)}var a=t.maybeHiddenMarkers,s=t.maybeUnhiddenMarkers;if(a)for(var l=0;l<a.length;++l)a[l].lines.length||ot(a[l],"hide");if(s)for(var u=0;u<s.length;++u)s[u].lines.length&&ot(s[u],"unhide");r.wrapper.offsetHeight&&(o.scrollTop=n.display.scroller.scrollTop),t.changeObjs&&ot(n,"changes",n,t.changeObjs),t.update&&t.update.finish()}function $r(e,t){if(e.curOp)return t();Vr(e);try{return t()}finally{Gr(e)}}function Xr(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Vr(e);try{return t.apply(e,arguments)}finally{Gr(e)}}}function Yr(e){return function(){if(this.curOp)return e.apply(this,arguments);Vr(this);try{return e.apply(this,arguments)}finally{Gr(this)}}}function Jr(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Vr(t);try{return e.apply(this,arguments)}finally{Gr(t)}}}function Qr(e,t,n,r){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),r||(r=0);var o=e.display;if(r&&n<o.viewTo&&(null==o.updateLineNumbers||o.updateLineNumbers>t)&&(o.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=o.viewTo)Te&&Ge(e.doc,t)<o.viewTo&&eo(e);else if(n<=o.viewFrom)Te&&Ue(e.doc,n+r)>o.viewFrom?eo(e):(o.viewFrom+=r,o.viewTo+=r);else if(t<=o.viewFrom&&n>=o.viewTo)eo(e);else if(t<=o.viewFrom){var i=to(e,n,n+r,1);i?(o.view=o.view.slice(i.index),o.viewFrom=i.lineN,o.viewTo+=r):eo(e)}else if(n>=o.viewTo){var a=to(e,t,t,-1);a?(o.view=o.view.slice(0,a.index),o.viewTo=a.lineN):eo(e)}else{var s=to(e,t,t,-1),l=to(e,n,n+r,1);s&&l?(o.view=o.view.slice(0,s.index).concat(an(e,s.lineN,l.lineN)).concat(o.view.slice(l.index)),o.viewTo+=r):eo(e)}var u=o.externalMeasured;u&&(n<u.lineN?u.lineN+=r:t<u.lineN+u.size&&(o.externalMeasured=null))}function Zr(e,t,n){e.curOp.viewChanged=!0;var r=e.display,o=e.display.externalMeasured;if(o&&t>=o.lineN&&t<o.lineN+o.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var i=r.view[ur(e,t)];if(null!=i.node){var a=i.changes||(i.changes=[]);-1==W(a,n)&&a.push(n)}}}function eo(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function to(e,t,n,r){var o,i=ur(e,t),a=e.display.view;if(!Te||n==e.doc.first+e.doc.size)return{index:i,lineN:n};for(var s=e.display.viewFrom,l=0;l<i;l++)s+=a[l].size;if(s!=t){if(r>0){if(i==a.length-1)return null;o=s+a[i].size-t,i++}else o=s-t;t+=o,n+=o}for(;Ge(e.doc,n)!=n;){if(i==(r<0?0:a.length-1))return null;n+=r*a[i-(r<0?1:0)].size,i+=r}return{index:i,lineN:n}}function no(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var o=t[r];o.hidden||o.node&&!o.changes||++n}return n}function ro(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,I(oo,e))}function oo(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=Bt(e,t.highlightFrontier),o=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(i){if(r.line>=e.display.viewFrom){var a=i.styles,s=i.text.length>e.options.maxHighlightLength?Pt(t.mode,r.state):null,l=It(e,i,r,!0);s&&(r.state=s),i.styles=l.styles;var u=i.styleClasses,c=l.classes;c?i.styleClasses=c:u&&(i.styleClasses=null);for(var d=!a||a.length!=i.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),p=0;!d&&p<a.length;++p)d=a[p]!=i.styles[p];d&&o.push(r.line),i.stateAfter=r.save(),r.nextLine()}else i.text.length<=e.options.maxHighlightLength&&Ht(e,i.text,r),i.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return ro(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),o.length&&$r(e,function(){for(var t=0;t<o.length;t++)Zr(e,o[t],"text")})}}var io=function(e,t,n){var r=e.display;this.viewport=t,this.visible=wr(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=xn(e),this.force=n,this.dims=or(e),this.events=[]};function ao(t,n){var r=t.display,o=t.doc;if(n.editorIsHidden)return eo(t),!1;if(!n.force&&n.visible.from>=r.viewFrom&&n.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==no(t))return!1;Sr(t)&&(eo(t),n.dims=or(t));var i=o.first+o.size,a=Math.max(n.visible.from-t.options.viewportMargin,o.first),s=Math.min(i,n.visible.to+t.options.viewportMargin);r.viewFrom<a&&a-r.viewFrom<20&&(a=Math.max(o.first,r.viewFrom)),r.viewTo>s&&r.viewTo-s<20&&(s=Math.min(i,r.viewTo)),Te&&(a=Ge(t.doc,a),s=Ue(t.doc,s));var l=a!=r.viewFrom||s!=r.viewTo||r.lastWrapHeight!=n.wrapperHeight||r.lastWrapWidth!=n.wrapperWidth;!function(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=an(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=an(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(ur(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(an(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,ur(e,n)))),r.viewTo=n}(t,a,s),r.viewOffset=Ke(ue(t.doc,r.viewFrom)),t.display.mover.style.top=r.viewOffset+"px";var c=no(t);if(!l&&0==c&&!n.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var d=function(e){if(e.hasFocus())return null;var t=L();if(!t||!N(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&N(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}(t);return c>4&&(r.lineDiv.style.display="none"),function(t,n,r){var o=t.display,i=t.options.lineNumbers,a=o.lineDiv,s=a.firstChild;function l(e){var n=e.nextSibling;return u&&y&&t.display.currentWheelTarget==e?e.style.display="none":e.parentNode.removeChild(e),n}for(var c=o.view,d=o.viewFrom,p=0;p<c.length;p++){var f=c[p];if(f.hidden);else if(f.node&&f.node.parentNode==a){for(;s!=f.node;)s=l(s);var h=i&&null!=n&&n<=d&&f.lineNumber;f.changes&&(W(f.changes,"gutter")>-1&&(h=!1),dn(t,f,d,r)),h&&(x(f.lineNumber),f.lineNumber.appendChild(e.createTextNode(me(t.options,d)))),s=f.node.nextSibling}else{var g=bn(t,f,d,r);a.insertBefore(g,s)}d+=f.size}for(;s;)s=l(s)}(t,r.updateLineNumbers,n.dims),c>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,function(t){if(t&&t.activeElt&&t.activeElt!=L()&&(t.activeElt.focus(),t.anchorNode&&N(e.body,t.anchorNode)&&N(e.body,t.focusNode))){var n=window.getSelection(),r=e.createRange();r.setEnd(t.anchorNode,t.anchorOffset),r.collapse(!1),n.removeAllRanges(),n.addRange(r),n.extend(t.focusNode,t.focusOffset)}}(d),x(r.cursorDiv),x(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,l&&(r.lastWrapHeight=n.wrapperHeight,r.lastWrapWidth=n.wrapperWidth,ro(t,400)),r.updateLineNumbers=null,!0}function so(e,t){for(var n=t.viewport,r=!0;(r&&e.options.lineWrapping&&t.oldDisplayWidth!=xn(e)||(n&&null!=n.top&&(n={top:Math.min(e.doc.height+En(e.display)-Mn(e),n.top)}),t.visible=wr(e.display,e.doc,n),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&ao(e,t);r=!1){_r(e);var o=Fr(e);cr(e),Ir(e,o),co(e,o),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function lo(e,t){var n=new io(e,t);if(ao(e,n)){_r(e),so(e,n);var r=Fr(e);cr(e),Ir(e,r),co(e,r),n.finish()}}function uo(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function co(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Tn(e)+"px"}function po(e){var t=e.display.gutters,n=e.options.gutters;x(t);for(var r=0;r<n.length;++r){var o=n[r],i=t.appendChild(D("div",null,"CodeMirror-gutter "+o));"CodeMirror-linenumbers"==o&&(e.display.lineGutter=i,i.style.width=(e.display.lineNumWidth||1)+"px")}t.style.display=r?"":"none",uo(e)}function fo(e){var t=W(e.gutters,"CodeMirror-linenumbers");-1==t&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):t>-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}io.prototype.signal=function(e,t){st(e,t)&&this.events.push(arguments)},io.prototype.finish=function(){for(var e=0;e<this.events.length;e++)ot.apply(null,this.events[e])};var ho=0,go=null;function mo(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta),{x:t,y:n}}function vo(e){var t=mo(e);return t.x*=go,t.y*=go,t}function bo(e,t){var n=mo(t),o=n.x,i=n.y,a=e.display,s=a.scroller,l=s.scrollWidth>s.clientWidth,c=s.scrollHeight>s.clientHeight;if(o&&l||i&&c){if(i&&y&&u)e:for(var d=t.target,f=a.view;d!=s;d=d.parentNode)for(var h=0;h<f.length;h++)if(f[h].node==d){e.display.currentWheelTarget=d;break e}if(o&&!r&&!p&&null!=go)return i&&c&&Pr(e,Math.max(0,s.scrollTop+i*go)),Lr(e,Math.max(0,s.scrollLeft+o*go)),(!i||i&&c)&&ut(t),void(a.wheelStartX=null);if(i&&null!=go){var g=i*go,m=e.doc.scrollTop,v=m+a.wrapper.clientHeight;g<0?m=Math.max(0,m+g-50):v=Math.min(e.doc.height,v+g+50),lo(e,{top:m,bottom:v})}ho<20&&(null==a.wheelStartX?(a.wheelStartX=s.scrollLeft,a.wheelStartY=s.scrollTop,a.wheelDX=o,a.wheelDY=i,setTimeout(function(){if(null!=a.wheelStartX){var e=s.scrollLeft-a.wheelStartX,t=s.scrollTop-a.wheelStartY,n=t&&a.wheelDY&&t/a.wheelDY||e&&a.wheelDX&&e/a.wheelDX;a.wheelStartX=a.wheelStartY=null,n&&(go=(go*ho+n)/(ho+1),++ho)}},200)):(a.wheelDX+=o,a.wheelDY+=i))}}s?go=-.53:r?go=15:d?go=-.7:f&&(go=-1/3);var yo=function(e,t){this.ranges=e,this.primIndex=t};yo.prototype.primary=function(){return this.ranges[this.primIndex]},yo.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(!ye(n.anchor,r.anchor)||!ye(n.head,r.head))return!1}return!0},yo.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new _o(_e(this.ranges[t].anchor),_e(this.ranges[t].head));return new yo(e,this.primIndex)},yo.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},yo.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(be(t,r.from())>=0&&be(e,r.to())<=0)return n}return-1};var _o=function(e,t){this.anchor=e,this.head=t};function ko(e,t){var n=e[t];e.sort(function(e,t){return be(e.from(),t.from())}),t=W(e,n);for(var r=1;r<e.length;r++){var o=e[r],i=e[r-1];if(be(i.to(),o.from())>=0){var a=we(i.from(),o.from()),s=ke(i.to(),o.to()),l=i.empty()?o.from()==o.head:i.from()==i.head;r<=t&&--t,e.splice(--r,2,new _o(l?s:a,l?a:s))}}return new yo(e,t)}function wo(e,t){return new yo([new _o(e,t||e)],0)}function Co(e){return e.text?ve(e.from.line+e.text.length-1,Y(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function So(e,t){if(be(e,t.from)<0)return e;if(be(e,t.to)<=0)return Co(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Co(t).ch-t.to.ch),ve(n,r)}function Eo(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var o=e.sel.ranges[r];n.push(new _o(So(o.anchor,t),So(o.head,t)))}return ko(n,e.sel.primIndex)}function Oo(e,t,n){return e.line==t.line?ve(n.line,e.ch-t.ch+n.ch):ve(n.line+(e.line-t.line),e.ch)}function To(e){e.doc.mode=xt(e.options,e.doc.modeOption),xo(e)}function xo(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,ro(e,100),e.state.modeGen++,e.curOp&&Qr(e)}function Mo(e,t){return 0==t.from.ch&&0==t.to.ch&&""==Y(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Do(e,t,n,r){function o(e){return n?n[e]:null}function i(e,n,o){!function(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Le(e),Fe(e,n);var o=r?r(e):1;o!=e.height&&pe(e,o)}(e,n,o,r),un(e,"change",e,t)}function a(e,t){for(var n=[],i=e;i<t;++i)n.push(new Kt(u[i],o(i),r));return n}var s=t.from,l=t.to,u=t.text,c=ue(e,s.line),d=ue(e,l.line),p=Y(u),f=o(u.length-1),h=l.line-s.line;if(t.full)e.insert(0,a(0,u.length)),e.remove(u.length,e.size-u.length);else if(Mo(e,t)){var g=a(0,u.length-1);i(d,d.text,f),h&&e.remove(s.line,h),g.length&&e.insert(s.line,g)}else if(c==d)if(1==u.length)i(c,c.text.slice(0,s.ch)+p+c.text.slice(l.ch),f);else{var m=a(1,u.length-1);m.push(new Kt(p+c.text.slice(l.ch),f,r)),i(c,c.text.slice(0,s.ch)+u[0],o(0)),e.insert(s.line+1,m)}else if(1==u.length)i(c,c.text.slice(0,s.ch)+u[0]+d.text.slice(l.ch),o(0)),e.remove(s.line+1,h);else{i(c,c.text.slice(0,s.ch)+u[0],o(0)),i(d,p+d.text.slice(l.ch),f);var v=a(1,u.length-1);h>1&&e.remove(s.line+1,h-1),e.insert(s.line+1,v)}un(e,"change",e,t)}function Po(e,t,n){!function e(r,o,i){if(r.linked)for(var a=0;a<r.linked.length;++a){var s=r.linked[a];if(s.doc!=o){var l=i&&s.sharedHist;n&&!l||(t(s.doc,l),e(s.doc,r,l))}}}(e,null,!0)}function No(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,sr(e),To(e),Lo(e),e.options.lineWrapping||Xe(e),e.options.mode=t.modeOption,Qr(e)}function Lo(e){("rtl"==e.doc.direction?F:T)(e.display.lineDiv,"CodeMirror-rtl")}function Fo(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Ao(e,t){var n={from:_e(t.from),to:Co(t),text:ce(e,t.from,t.to)};return Ho(e,n,t.from.line,t.to.line+1),Po(e,function(e){return Ho(e,n,t.from.line,t.to.line+1)},!0),n}function jo(e){for(;e.length;){var t=Y(e);if(!t.ranges)break;e.pop()}}function Io(e,t,n,r){var o=e.history;o.undone.length=0;var i,a,s=+new Date;if((o.lastOp==r||o.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&o.lastModTime>s-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(i=function(e,t){return t?(jo(e.done),Y(e.done)):e.done.length&&!Y(e.done).ranges?Y(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),Y(e.done)):void 0}(o,o.lastOp==r)))a=Y(i.changes),0==be(t.from,t.to)&&0==be(t.from,a.to)?a.to=Co(t):i.changes.push(Ao(e,t));else{var l=Y(o.done);for(l&&l.ranges||Bo(e.sel,o.done),i={changes:[Ao(e,t)],generation:o.generation},o.done.push(i);o.done.length>o.undoDepth;)o.done.shift(),o.done[0].ranges||o.done.shift()}o.done.push(n),o.generation=++o.maxGeneration,o.lastModTime=o.lastSelTime=s,o.lastOp=o.lastSelOp=r,o.lastOrigin=o.lastSelOrigin=t.origin,a||ot(e,"historyAdded")}function Ro(e,t,n,r){var o=e.history,i=r&&r.origin;n==o.lastSelOp||i&&o.lastSelOrigin==i&&(o.lastModTime==o.lastSelTime&&o.lastOrigin==i||function(e,t,n,r){var o=t.charAt(0);return"*"==o||"+"==o&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,i,Y(o.done),t))?o.done[o.done.length-1]=t:Bo(t,o.done),o.lastSelTime=+new Date,o.lastSelOrigin=i,o.lastSelOp=n,r&&!1!==r.clearRedo&&jo(o.undone)}function Bo(e,t){var n=Y(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Ho(e,t,n,r){var o=t["spans_"+e.id],i=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(n){n.markedSpans&&((o||(o=t["spans_"+e.id]={}))[i]=n.markedSpans),++i})}function Wo(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function Vo(e,t){var n=function(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],o=0;o<t.text.length;++o)r.push(Wo(n[o]));return r}(e,t),r=Pe(e,t);if(!n)return r;if(!r)return n;for(var o=0;o<n.length;++o){var i=n[o],a=r[o];if(i&&a)e:for(var s=0;s<a.length;++s){for(var l=a[s],u=0;u<i.length;++u)if(i[u].marker==l.marker)continue e;i.push(l)}else a&&(n[o]=a)}return n}function Go(e,t,n){for(var r=[],o=0;o<e.length;++o){var i=e[o];if(i.ranges)r.push(n?yo.prototype.deepCopy.call(i):i);else{var a=i.changes,s=[];r.push({changes:s});for(var l=0;l<a.length;++l){var u=a[l],c=void 0;if(s.push({from:u.from,to:u.to,text:u.text}),t)for(var d in u)(c=d.match(/^spans_(\d+)$/))&&W(t,Number(c[1]))>-1&&(Y(s)[d]=u[d],delete u[d])}}}return r}function Uo(e,t,n,r){if(r){var o=e.anchor;if(n){var i=be(t,o)<0;i!=be(n,o)<0?(o=t,t=n):i!=be(t,n)<0&&(t=n)}return new _o(o,t)}return new _o(n||t,t)}function zo(e,t,n,r,o){null==o&&(o=e.cm&&(e.cm.display.shift||e.extend)),Yo(e,new yo([Uo(e.sel.primary(),t,n,o)],0),r)}function qo(e,t,n){for(var r=[],o=e.cm&&(e.cm.display.shift||e.extend),i=0;i<e.sel.ranges.length;i++)r[i]=Uo(e.sel.ranges[i],t[i],null,o);var a=ko(r,e.sel.primIndex);Yo(e,a,n)}function Ko(e,t,n,r){var o=e.sel.ranges.slice(0);o[t]=n,Yo(e,ko(o,e.sel.primIndex),r)}function $o(e,t,n,r){Yo(e,wo(t,n),r)}function Xo(e,t,n){var r=e.history.done,o=Y(r);o&&o.ranges?(r[r.length-1]=t,Jo(e,t,n)):Yo(e,t,n)}function Yo(e,t,n){Jo(e,t,n),Ro(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function Jo(e,t,n){(st(e,"beforeSelectionChange")||e.cm&&st(e.cm,"beforeSelectionChange"))&&(t=function(e,t,n){var r={ranges:t.ranges,update:function(t){this.ranges=[];for(var n=0;n<t.length;n++)this.ranges[n]=new _o(Se(e,t[n].anchor),Se(e,t[n].head))},origin:n&&n.origin};return ot(e,"beforeSelectionChange",e,r),e.cm&&ot(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?ko(r.ranges,r.ranges.length-1):t}(e,t,n));var r=n&&n.bias||(be(t.primary().head,e.sel.primary().head)<0?-1:1);Qo(e,ei(e,t,r,!0)),n&&!1===n.scroll||!e.cm||Tr(e.cm)}function Qo(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0,at(e.cm)),un(e,"cursorActivity",e))}function Zo(e){Qo(e,ei(e,e.sel,null,!1))}function ei(e,t,n,r){for(var o,i=0;i<t.ranges.length;i++){var a=t.ranges[i],s=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[i],l=ni(e,a.anchor,s&&s.anchor,n,r),u=ni(e,a.head,s&&s.head,n,r);(o||l!=a.anchor||u!=a.head)&&(o||(o=t.ranges.slice(0,i)),o[i]=new _o(l,u))}return o?ko(o,t.primIndex):t}function ti(e,t,n,r,o){var i=ue(e,t.line);if(i.markedSpans)for(var a=0;a<i.markedSpans.length;++a){var s=i.markedSpans[a],l=s.marker;if((null==s.from||(l.inclusiveLeft?s.from<=t.ch:s.from<t.ch))&&(null==s.to||(l.inclusiveRight?s.to>=t.ch:s.to>t.ch))){if(o&&(ot(l,"beforeCursorEnter"),l.explicitlyCleared)){if(i.markedSpans){--a;continue}break}if(!l.atomic)continue;if(n){var u=l.find(r<0?1:-1),c=void 0;if((r<0?l.inclusiveRight:l.inclusiveLeft)&&(u=ri(e,u,-r,u&&u.line==t.line?i:null)),u&&u.line==t.line&&(c=be(u,n))&&(r<0?c<0:c>0))return ti(e,u,t,r,o)}var d=l.find(r<0?-1:1);return(r<0?l.inclusiveLeft:l.inclusiveRight)&&(d=ri(e,d,r,d.line==t.line?i:null)),d?ti(e,d,t,r,o):null}}return t}function ni(e,t,n,r,o){var i=r||1,a=ti(e,t,n,i,o)||!o&&ti(e,t,n,i,!0)||ti(e,t,n,-i,o)||!o&&ti(e,t,n,-i,!0);return a||(e.cantEdit=!0,ve(e.first,0))}function ri(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?Se(e,ve(t.line-1)):null:n>0&&t.ch==(r||ue(e,t.line)).text.length?t.line<e.first+e.size-1?ve(t.line+1,0):null:new ve(t.line,t.ch+n)}function oi(e){e.setSelection(ve(e.firstLine(),0),ve(e.lastLine()),U)}function ii(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(t,n,o,i){t&&(r.from=Se(e,t)),n&&(r.to=Se(e,n)),o&&(r.text=o),void 0!==i&&(r.origin=i)}),ot(e,"beforeChange",e,r),e.cm&&ot(e.cm,"beforeChange",e.cm,r),r.canceled?null:{from:r.from,to:r.to,text:r.text,origin:r.origin}}function ai(e,t,n){if(e.cm){if(!e.cm.curOp)return Xr(e.cm,ai)(e,t,n);if(e.cm.state.suppressEdits)return}if(!(st(e,"beforeChange")||e.cm&&st(e.cm,"beforeChange"))||(t=ii(e,t,!0))){var r=Oe&&!n&&function(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;!n.readOnly||r&&-1!=W(r,n)||(r||(r=[])).push(n)}}),!r)return null;for(var o=[{from:t,to:n}],i=0;i<r.length;++i)for(var a=r[i],s=a.find(0),l=0;l<o.length;++l){var u=o[l];if(!(be(u.to,s.from)<0||be(u.from,s.to)>0)){var c=[l,1],d=be(u.from,s.from),p=be(u.to,s.to);(d<0||!a.inclusiveLeft&&!d)&&c.push({from:u.from,to:s.from}),(p>0||!a.inclusiveRight&&!p)&&c.push({from:s.to,to:u.to}),o.splice.apply(o,c),l+=c.length-3}}return o}(e,t.from,t.to);if(r)for(var o=r.length-1;o>=0;--o)si(e,{from:r[o].from,to:r[o].to,text:o?[""]:t.text,origin:t.origin});else si(e,t)}}function si(e,t){if(1!=t.text.length||""!=t.text[0]||0!=be(t.from,t.to)){var n=Eo(e,t);Io(e,t,n,e.cm?e.cm.curOp.id:NaN),ci(e,t,n,Pe(e,t));var r=[];Po(e,function(e,n){n||-1!=W(r,e.history)||(hi(e.history,t),r.push(e.history)),ci(e,t,null,Pe(e,t))})}}function li(e,t,n){if(!e.cm||!e.cm.state.suppressEdits||n){for(var r,o=e.history,i=e.sel,a="undo"==t?o.done:o.undone,s="undo"==t?o.undone:o.done,l=0;l<a.length&&(r=a[l],n?!r.ranges||r.equals(e.sel):r.ranges);l++);if(l!=a.length){for(o.lastOrigin=o.lastSelOrigin=null;(r=a.pop()).ranges;){if(Bo(r,s),n&&!r.equals(e.sel))return void Yo(e,r,{clearRedo:!1});i=r}var u=[];Bo(i,s),s.push({changes:u,generation:o.generation}),o.generation=r.generation||++o.maxGeneration;for(var c=st(e,"beforeChange")||e.cm&&st(e.cm,"beforeChange"),d=function(n){var o=r.changes[n];if(o.origin=t,c&&!ii(e,o,!1))return a.length=0,{};u.push(Ao(e,o));var i=n?Eo(e,o):Y(a);ci(e,o,i,Vo(e,o)),!n&&e.cm&&e.cm.scrollIntoView({from:o.from,to:Co(o)});var s=[];Po(e,function(e,t){t||-1!=W(s,e.history)||(hi(e.history,o),s.push(e.history)),ci(e,o,null,Vo(e,o))})},p=r.changes.length-1;p>=0;--p){var f=d(p);if(f)return f.v}}}}function ui(e,t){if(0!=t&&(e.first+=t,e.sel=new yo(J(e.sel.ranges,function(e){return new _o(ve(e.anchor.line+t,e.anchor.ch),ve(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){Qr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)Zr(e.cm,r,"gutter")}}function ci(e,t,n,r){if(e.cm&&!e.cm.curOp)return Xr(e.cm,ci)(e,t,n,r);if(t.to.line<e.first)ui(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var o=t.text.length-1-(e.first-t.from.line);ui(e,o),t={from:ve(e.first,0),to:ve(t.to.line+o,t.to.ch),text:[Y(t.text)],origin:t.origin}}var i=e.lastLine();t.to.line>i&&(t={from:t.from,to:ve(i,ue(e,i).text.length),text:[t.text[0]],origin:t.origin}),t.removed=ce(e,t.from,t.to),n||(n=Eo(e,t)),e.cm?function(e,t,n){var r=e.doc,o=e.display,i=t.from,a=t.to,s=!1,l=i.line;e.options.lineWrapping||(l=fe(Ve(ue(r,i.line))),r.iter(l,a.line+1,function(e){if(e==o.maxLine)return s=!0,!0})),r.sel.contains(t.from,t.to)>-1&&at(e),Do(r,t,n,ar(e)),e.options.lineWrapping||(r.iter(l,i.line+t.text.length,function(e){var t=$e(e);t>o.maxLineLength&&(o.maxLine=e,o.maxLineLength=t,o.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0)),function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,r=t-1;r>n;r--){var o=ue(e,r).stateAfter;if(o&&(!(o instanceof At)||r+o.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}(r,i.line),ro(e,400);var u=t.text.length-(a.line-i.line)-1;t.full?Qr(e):i.line!=a.line||1!=t.text.length||Mo(e.doc,t)?Qr(e,i.line,a.line+1,u):Zr(e,i.line,"text");var c=st(e,"changes"),d=st(e,"change");if(d||c){var p={from:i,to:a,text:t.text,removed:t.removed,origin:t.origin};d&&un(e,"change",e,p),c&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(p)}e.display.selForContextMenu=null}(e.cm,t,r):Do(e,t,r),Jo(e,n,U)}}function di(e,t,n,r,o){var i;r||(r=n),be(r,n)<0&&(n=(i=[r,n])[0],r=i[1]),"string"==typeof t&&(t=e.splitLines(t)),ai(e,{from:n,to:r,text:t,origin:o})}function pi(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function fi(e,t,n,r){for(var o=0;o<e.length;++o){var i=e[o],a=!0;if(i.ranges){i.copied||((i=e[o]=i.deepCopy()).copied=!0);for(var s=0;s<i.ranges.length;s++)pi(i.ranges[s].anchor,t,n,r),pi(i.ranges[s].head,t,n,r)}else{for(var l=0;l<i.changes.length;++l){var u=i.changes[l];if(n<u.from.line)u.from=ve(u.from.line+r,u.from.ch),u.to=ve(u.to.line+r,u.to.ch);else if(t<=u.to.line){a=!1;break}}a||(e.splice(0,o+1),o=0)}}}function hi(e,t){var n=t.from.line,r=t.to.line,o=t.text.length-(r-n)-1;fi(e.done,n,r,o),fi(e.undone,n,r,o)}function gi(e,t,n,r){var o=t,i=t;return"number"==typeof t?i=ue(e,Ce(e,t)):o=fe(t),null==o?null:(r(i,o)&&e.cm&&Zr(e.cm,o,n),i)}function mi(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}function vi(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var o=e[r];t+=o.chunkSize(),n+=o.height,o.parent=this}this.size=t,this.height=n,this.parent=null}_o.prototype.from=function(){return we(this.anchor,this.head)},_o.prototype.to=function(){return ke(this.anchor,this.head)},_o.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},mi.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var o=this.lines[n];this.height-=o.height,$t(o),un(o,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}},vi.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],o=r.chunkSize();if(e<o){var i=Math.min(t,o-e),a=r.height;if(r.removeInner(e,i),this.height-=a-r.height,o==i&&(this.children.splice(n--,1),r.parent=null),0==(t-=i))break;e=0}else e-=o}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof mi))){var s=[];this.collapse(s),this.children=[new mi(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var o=this.children[r],i=o.chunkSize();if(e<=i){if(o.insertInner(e,t,n),o.lines&&o.lines.length>50){for(var a=o.lines.length%25+25,s=a;s<o.lines.length;){var l=new mi(o.lines.slice(s,s+=25));o.height-=l.height,this.children.splice(++r,0,l),l.parent=this}o.lines=o.lines.slice(0,a),this.maybeSpill()}break}e-=i}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new vi(t);if(e.parent){e.size-=n.size,e.height-=n.height;var r=W(e.parent.children,e);e.parent.children.splice(r+1,0,n)}else{var o=new vi(e.children);o.parent=e,e.children=[o,n],e=o}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var o=this.children[r],i=o.chunkSize();if(e<i){var a=Math.min(t,i-e);if(o.iterN(e,a,n))return!0;if(0==(t-=a))break;e=0}else e-=i}}};var bi=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};function yi(e,t,n){Ke(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Or(e,n)}bi.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=fe(n);if(null!=r&&t){for(var o=0;o<t.length;++o)t[o]==this&&t.splice(o--,1);t.length||(n.widgets=null);var i=wn(this);pe(n,Math.max(0,n.height-i)),e&&($r(e,function(){yi(e,n,-i),Zr(e,r,"widget")}),un(e,"lineWidgetCleared",e,this,r))}},bi.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var o=wn(this)-t;o&&(pe(r,r.height+o),n&&$r(n,function(){n.curOp.forceUpdate=!0,yi(n,r,o),un(n,"lineWidgetChanged",n,e,fe(r))}))},lt(bi);var _i=0,ki=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++_i};function wi(e,t,n,r,o){if(r&&r.shared)return function(e,t,n,r,o){(r=R(r)).shared=!1;var i=[wi(e,t,n,r,o)],a=i[0],s=r.widgetNode;return Po(e,function(e){s&&(r.widgetNode=s.cloneNode(!0)),i.push(wi(e,Se(e,t),Se(e,n),r,o));for(var l=0;l<e.linked.length;++l)if(e.linked[l].isParent)return;a=Y(i)}),new Ci(i,a)}(e,t,n,r,o);if(e.cm&&!e.cm.curOp)return Xr(e.cm,wi)(e,t,n,r,o);var i=new ki(e,o),a=be(t,n);if(r&&R(r,i,!1),a>0||0==a&&!1!==i.clearWhenEmpty)return i;if(i.replacedWith&&(i.collapsed=!0,i.widgetNode=P("span",[i.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||i.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(i.widgetNode.insertLeft=!0)),i.collapsed){if(We(e,t.line,t,n,i)||t.line!=n.line&&We(e,n.line,t,n,i))throw new Error("Inserting collapsed marker partially overlapping an existing one");Te=!0}i.addToHistory&&Io(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var s,l=t.line,u=e.cm;if(e.iter(l,n.line+1,function(e){u&&i.collapsed&&!u.options.lineWrapping&&Ve(e)==u.display.maxLine&&(s=!0),i.collapsed&&l!=t.line&&pe(e,0),function(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}(e,new xe(i,l==t.line?t.ch:null,l==n.line?n.ch:null)),++l}),i.collapsed&&e.iter(t.line,n.line+1,function(t){ze(e,t)&&pe(t,0)}),i.clearOnEnter&&tt(i,"beforeCursorEnter",function(){return i.clear()}),i.readOnly&&(Oe=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),i.collapsed&&(i.id=++_i,i.atomic=!0),u){if(s&&(u.curOp.updateMaxLine=!0),i.collapsed)Qr(u,t.line,n.line+1);else if(i.className||i.title||i.startStyle||i.endStyle||i.css)for(var c=t.line;c<=n.line;c++)Zr(u,c,"text");i.atomic&&Zo(u.doc),un(u,"markerAdded",u,i)}return i}ki.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Vr(e),st(this,"clear")){var n=this.find();n&&un(this,"clear",n.from,n.to)}for(var r=null,o=null,i=0;i<this.lines.length;++i){var a=this.lines[i],s=Me(a.markedSpans,this);e&&!this.collapsed?Zr(e,fe(a),"text"):e&&(null!=s.to&&(o=fe(a)),null!=s.from&&(r=fe(a))),a.markedSpans=De(a.markedSpans,s),null==s.from&&this.collapsed&&!ze(this.doc,a)&&e&&pe(a,nr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var l=0;l<this.lines.length;++l){var u=Ve(this.lines[l]),c=$e(u);c>e.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&Qr(e,r,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Zo(e.doc)),e&&un(e,"markerCleared",e,this,r,o),t&&Gr(e),this.parent&&this.parent.clear()}},ki.prototype.find=function(e,t){var n,r;null==e&&"bookmark"==this.type&&(e=1);for(var o=0;o<this.lines.length;++o){var i=this.lines[o],a=Me(i.markedSpans,this);if(null!=a.from&&(n=ve(t?i:fe(i),a.from),-1==e))return n;if(null!=a.to&&(r=ve(t?i:fe(i),a.to),1==e))return r}return n&&{from:n,to:r}},ki.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;t&&r&&$r(r,function(){var o=t.line,i=fe(t.line),a=Nn(r,i);if(a&&(Bn(a),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!ze(n.doc,o)&&null!=n.height){var s=n.height;n.height=null;var l=wn(n)-s;l&&pe(o,o.height+l)}un(r,"markerChanged",r,e)})},ki.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=W(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},ki.prototype.detachLine=function(e){if(this.lines.splice(W(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},lt(ki);var Ci=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};function Si(e){return e.findMarks(ve(e.first,0),e.clipPos(ve(e.lastLine())),function(e){return e.parent})}function Ei(e){for(var t=function(t){var n=e[t],r=[n.primary.doc];Po(n.primary.doc,function(e){return r.push(e)});for(var o=0;o<n.markers.length;o++){var i=n.markers[o];-1==W(r,i.doc)&&(i.parent=null,n.markers.splice(o--,1))}},n=0;n<e.length;n++)t(n)}Ci.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();un(this,"clear")}},Ci.prototype.find=function(e,t){return this.primary.find(e,t)},lt(Ci);var Oi=0,Ti=function(e,t,n,r,o){if(!(this instanceof Ti))return new Ti(e,t,n,r,o);null==n&&(n=0),vi.call(this,[new mi([new Kt("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var i=ve(n,0);this.sel=wo(i),this.history=new Fo(null),this.id=++Oi,this.modeOption=t,this.lineSep=r,this.direction="rtl"==o?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Do(this,{from:i,to:i,text:e}),Yo(this,wo(i),U)};Ti.prototype=Z(vi.prototype,{constructor:Ti,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=de(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:Jr(function(e){var t=ve(this.first,0),n=this.first+this.size-1;ai(this,{from:t,to:ve(n,ue(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&xr(this.cm,0,0),Yo(this,wo(t),U)}),replaceRange:function(e,t,n,r){t=Se(this,t),n=n?Se(this,n):t,di(this,e,t,n,r)},getRange:function(e,t,n){var r=ce(this,Se(this,e),Se(this,t));return!1===n?r:r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(ge(this,e))return ue(this,e)},getLineNumber:function(e){return fe(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=ue(this,e)),Ve(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return Se(this,e)},getCursor:function(e){var t=this.sel.primary();return null==e||"head"==e?t.head:"anchor"==e?t.anchor:"end"==e||"to"==e||!1===e?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Jr(function(e,t,n){$o(this,Se(this,"number"==typeof e?ve(e,t||0):e),null,n)}),setSelection:Jr(function(e,t,n){$o(this,Se(this,e),Se(this,t||e),n)}),extendSelection:Jr(function(e,t,n){zo(this,Se(this,e),t&&Se(this,t),n)}),extendSelections:Jr(function(e,t){qo(this,Ee(this,e),t)}),extendSelectionsBy:Jr(function(e,t){var n=J(this.sel.ranges,e);qo(this,Ee(this,n),t)}),setSelections:Jr(function(e,t,n){if(e.length){for(var r=[],o=0;o<e.length;o++)r[o]=new _o(Se(this,e[o].anchor),Se(this,e[o].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),Yo(this,ko(r,t),n)}}),addSelection:Jr(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new _o(Se(this,e),Se(this,t||e))),Yo(this,ko(r,r.length-1),n)}),getSelection:function(e){for(var t,n=this.sel.ranges,r=0;r<n.length;r++){var o=ce(this,n[r].from(),n[r].to());t=t?t.concat(o):o}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var o=ce(this,n[r].from(),n[r].to());!1!==e&&(o=o.join(e||this.lineSeparator())),t[r]=o}return t},replaceSelection:function(e,t,n){for(var r=[],o=0;o<this.sel.ranges.length;o++)r[o]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:Jr(function(e,t,n){for(var r=[],o=this.sel,i=0;i<o.ranges.length;i++){var a=o.ranges[i];r[i]={from:a.from(),to:a.to(),text:this.splitLines(e[i]),origin:n}}for(var s=t&&"end"!=t&&function(e,t,n){for(var r=[],o=ve(e.first,0),i=o,a=0;a<t.length;a++){var s=t[a],l=Oo(s.from,o,i),u=Oo(Co(s),o,i);if(o=s.to,i=u,"around"==n){var c=e.sel.ranges[a],d=be(c.head,c.anchor)<0;r[a]=new _o(d?u:l,d?l:u)}else r[a]=new _o(l,l)}return new yo(r,e.sel.primIndex)}(this,r,t),l=r.length-1;l>=0;l--)ai(this,r[l]);s?Xo(this,s):this.cm&&Tr(this.cm)}),undo:Jr(function(){li(this,"undo")}),redo:Jr(function(){li(this,"redo")}),undoSelection:Jr(function(){li(this,"undo",!0)}),redoSelection:Jr(function(){li(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var o=0;o<e.undone.length;o++)e.undone[o].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){this.history=new Fo(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Go(this.history.done),undone:Go(this.history.undone)}},setHistory:function(e){var t=this.history=new Fo(this.history.maxGeneration);t.done=Go(e.done.slice(0),null,!0),t.undone=Go(e.undone.slice(0),null,!0)},setGutterMarker:Jr(function(e,t,n){return gi(this,e,"gutter",function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return r[t]=n,!n&&re(r)&&(e.gutterMarkers=null),!0})}),clearGutter:Jr(function(e){var t=this;this.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&gi(t,n,"gutter",function(){return n.gutterMarkers[e]=null,re(n.gutterMarkers)&&(n.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if("number"==typeof e){if(!ge(this,e))return null;if(t=e,!(e=ue(this,e)))return null}else if(null==(t=fe(e)))return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:Jr(function(e,t,n){return gi(this,e,"gutter"==t?"gutter":"class",function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[r]){if(E(n).test(e[r]))return!1;e[r]+=" "+n}else e[r]=n;return!0})}),removeLineClass:Jr(function(e,t,n){return gi(this,e,"gutter"==t?"gutter":"class",function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",o=e[r];if(!o)return!1;if(null==n)e[r]=null;else{var i=o.match(E(n));if(!i)return!1;var a=i.index+i[0].length;e[r]=o.slice(0,i.index)+(i.index&&a!=o.length?" ":"")+o.slice(a)||null}return!0})}),addLineWidget:Jr(function(e,t,n){return function(e,t,n,r){var o=new bi(e,n,r),i=e.cm;return i&&o.noHScroll&&(i.display.alignWidgets=!0),gi(e,t,"widget",function(t){var n=t.widgets||(t.widgets=[]);if(null==o.insertAt?n.push(o):n.splice(Math.min(n.length-1,Math.max(0,o.insertAt)),0,o),o.line=t,i&&!ze(e,t)){var r=Ke(t)<e.scrollTop;pe(t,t.height+wn(o)),r&&Or(i,o.height),i.curOp.forceUpdate=!0}return!0}),un(i,"lineWidgetAdded",i,o,"number"==typeof t?t:fe(t)),o}(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return wi(this,Se(this,e),Se(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return wi(this,e=Se(this,e),e,n,"bookmark")},findMarksAt:function(e){e=Se(this,e);var t=[],n=ue(this,e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var o=n[r];(null==o.from||o.from<=e.ch)&&(null==o.to||o.to>=e.ch)&&t.push(o.marker.parent||o.marker)}return t},findMarks:function(e,t,n){e=Se(this,e),t=Se(this,t);var r=[],o=e.line;return this.iter(e.line,t.line+1,function(i){var a=i.markedSpans;if(a)for(var s=0;s<a.length;s++){var l=a[s];null!=l.to&&o==e.line&&e.ch>=l.to||null==l.from&&o!=e.line||null!=l.from&&o==t.line&&l.from>=t.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.marker)}++o}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)null!=n[r].from&&e.push(n[r].marker)}),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter(function(o){var i=o.text.length+r;if(i>e)return t=e,!0;e-=i,++n}),Se(this,ve(n,t))},indexFromPos:function(e){var t=(e=Se(this,e)).ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(e){t+=e.text.length+n}),t},copy:function(e){var t=new Ti(de(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<n&&(n=e.to);var r=new Ti(de(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n],o=r.find(),i=e.clipPos(o.from),a=e.clipPos(o.to);if(be(i,a)){var s=wi(e,i,a,r.primary,r.primary.type);r.markers.push(s),s.parent=r}}}(r,Si(this)),r},unlinkDoc:function(e){if(e instanceof Sa&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var n=this.linked[t];if(n.doc==e){this.linked.splice(t,1),e.unlinkDoc(this),Ei(Si(this));break}}if(e.history==this.history){var r=[e.id];Po(e,function(e){return r.push(e.id)},!0),e.history=new Fo(null),e.history.done=Go(this.history.done,r),e.history.undone=Go(this.history.undone,r)}},iterLinkedDocs:function(e){Po(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):kt(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:Jr(function(e){var t;"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(e){return e.order=null}),this.cm&&$r(t=this.cm,function(){Lo(t),Qr(t)}))})}),Ti.prototype.eachLine=Ti.prototype.iter;var xi=0;function Mi(e){var t=this;if(Di(t),!it(t,e)&&!Cn(t.display,e)){ut(e),s&&(xi=+new Date);var n=lr(t,e,!0),r=e.dataTransfer.files;if(n&&!t.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var o=r.length,i=Array(o),a=0,l=function(e,r){if(!t.options.allowDropFileTypes||-1!=W(t.options.allowDropFileTypes,e.type)){var s=new FileReader;s.onload=Xr(t,function(){var e=s.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)&&(e=""),i[r]=e,++a==o){var l={from:n=Se(t.doc,n),to:n,text:t.doc.splitLines(i.join(t.doc.lineSeparator())),origin:"paste"};ai(t.doc,l),Xo(t.doc,wo(n,Co(l)))}}),s.readAsText(e)}},u=0;u<o;++u)l(r[u],u);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1)return t.state.draggingText(e),void setTimeout(function(){return t.display.input.focus()},20);try{var c=e.dataTransfer.getData("Text");if(c){var d;if(t.state.draggingText&&!t.state.draggingText.copy&&(d=t.listSelections()),Jo(t.doc,wo(n,n)),d)for(var p=0;p<d.length;++p)di(t.doc,"",d[p].anchor,d[p].head,"drag");t.replaceSelection(c,"around","paste"),t.display.input.focus()}}catch(e){}}}}function Di(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Pi(t){if(e.getElementsByClassName)for(var n=e.getElementsByClassName("CodeMirror"),r=0;r<n.length;r++){var o=n[r].CodeMirror;o&&t(o)}}var Ni=!1;function Li(){var e;Ni||(tt(window,"resize",function(){null==e&&(e=setTimeout(function(){e=null,Pi(Fi)},100))}),tt(window,"blur",function(){return Pi(yr)}),Ni=!0)}function Fi(e){var t=e.display;t.lastWrapHeight==t.wrapper.clientHeight&&t.lastWrapWidth==t.wrapper.clientWidth||(t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize())}for(var Ai={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",127:"Delete",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},ji=0;ji<10;ji++)Ai[ji+48]=Ai[ji+96]=String(ji);for(var Ii=65;Ii<=90;Ii++)Ai[Ii]=String.fromCharCode(Ii);for(var Ri=1;Ri<=12;Ri++)Ai[Ri+111]=Ai[Ri+63235]="F"+Ri;var Bi={};function Hi(e){var t,n,r,o,i=e.split(/-(?!$)/);e=i[i.length-1];for(var a=0;a<i.length-1;a++){var s=i[a];if(/^(cmd|meta|m)$/i.test(s))o=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else{if(!/^s(hift)?$/i.test(s))throw new Error("Unrecognized modifier name: "+s);r=!0}}return t&&(e="Alt-"+e),n&&(e="Ctrl-"+e),o&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function Wi(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==r){delete e[n];continue}for(var o=J(n.split(" "),Hi),i=0;i<o.length;i++){var a=void 0,s=void 0;i==o.length-1?(s=o.join(" "),a=r):(s=o.slice(0,i+1).join(" "),a="...");var l=t[s];if(l){if(l!=a)throw new Error("Inconsistent bindings for "+s)}else t[s]=a}delete e[n]}for(var u in t)e[u]=t[u];return e}function Vi(e,t,n,r){var o=(t=qi(t)).call?t.call(e,r):t[e];if(!1===o)return"nothing";if("..."===o)return"multi";if(null!=o&&n(o))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return Vi(e,t.fallthrough,n,r);for(var i=0;i<t.fallthrough.length;i++){var a=Vi(e,t.fallthrough[i],n,r);if(a)return a}}}function Gi(e){var t="string"==typeof e?e:Ai[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function Ui(e,t,n){var r=e;return t.altKey&&"Alt"!=r&&(e="Alt-"+e),(C?t.metaKey:t.ctrlKey)&&"Ctrl"!=r&&(e="Ctrl-"+e),(C?t.ctrlKey:t.metaKey)&&"Cmd"!=r&&(e="Cmd-"+e),!n&&t.shiftKey&&"Shift"!=r&&(e="Shift-"+e),e}function zi(e,t){if(p&&34==e.keyCode&&e.char)return!1;var n=Ai[e.keyCode];return null!=n&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(n=e.code),Ui(n,e,t))}function qi(e){return"string"==typeof e?Bi[e]:e}function Ki(e,t){for(var n=e.doc.sel.ranges,r=[],o=0;o<n.length;o++){for(var i=t(n[o]);r.length&&be(i.from,Y(r).to)<=0;){var a=r.pop();if(be(a.from,i.from)<0){i.from=a.from;break}}r.push(i)}$r(e,function(){for(var t=r.length-1;t>=0;t--)di(e.doc,"",r[t].from,r[t].to,"+delete");Tr(e)})}function $i(e,t,n){var r=ae(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Xi(e,t,n){var r=$i(e,t.ch,n);return null==r?null:new ve(t.line,r,n<0?"after":"before")}function Yi(e,t,n,r,o){if(e){var i=Ze(n,t.doc.direction);if(i){var a,s=o<0?Y(i):i[0],l=o<0==(1==s.level),u=l?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var c=Ln(t,n);a=o<0?n.text.length-1:0;var d=Fn(t,c,a).top;a=se(function(e){return Fn(t,c,e).top==d},o<0==(1==s.level)?s.from:s.to-1,a),"before"==u&&(a=$i(n,a,1))}else a=o<0?s.to:s.from;return new ve(r,a,u)}}return new ve(r,o<0?n.text.length:0,o<0?"before":"after")}Bi.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Bi.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Bi.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Bi.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Bi.default=y?Bi.macDefault:Bi.pcDefault;var Ji={selectAll:oi,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),U)},killLine:function(e){return Ki(e,function(t){if(t.empty()){var n=ue(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:ve(t.head.line+1,0)}:{from:t.head,to:ve(t.head.line,n)}}return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Ki(e,function(t){return{from:ve(t.from().line,0),to:Se(e.doc,ve(t.to().line+1,0))}})},delLineLeft:function(e){return Ki(e,function(e){return{from:ve(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(e){return Ki(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){return Ki(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(ve(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(ve(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Qi(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Zi(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return function(e,t){var n=ue(e.doc,t),r=function(e){for(var t;t=He(e);)e=t.find(1,!0).line;return e}(n);return r!=n&&(t=fe(r)),Yi(!0,e,n,t,-1)}(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")},q)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")},q)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?Zi(e,t.head):r},q)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"char")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,o=0;o<n.length;o++){var i=n[o].from(),a=B(e.getLine(i.line),i.ch,r);t.push(X(r-a%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return $r(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(t[r].empty()){var o=t[r].head,i=ue(e.doc,o.line).text;if(i)if(o.ch==i.length&&(o=new ve(o.line,o.ch-1)),o.ch>0)o=new ve(o.line,o.ch+1),e.replaceRange(i.charAt(o.ch-1)+i.charAt(o.ch-2),ve(o.line,o.ch-2),o,"+transpose");else if(o.line>e.doc.first){var a=ue(e.doc,o.line-1).text;a&&(o=new ve(o.line,1),e.replaceRange(i.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),ve(o.line-1,a.length-1),o,"+transpose"))}n.push(new _o(o,o))}e.setSelections(n)})},newlineAndIndent:function(e){return $r(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);Tr(e)})},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Qi(e,t){var n=ue(e.doc,t),r=Ve(n);return r!=n&&(t=fe(r)),Yi(!0,e,r,t,1)}function Zi(e,t){var n=Qi(e,t.line),r=ue(e.doc,n.line),o=Ze(r,e.doc.direction);if(!o||0==o[0].level){var i=Math.max(0,r.text.search(/\S/)),a=t.line==n.line&&t.ch<=i&&t.ch;return ve(n.line,a?0:i,n.sticky)}return n}function ea(e,t,n){if("string"==typeof t&&!(t=Ji[t]))return!1;e.display.input.ensurePolled();var r=e.display.shift,o=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),o=t(e)!=G}finally{e.display.shift=r,e.state.suppressEdits=!1}return o}var ta=new H;function na(e,t,n,r){var o=e.state.keySeq;if(o){if(Gi(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:ta.set(50,function(){e.state.keySeq==o&&(e.state.keySeq=null,e.display.input.reset())}),ra(e,o+" "+t,n,r))return!0}return ra(e,t,n,r)}function ra(e,t,n,r){var o=function(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var o=Vi(t,e.state.keyMaps[r],n,e);if(o)return o}return e.options.extraKeys&&Vi(t,e.options.extraKeys,n,e)||Vi(t,e.options.keyMap,n,e)}(e,t,r);return"multi"==o&&(e.state.keySeq=t),"handled"==o&&un(e,"keyHandled",e,t,n),"handled"!=o&&"multi"!=o||(ut(n),gr(e)),!!o}function oa(e,t){var n=zi(t,!0);return!!n&&(t.shiftKey&&!e.state.keySeq?na(e,"Shift-"+n,t,function(t){return ea(e,t,!0)})||na(e,n,t,function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return ea(e,t)}):na(e,n,t,function(t){return ea(e,t)}))}var ia=null;function aa(t){var n=this;if(n.curOp.focus=L(),!it(n,t)){s&&l<11&&27==t.keyCode&&(t.returnValue=!1);var r=t.keyCode;n.display.shift=16==r||t.shiftKey;var o=oa(n,t);p&&(ia=o?r:null,!o&&88==r&&!Ct&&(y?t.metaKey:t.ctrlKey)&&n.replaceSelection("",null,"cut")),18!=r||/\bCodeMirror-crosshair\b/.test(n.display.lineDiv.className)||function(t){var n=t.display.lineDiv;function r(t){18!=t.keyCode&&t.altKey||(T(n,"CodeMirror-crosshair"),rt(e,"keyup",r),rt(e,"mouseover",r))}F(n,"CodeMirror-crosshair"),tt(e,"keyup",r),tt(e,"mouseover",r)}(n)}}function sa(e){16==e.keyCode&&(this.doc.sel.shift=!1),it(this,e)}function la(e){var t=this;if(!(Cn(t.display,e)||it(t,e)||e.ctrlKey&&!e.altKey||y&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(p&&n==ia)return ia=null,void ut(e);if(!p||e.which&&!(e.which<10)||!oa(t,e)){var o=String.fromCharCode(null==r?n:r);"\b"!=o&&(function(e,t,n){return na(e,"'"+n+"'",t,function(t){return ea(e,t,!0)})}(t,e,o)||t.display.input.onKeyPress(e))}}}var ua,ca,da=function(e,t,n){this.time=e,this.pos=t,this.button=n};function pa(t){var n=this,r=n.display;if(!(it(n,t)||r.activeTouch&&r.input.supportsTouch()))if(r.input.ensurePolled(),r.shift=t.shiftKey,Cn(r,t))u||(r.scroller.draggable=!1,setTimeout(function(){return r.scroller.draggable=!0},100));else if(!ga(n,t)){var o=lr(n,t),i=ht(t),a=o?function(e,t){var n=+new Date;return ca&&ca.compare(n,e,t)?(ua=ca=null,"triple"):ua&&ua.compare(n,e,t)?(ca=new da(n,e,t),ua=null,"double"):(ua=new da(n,e,t),ca=null,"single")}(o,i):"single";window.focus(),1==i&&n.state.selectingText&&n.state.selectingText(t),o&&function(e,t,n,r,o){var i="Click";return"double"==r?i="Double"+i:"triple"==r&&(i="Triple"+i),na(e,Ui(i=(1==t?"Left":2==t?"Middle":"Right")+i,o),o,function(t){if("string"==typeof t&&(t=Ji[t]),!t)return!1;var r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r=t(e,n)!=G}finally{e.state.suppressEdits=!1}return r})}(n,i,o,a,t)||(1==i?o?function(t,n,r,o){s?setTimeout(I(mr,t),0):t.curOp.focus=L();var i,a=function(e,t,n){var r=e.getOption("configureMouse"),o=r?r(e,t,n):{};if(null==o.unit){var i=_?n.shiftKey&&n.metaKey:n.altKey;o.unit=i?"rectangle":"single"==t?"char":"double"==t?"word":"line"}return(null==o.extend||e.doc.extend)&&(o.extend=e.doc.extend||n.shiftKey),null==o.addNew&&(o.addNew=y?n.metaKey:n.ctrlKey),null==o.moveOnDrag&&(o.moveOnDrag=!(y?n.altKey:n.ctrlKey)),o}(t,r,o),c=t.doc.sel;t.options.dragDrop&&vt&&!t.isReadOnly()&&"single"==r&&(i=c.contains(n))>-1&&(be((i=c.ranges[i]).from(),n)<0||n.xRel>0)&&(be(i.to(),n)>0||n.xRel<0)?function(t,n,r,o){var i=t.display,a=!1,c=Xr(t,function(n){u&&(i.scroller.draggable=!1),t.state.draggingText=!1,rt(e,"mouseup",c),rt(e,"mousemove",d),rt(i.scroller,"dragstart",p),rt(i.scroller,"drop",c),a||(ut(n),o.addNew||zo(t.doc,r,null,null,o.extend),u||s&&9==l?setTimeout(function(){e.body.focus(),i.input.focus()},20):i.input.focus())}),d=function(e){a=a||Math.abs(n.clientX-e.clientX)+Math.abs(n.clientY-e.clientY)>=10},p=function(){return a=!0};u&&(i.scroller.draggable=!0),t.state.draggingText=c,c.copy=!o.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),tt(e,"mouseup",c),tt(e,"mousemove",d),tt(i.scroller,"dragstart",p),tt(i.scroller,"drop",c),vr(t),setTimeout(function(){return i.input.focus()},20)}(t,o,n,a):function(t,n,r,o){var i=t.display,a=t.doc;ut(n);var s,l,u=a.sel,c=u.ranges;if(o.addNew&&!o.extend?(l=a.sel.contains(r),s=l>-1?c[l]:new _o(r,r)):(s=a.sel.primary(),l=a.sel.primIndex),"rectangle"==o.unit)o.addNew||(s=new _o(r,r)),r=lr(t,n,!0,!0),l=-1;else{var d=fa(t,r,o.unit);s=o.extend?Uo(s,d.anchor,d.head,o.extend):d}o.addNew?-1==l?(l=c.length,Yo(a,ko(c.concat([s]),l),{scroll:!1,origin:"*mouse"})):c.length>1&&c[l].empty()&&"char"==o.unit&&!o.extend?(Yo(a,ko(c.slice(0,l).concat(c.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),u=a.sel):Ko(a,l,s,z):(l=0,Yo(a,new yo([s],0),z),u=a.sel);var p=r;function f(e){if(0!=be(p,e))if(p=e,"rectangle"==o.unit){for(var n=[],i=t.options.tabSize,c=B(ue(a,r.line).text,r.ch,i),d=B(ue(a,e.line).text,e.ch,i),f=Math.min(c,d),h=Math.max(c,d),g=Math.min(r.line,e.line),m=Math.min(t.lastLine(),Math.max(r.line,e.line));g<=m;g++){var v=ue(a,g).text,b=K(v,f,i);f==h?n.push(new _o(ve(g,b),ve(g,b))):v.length>b&&n.push(new _o(ve(g,b),ve(g,K(v,h,i))))}n.length||n.push(new _o(r,r)),Yo(a,ko(u.ranges.slice(0,l).concat(n),l),{origin:"*mouse",scroll:!1}),t.scrollIntoView(e)}else{var y,_=s,k=fa(t,e,o.unit),w=_.anchor;be(k.anchor,w)>0?(y=k.head,w=we(_.from(),k.anchor)):(y=k.anchor,w=ke(_.to(),k.head));var C=u.ranges.slice(0);C[l]=function(e,t){var n=t.anchor,r=t.head,o=ue(e.doc,n.line);if(0==be(n,r)&&n.sticky==r.sticky)return t;var i=Ze(o);if(!i)return t;var a=Je(i,n.ch,n.sticky),s=i[a];if(s.from!=n.ch&&s.to!=n.ch)return t;var l,u=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==u||u==i.length)return t;if(r.line!=n.line)l=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var c=Je(i,r.ch,r.sticky),d=c-a||(r.ch-n.ch)*(1==s.level?-1:1);l=c==u-1||c==u?d<0:d>0}var p=i[u+(l?-1:0)],f=l==(1==p.level),h=f?p.from:p.to,g=f?"after":"before";return n.ch==h&&n.sticky==g?t:new _o(new ve(n.line,h,g),r)}(t,new _o(Se(a,w),y)),Yo(a,ko(C,l),z)}}var h=i.wrapper.getBoundingClientRect(),g=0;function m(n){t.state.selectingText=!1,g=1/0,ut(n),i.input.focus(),rt(e,"mousemove",v),rt(e,"mouseup",b),a.history.lastSelOrigin=null}var v=Xr(t,function(e){ht(e)?function e(n){var r=++g,s=lr(t,n,!0,"rectangle"==o.unit);if(s)if(0!=be(s,p)){t.curOp.focus=L(),f(s);var l=wr(i,a);(s.line>=l.to||s.line<l.from)&&setTimeout(Xr(t,function(){g==r&&e(n)}),150)}else{var u=n.clientY<h.top?-20:n.clientY>h.bottom?20:0;u&&setTimeout(Xr(t,function(){g==r&&(i.scroller.scrollTop+=u,e(n))}),50)}}(e):m(e)}),b=Xr(t,m);t.state.selectingText=b,tt(e,"mousemove",v),tt(e,"mouseup",b)}(t,o,n,a)}(n,o,a,t):ft(t)==r.scroller&&ut(t):2==i?(o&&zo(n.doc,o),setTimeout(function(){return r.input.focus()},20)):3==i&&(S?ma(n,t):vr(n)))}}function fa(e,t,n){if("char"==n)return new _o(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new _o(ve(t.line,0),Se(e.doc,ve(t.line+1,0)));var r=n(e,t);return new _o(r.from,r.to)}function ha(e,t,n,r){var o,i;if(t.touches)o=t.touches[0].clientX,i=t.touches[0].clientY;else try{o=t.clientX,i=t.clientY}catch(t){return!1}if(o>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&ut(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(i>s.bottom||!st(e,n))return dt(t);i-=s.top-a.viewOffset;for(var l=0;l<e.options.gutters.length;++l){var u=a.gutters.childNodes[l];if(u&&u.getBoundingClientRect().right>=o){var c=he(e.doc,i),d=e.options.gutters[l];return ot(e,n,e,c,d,t),dt(t)}}}function ga(e,t){return ha(e,t,"gutterClick",!0)}function ma(e,t){Cn(e.display,t)||function(e,t){return!!st(e,"gutterContextMenu")&&ha(e,t,"gutterContextMenu",!1)}(e,t)||it(e,t,"contextmenu")||e.display.input.onContextMenu(t)}function va(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Wn(e)}da.prototype.compare=function(e,t,n){return this.time+400>e&&0==be(t,this.pos)&&n==this.button};var ba={toString:function(){return"CodeMirror.Init"}},ya={},_a={};function ka(e){po(e),Qr(e),Cr(e)}function wa(e,t,n){var r=n&&n!=ba;if(!t!=!r){var o=e.display.dragFunctions,i=t?tt:rt;i(e.display.scroller,"dragstart",o.start),i(e.display.scroller,"dragenter",o.enter),i(e.display.scroller,"dragover",o.over),i(e.display.scroller,"dragleave",o.leave),i(e.display.scroller,"drop",o.drop)}}function Ca(e){e.options.lineWrapping?(F(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(T(e.display.wrapper,"CodeMirror-wrap"),Xe(e)),sr(e),Qr(e),Wn(e),setTimeout(function(){return Ir(e)},100)}function Sa(t,n){var r=this;if(!(this instanceof Sa))return new Sa(t,n);this.options=n=n?R(n):{},R(ya,n,!1),fo(n);var o=n.value;"string"==typeof o&&(o=new Ti(o,n.mode,null,n.lineSeparator,n.direction)),this.doc=o;var i=new Sa.inputStyles[n.inputStyle](this),a=this.display=new le(t,o,i);for(var c in a.wrapper.CodeMirror=this,po(this),va(this),n.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Hr(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new H,keySeq:null,specialChars:null},n.autofocus&&!b&&a.input.focus(),s&&l<11&&setTimeout(function(){return r.display.input.reset(!0)},20),function(t){var n=t.display;tt(n.scroller,"mousedown",Xr(t,pa)),tt(n.scroller,"dblclick",s&&l<11?Xr(t,function(e){if(!it(t,e)){var n=lr(t,e);if(n&&!ga(t,e)&&!Cn(t.display,e)){ut(e);var r=t.findWordAt(n);zo(t.doc,r.anchor,r.head)}}}):function(e){return it(t,e)||ut(e)}),S||tt(n.scroller,"contextmenu",function(e){return ma(t,e)});var r,o={end:0};function i(){n.activeTouch&&(r=setTimeout(function(){return n.activeTouch=null},1e3),(o=n.activeTouch).end=+new Date)}function a(e,t){if(null==t.left)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}tt(n.scroller,"touchstart",function(e){if(!it(t,e)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(e)&&!ga(t,e)){n.input.ensurePolled(),clearTimeout(r);var i=+new Date;n.activeTouch={start:i,moved:!1,prev:i-o.end<=300?o:null},1==e.touches.length&&(n.activeTouch.left=e.touches[0].pageX,n.activeTouch.top=e.touches[0].pageY)}}),tt(n.scroller,"touchmove",function(){n.activeTouch&&(n.activeTouch.moved=!0)}),tt(n.scroller,"touchend",function(e){var r=n.activeTouch;if(r&&!Cn(n,e)&&null!=r.left&&!r.moved&&new Date-r.start<300){var o,s=t.coordsChar(n.activeTouch,"page");o=!r.prev||a(r,r.prev)?new _o(s,s):!r.prev.prev||a(r,r.prev.prev)?t.findWordAt(s):new _o(ve(s.line,0),Se(t.doc,ve(s.line+1,0))),t.setSelection(o.anchor,o.head),t.focus(),ut(e)}i()}),tt(n.scroller,"touchcancel",i),tt(n.scroller,"scroll",function(){n.scroller.clientHeight&&(Pr(t,n.scroller.scrollTop),Lr(t,n.scroller.scrollLeft,!0),ot(t,"scroll",t))}),tt(n.scroller,"mousewheel",function(e){return bo(t,e)}),tt(n.scroller,"DOMMouseScroll",function(e){return bo(t,e)}),tt(n.wrapper,"scroll",function(){return n.wrapper.scrollTop=n.wrapper.scrollLeft=0}),n.dragFunctions={enter:function(e){it(t,e)||pt(e)},over:function(n){it(t,n)||(function(t,n){var r=lr(t,n);if(r){var o=e.createDocumentFragment();pr(t,r,o),t.display.dragCursor||(t.display.dragCursor=D("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),t.display.lineSpace.insertBefore(t.display.dragCursor,t.display.cursorDiv)),M(t.display.dragCursor,o)}}(t,n),pt(n))},start:function(e){return function(e,t){if(s&&(!e.state.draggingText||+new Date-xi<100))pt(t);else if(!it(e,t)&&!Cn(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!f)){var n=D("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",p&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),p&&n.parentNode.removeChild(n)}}(t,e)},drop:Xr(t,Mi),leave:function(e){it(t,e)||Di(t)}};var u=n.input.getField();tt(u,"keyup",function(e){return sa.call(t,e)}),tt(u,"keydown",Xr(t,aa)),tt(u,"keypress",Xr(t,la)),tt(u,"focus",function(e){return br(t,e)}),tt(u,"blur",function(e){return yr(t,e)})}(this),Li(),Vr(this),this.curOp.forceUpdate=!0,No(this,o),n.autofocus&&!b||this.hasFocus()?setTimeout(I(br,this),20):yr(this),_a)_a.hasOwnProperty(c)&&_a[c](r,n[c],ba);Sr(this),n.finishInit&&n.finishInit(this);for(var d=0;d<Ea.length;++d)Ea[d](r);Gr(this),u&&n.lineWrapping&&"optimizelegibility"==getComputedStyle(a.lineDiv).textRendering&&(a.lineDiv.style.textRendering="auto")}Sa.defaults=ya,Sa.optionHandlers=_a;var Ea=[];function Oa(e,t,n,r){var o,i=e.doc;null==n&&(n="add"),"smart"==n&&(i.mode.indent?o=Bt(e,t).state:n="prev");var a=e.options.tabSize,s=ue(i,t),l=B(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var u,c=s.text.match(/^\s*/)[0];if(r||/\S/.test(s.text)){if("smart"==n&&((u=i.mode.indent(o,s.text.slice(c.length),s.text))==G||u>150)){if(!r)return;n="prev"}}else u=0,n="not";"prev"==n?u=t>i.first?B(ue(i,t-1).text,null,a):0:"add"==n?u=l+e.options.indentUnit:"subtract"==n?u=l-e.options.indentUnit:"number"==typeof n&&(u=l+n),u=Math.max(0,u);var d="",p=0;if(e.options.indentWithTabs)for(var f=Math.floor(u/a);f;--f)p+=a,d+="\t";if(p<u&&(d+=X(u-p)),d!=c)return di(i,d,ve(t,0),ve(t,c.length),"+input"),s.stateAfter=null,!0;for(var h=0;h<i.sel.ranges.length;h++){var g=i.sel.ranges[h];if(g.head.line==t&&g.head.ch<c.length){var m=ve(t,c.length);Ko(i,h,new _o(m,m));break}}}Sa.defineInitHook=function(e){return Ea.push(e)};var Ta=null;function xa(e){Ta=e}function Ma(e,t,n,r,o){var i=e.doc;e.display.shift=!1,r||(r=i.sel);var a,s=e.state.pasteIncoming||"paste"==o,l=kt(t),u=null;if(s&&r.ranges.length>1)if(Ta&&Ta.text.join("\n")==t){if(r.ranges.length%Ta.text.length==0){u=[];for(var c=0;c<Ta.text.length;c++)u.push(i.splitLines(Ta.text[c]))}}else l.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(u=J(l,function(e){return[e]}));for(var d=r.ranges.length-1;d>=0;d--){var p=r.ranges[d],f=p.from(),h=p.to();p.empty()&&(n&&n>0?f=ve(f.line,f.ch-n):e.state.overwrite&&!s?h=ve(h.line,Math.min(ue(i,h.line).text.length,h.ch+Y(l).length)):Ta&&Ta.lineWise&&Ta.text.join("\n")==t&&(f=h=ve(f.line,0))),a=e.curOp.updateInput;var g={from:f,to:h,text:u?u[d%u.length]:l,origin:o||(s?"paste":e.state.cutIncoming?"cut":"+input")};ai(e.doc,g),un(e,"inputRead",e,g)}t&&!s&&Pa(e,t),Tr(e),e.curOp.updateInput=a,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function Da(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||$r(t,function(){return Ma(t,n,0,null,"paste")}),!0}function Pa(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var o=n.ranges[r];if(!(o.head.ch>100||r&&n.ranges[r-1].head.line==o.head.line)){var i=e.getModeAt(o.head),a=!1;if(i.electricChars){for(var s=0;s<i.electricChars.length;s++)if(t.indexOf(i.electricChars.charAt(s))>-1){a=Oa(e,o.head.line,"smart");break}}else i.electricInput&&i.electricInput.test(ue(e.doc,o.head.line).text.slice(0,o.head.ch))&&(a=Oa(e,o.head.line,"smart"));a&&un(e,"electricInput",e,o.head.line)}}}function Na(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var o=e.doc.sel.ranges[r].head.line,i={anchor:ve(o,0),head:ve(o+1,0)};n.push(i),t.push(e.getRange(i.anchor,i.head))}return{text:t,ranges:n}}function La(e,t){e.setAttribute("autocorrect","off"),e.setAttribute("autocapitalize","off"),e.setAttribute("spellcheck",!!t)}function Fa(){var e=D("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=D("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return u?e.style.width="1000px":e.setAttribute("wrap","off"),m&&(e.style.border="1px solid black"),La(e),t}function Aa(e,t,n,r,o){var i=t,a=n,s=ue(e,t.line);function l(r){var i,a;if(null==(i=o?function(e,t,n,r){var o=Ze(t,e.doc.direction);if(!o)return Xi(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var i=Je(o,n.ch,n.sticky),a=o[i];if("ltr"==e.doc.direction&&a.level%2==0&&(r>0?a.to>n.ch:a.from<n.ch))return Xi(t,n,r);var s,l=function(e,n){return $i(t,e instanceof ve?e.ch:e,n)},u=function(n){return e.options.lineWrapping?(s=s||Ln(e,t),Zn(e,t,s,n)):{begin:0,end:t.text.length}},c=u("before"==n.sticky?l(n,-1):n.ch);if("rtl"==e.doc.direction||1==a.level){var d=1==a.level==r<0,p=l(n,d?1:-1);if(null!=p&&(d?p<=a.to&&p<=c.end:p>=a.from&&p>=c.begin)){var f=d?"before":"after";return new ve(n.line,p,f)}}var h=function(e,t,r){for(var i=function(e,t){return t?new ve(n.line,l(e,1),"before"):new ve(n.line,e,"after")};e>=0&&e<o.length;e+=t){var a=o[e],s=t>0==(1!=a.level),u=s?r.begin:l(r.end,-1);if(a.from<=u&&u<a.to)return i(u,s);if(u=s?a.from:l(a.to,-1),r.begin<=u&&u<r.end)return i(u,s)}},g=h(i+r,r,c);if(g)return g;var m=r>0?c.end:l(c.begin,-1);return null==m||r>0&&m==t.text.length||!(g=h(r>0?0:o.length-1,r,u(m)))?null:g}(e.cm,s,t,n):Xi(s,t,n))){if(r||((a=t.line+n)<e.first||a>=e.first+e.size||(t=new ve(a,t.ch,t.sticky),!(s=ue(e,a)))))return!1;t=Yi(o,e.cm,s,t.line,n)}else t=i;return!0}if("char"==r)l();else if("column"==r)l(!0);else if("word"==r||"group"==r)for(var u=null,c="group"==r,d=e.cm&&e.cm.getHelper(t,"wordChars"),p=!0;!(n<0)||l(!p);p=!1){var f=s.text.charAt(t.ch)||"\n",h=ne(f,d)?"w":c&&"\n"==f?"n":!c||/\s/.test(f)?null:"p";if(!c||p||h||(h="s"),u&&u!=h){n<0&&(n=1,l(),t.sticky="after");break}if(h&&(u=h),n>0&&!l(!p))break}var g=ni(e,t,i,a,!0);return ye(i,g)&&(g.hitSide=!0),g}function ja(t,n,r,o){var i,a,s=t.doc,l=n.left;if("page"==o){var u=Math.min(t.display.wrapper.clientHeight,window.innerHeight||e.documentElement.clientHeight),c=Math.max(u-.5*nr(t.display),3);i=(r>0?n.bottom:n.top)+r*c}else"line"==o&&(i=r>0?n.bottom+3:n.top-3);for(;(a=Jn(t,l,i)).outside;){if(r<0?i<=0:i>=s.height){a.hitSide=!0;break}i+=5*r}return a}var Ia=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new H,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Ra(e,t){var n=Nn(e,t.line);if(!n||n.hidden)return null;var r=ue(e.doc,t.line),o=Dn(n,r,t.line),i=Ze(r,e.doc.direction),a="left";if(i){var s=Je(i,t.ch);a=s%2?"right":"left"}var l=In(o.map,t.ch,a);return l.offset="right"==l.collapse?l.end:l.start,l}function Ba(e,t){return t&&(e.bad=!0),e}function Ha(e,t,n){var r;if(t==e.display.lineDiv){if(!(r=e.display.lineDiv.childNodes[n]))return Ba(e.clipPos(ve(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var o=0;o<e.display.view.length;o++){var i=e.display.view[o];if(i.node==r)return Wa(i,t,n)}}function Wa(e,t,n){var r=e.text.firstChild,o=!1;if(!t||!N(r,t))return Ba(ve(fe(e.line),0),!0);if(t==r&&(o=!0,t=r.childNodes[n],n=0,!t)){var i=e.rest?Y(e.rest):e.line;return Ba(ve(fe(i),i.text.length),o)}var a=3==t.nodeType?t:null,s=t;for(a||1!=t.childNodes.length||3!=t.firstChild.nodeType||(a=t.firstChild,n&&(n=a.nodeValue.length));s.parentNode!=r;)s=s.parentNode;var l=e.measure,u=l.maps;function c(t,n,r){for(var o=-1;o<(u?u.length:0);o++)for(var i=o<0?l.map:u[o],a=0;a<i.length;a+=3){var s=i[a+2];if(s==t||s==n){var c=fe(o<0?e.line:e.rest[o]),d=i[a]+r;return(r<0||s!=t)&&(d=i[a+(r?1:0)]),ve(c,d)}}}var d=c(a,s,n);if(d)return Ba(d,o);for(var p=s.nextSibling,f=a?a.nodeValue.length-n:0;p;p=p.nextSibling){if(d=c(p,p.firstChild,0))return Ba(ve(d.line,d.ch-f),o);f+=p.textContent.length}for(var h=s.previousSibling,g=n;h;h=h.previousSibling){if(d=c(h,h.firstChild,-1))return Ba(ve(d.line,d.ch+g),o);g+=h.textContent.length}}Ia.prototype.init=function(t){var n=this,r=this,o=r.cm,i=r.div=t.lineDiv;function a(t){if(!it(o,t)){if(o.somethingSelected())xa({lineWise:!1,text:o.getSelections()}),"cut"==t.type&&o.replaceSelection("",null,"cut");else{if(!o.options.lineWiseCopyCut)return;var n=Na(o);xa({lineWise:!0,text:n.text}),"cut"==t.type&&o.operation(function(){o.setSelections(n.ranges,0,U),o.replaceSelection("",null,"cut")})}if(t.clipboardData){t.clipboardData.clearData();var a=Ta.text.join("\n");if(t.clipboardData.setData("Text",a),t.clipboardData.getData("Text")==a)return void t.preventDefault()}var s=Fa(),l=s.firstChild;o.display.lineSpace.insertBefore(s,o.display.lineSpace.firstChild),l.value=Ta.text.join("\n");var u=e.activeElement;j(l),setTimeout(function(){o.display.lineSpace.removeChild(s),u.focus(),u==i&&r.showPrimarySelection()},50)}}La(i,o.options.spellcheck),tt(i,"paste",function(e){it(o,e)||Da(e,o)||l<=11&&setTimeout(Xr(o,function(){return n.updateFromDOM()}),20)}),tt(i,"compositionstart",function(e){n.composing={data:e.data,done:!1}}),tt(i,"compositionupdate",function(e){n.composing||(n.composing={data:e.data,done:!1})}),tt(i,"compositionend",function(e){n.composing&&(e.data!=n.composing.data&&n.readFromDOMSoon(),n.composing.done=!0)}),tt(i,"touchstart",function(){return r.forceCompositionEnd()}),tt(i,"input",function(){n.composing||n.readFromDOMSoon()}),tt(i,"copy",a),tt(i,"cut",a)},Ia.prototype.prepareSelection=function(){var e=dr(this.cm,!1);return e.focus=this.cm.state.focused,e},Ia.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Ia.prototype.showPrimarySelection=function(){var e=window.getSelection(),t=this.cm,n=t.doc.sel.primary(),o=n.from(),i=n.to();if(t.display.viewTo==t.display.viewFrom||o.line>=t.display.viewTo||i.line<t.display.viewFrom)e.removeAllRanges();else{var a=Ha(t,e.anchorNode,e.anchorOffset),s=Ha(t,e.focusNode,e.focusOffset);if(!a||a.bad||!s||s.bad||0!=be(we(a,s),o)||0!=be(ke(a,s),i)){var l=t.display.view,u=o.line>=t.display.viewFrom&&Ra(t,o)||{node:l[0].measure.map[2],offset:0},c=i.line<t.display.viewTo&&Ra(t,i);if(!c){var d=l[l.length-1].measure,p=d.maps?d.maps[d.maps.length-1]:d.map;c={node:p[p.length-1],offset:p[p.length-2]-p[p.length-3]}}if(u&&c){var f,h=e.rangeCount&&e.getRangeAt(0);try{f=O(u.node,u.offset,c.offset,c.node)}catch(e){}f&&(!r&&t.state.focused?(e.collapse(u.node,u.offset),f.collapsed||(e.removeAllRanges(),e.addRange(f))):(e.removeAllRanges(),e.addRange(f)),h&&null==e.anchorNode?e.addRange(h):r&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},Ia.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},Ia.prototype.showMultipleSelections=function(e){M(this.cm.display.cursorDiv,e.cursors),M(this.cm.display.selectionDiv,e.selection)},Ia.prototype.rememberSelection=function(){var e=window.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Ia.prototype.selectionInEditor=function(){var e=window.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return N(this.div,t)},Ia.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Ia.prototype.blur=function(){this.div.blur()},Ia.prototype.getField=function(){return this.div},Ia.prototype.supportsTouch=function(){return!0},Ia.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():$r(this.cm,function(){return e.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))})},Ia.prototype.selectionChanged=function(){var e=window.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Ia.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=window.getSelection(),t=this.cm;if(v&&d&&this.cm.options.gutters.length&&function(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var n=Ha(t,e.anchorNode,e.anchorOffset),r=Ha(t,e.focusNode,e.focusOffset);n&&r&&$r(t,function(){Yo(t.doc,wo(n,r),U),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}}},Ia.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,n,r=this.cm,o=r.display,i=r.doc.sel.primary(),a=i.from(),s=i.to();if(0==a.ch&&a.line>r.firstLine()&&(a=ve(a.line-1,ue(r.doc,a.line-1).length)),s.ch==ue(r.doc,s.line).text.length&&s.line<r.lastLine()&&(s=ve(s.line+1,0)),a.line<o.viewFrom||s.line>o.viewTo-1)return!1;a.line==o.viewFrom||0==(e=ur(r,a.line))?(t=fe(o.view[0].line),n=o.view[0].node):(t=fe(o.view[e].line),n=o.view[e-1].node.nextSibling);var l,u,c=ur(r,s.line);if(c==o.view.length-1?(l=o.viewTo-1,u=o.lineDiv.lastChild):(l=fe(o.view[c+1].line)-1,u=o.view[c+1].node.previousSibling),!n)return!1;for(var d=r.doc.splitLines(function(e,t,n,r,o){var i="",a=!1,s=e.doc.lineSeparator();function l(){a&&(i+=s,a=!1)}function u(e){e&&(l(),i+=e)}function c(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(null!=n)return void u(n||t.textContent.replace(/\u200b/g,""));var i,d=t.getAttribute("cm-marker");if(d){var p=e.findMarks(ve(r,0),ve(o+1,0),(g=+d,function(e){return e.id==g}));return void(p.length&&(i=p[0].find(0))&&u(ce(e.doc,i.from,i.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var f=/^(pre|div|p)$/i.test(t.nodeName);f&&l();for(var h=0;h<t.childNodes.length;h++)c(t.childNodes[h]);f&&(a=!0)}else 3==t.nodeType&&u(t.nodeValue);var g}for(;c(t),t!=n;)t=t.nextSibling;return i}(r,n,u,t,l)),p=ce(r.doc,ve(t,0),ve(l,ue(r.doc,l).text.length));d.length>1&&p.length>1;)if(Y(d)==Y(p))d.pop(),p.pop(),l--;else{if(d[0]!=p[0])break;d.shift(),p.shift(),t++}for(var f=0,h=0,g=d[0],m=p[0],v=Math.min(g.length,m.length);f<v&&g.charCodeAt(f)==m.charCodeAt(f);)++f;for(var b=Y(d),y=Y(p),_=Math.min(b.length-(1==d.length?f:0),y.length-(1==p.length?f:0));h<_&&b.charCodeAt(b.length-h-1)==y.charCodeAt(y.length-h-1);)++h;if(1==d.length&&1==p.length&&t==a.line)for(;f&&f>a.ch&&b.charCodeAt(b.length-h-1)==y.charCodeAt(y.length-h-1);)f--,h++;d[d.length-1]=b.slice(0,b.length-h).replace(/^\u200b+/,""),d[0]=d[0].slice(f).replace(/\u200b+$/,"");var k=ve(t,f),w=ve(l,p.length?Y(p).length-h:0);return d.length>1||d[0]||be(k,w)?(di(r.doc,d,k,w,"+input"),!0):void 0},Ia.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ia.prototype.reset=function(){this.forceCompositionEnd()},Ia.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Ia.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()},80))},Ia.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||$r(this.cm,function(){return Qr(e.cm)})},Ia.prototype.setUneditable=function(e){e.contentEditable="false"},Ia.prototype.onKeyPress=function(e){0!=e.charCode&&(e.preventDefault(),this.cm.isReadOnly()||Xr(this.cm,Ma)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Ia.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Ia.prototype.onContextMenu=function(){},Ia.prototype.resetPosition=function(){},Ia.prototype.needsContentAttribute=!0;var Va=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new H,this.hasSelection=!1,this.composing=null};Va.prototype.init=function(e){var t=this,n=this,r=this.cm,o=this.wrapper=Fa(),i=this.textarea=o.firstChild;function a(e){if(!it(r,e)){if(r.somethingSelected())xa({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var t=Na(r);xa({lineWise:!0,text:t.text}),"cut"==e.type?r.setSelections(t.ranges,null,U):(n.prevInput="",i.value=t.text.join("\n"),j(i))}"cut"==e.type&&(r.state.cutIncoming=!0)}}e.wrapper.insertBefore(o,e.wrapper.firstChild),m&&(i.style.width="0px"),tt(i,"input",function(){s&&l>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),tt(i,"paste",function(e){it(r,e)||Da(e,r)||(r.state.pasteIncoming=!0,n.fastPoll())}),tt(i,"cut",a),tt(i,"copy",a),tt(e.scroller,"paste",function(t){Cn(e,t)||it(r,t)||(r.state.pasteIncoming=!0,n.focus())}),tt(e.lineSpace,"selectstart",function(t){Cn(e,t)||ut(t)}),tt(i,"compositionstart",function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}}),tt(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},Va.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=dr(e);if(e.options.moveInputWithCursor){var o=$n(e,n.sel.primary().head,"div"),i=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,o.top+a.top-i.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,o.left+a.left-i.left))}return r},Va.prototype.showSelection=function(e){var t=this.cm,n=t.display;M(n.cursorDiv,e.cursors),M(n.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Va.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&j(this.textarea),s&&l>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",s&&l>=9&&(this.hasSelection=null))}},Va.prototype.getField=function(){return this.textarea},Va.prototype.supportsTouch=function(){return!1},Va.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!b||L()!=this.textarea))try{this.textarea.focus()}catch(e){}},Va.prototype.blur=function(){this.textarea.blur()},Va.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Va.prototype.receivedFocus=function(){this.slowPoll()},Va.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Va.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,function n(){var r=t.poll();r||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))})},Va.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||wt(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var o=n.value;if(o==r&&!t.somethingSelected())return!1;if(s&&l>=9&&this.hasSelection===o||y&&/[\uf700-\uf7ff]/.test(o))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var i=o.charCodeAt(0);if(8203!=i||r||(r="\u200b"),8666==i)return this.reset(),this.cm.execCommand("undo")}for(var a=0,u=Math.min(r.length,o.length);a<u&&r.charCodeAt(a)==o.charCodeAt(a);)++a;return $r(t,function(){Ma(t,o.slice(a),r.length-a,null,e.composing?"*compose":null),o.length>1e3||o.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=o,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Va.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Va.prototype.onKeyPress=function(){s&&l>=9&&(this.hasSelection=null),this.fastPoll()},Va.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,o=t.textarea,i=lr(n,e),a=r.scroller.scrollTop;if(i&&!p){var c=n.options.resetSelectionOnContextMenu;c&&-1==n.doc.sel.contains(i)&&Xr(n,Yo)(n.doc,wo(i),U);var d=o.style.cssText,f=t.wrapper.style.cssText;t.wrapper.style.cssText="position: absolute";var h,g=t.wrapper.getBoundingClientRect();if(o.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-g.top-5)+"px; left: "+(e.clientX-g.left-5)+"px;\n z-index: 1000; background: "+(s?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",u&&(h=window.scrollY),r.input.focus(),u&&window.scrollTo(null,h),r.input.reset(),n.somethingSelected()||(o.value=t.prevInput=" "),t.contextMenuPending=!0,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),s&&l>=9&&v(),S){pt(e);var m=function(){rt(window,"mouseup",m),setTimeout(b,20)};tt(window,"mouseup",m)}else setTimeout(b,50)}function v(){if(null!=o.selectionStart){var e=n.somethingSelected(),i="\u200b"+(e?o.value:"");o.value="\u21da",o.value=i,t.prevInput=e?"":"\u200b",o.selectionStart=1,o.selectionEnd=i.length,r.selForContextMenu=n.doc.sel}}function b(){if(t.contextMenuPending=!1,t.wrapper.style.cssText=f,o.style.cssText=d,s&&l<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=a),null!=o.selectionStart){(!s||s&&l<9)&&v();var e=0,i=function(){r.selForContextMenu==n.doc.sel&&0==o.selectionStart&&o.selectionEnd>0&&"\u200b"==t.prevInput?Xr(n,oi)(n):e++<10?r.detectingSelectAll=setTimeout(i,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(i,200)}}},Va.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e},Va.prototype.setUneditable=function(){},Va.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function n(n,r,o,i){e.defaults[n]=r,o&&(t[n]=i?function(e,t,n){n!=ba&&o(e,t,n)}:o)}e.defineOption=n,e.Init=ba,n("value","",function(e,t){return e.setValue(t)},!0),n("mode",null,function(e,t){e.doc.modeOption=t,To(e)},!0),n("indentUnit",2,To,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(e){xo(e),Wn(e),Qr(e)},!0),n("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter(function(e){for(var o=0;;){var i=e.text.indexOf(t,o);if(-1==i)break;o=i+t.length,n.push(ve(r,i))}r++});for(var o=n.length-1;o>=0;o--)di(e.doc,t,n[o],ve(n[o].line,n[o].ch+t.length))}}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=ba&&e.refresh()}),n("specialCharPlaceholder",Zt,function(e){return e.refresh()},!0),n("electricChars",!0),n("inputStyle",b?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0),n("rtlMoveVisually",!k),n("wholeLineUpdateBefore",!0),n("theme","default",function(e){va(e),ka(e)},!0),n("keyMap","default",function(e,t,n){var r=qi(t),o=n!=ba&&qi(n);o&&o.detach&&o.detach(e,r),r.attach&&r.attach(e,o||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Ca,!0),n("gutters",[],function(e){fo(e.options),ka(e)},!0),n("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?ir(e.display)+"px":"0",e.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(e){return Ir(e)},!0),n("scrollbarStyle","native",function(e){Hr(e),Ir(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),n("lineNumbers",!1,function(e){fo(e.options),ka(e)},!0),n("firstLineNumber",1,ka,!0),n("lineNumberFormatter",function(e){return e},ka,!0),n("showCursorWhenSelecting",!1,cr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("readOnly",!1,function(e,t){"nocursor"==t&&(yr(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)}),n("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),n("dragDrop",!0,wa),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,cr,!0),n("singleCursorHeightPerLine",!0,cr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,xo,!0),n("addModeClass",!1,xo,!0),n("pollInterval",100),n("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t}),n("historyEventDelay",1250),n("viewportMargin",10,function(e){return e.refresh()},!0),n("maxHighlightLength",1e4,xo,!0),n("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),n("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""}),n("autofocus",null),n("direction","ltr",function(e,t){return e.doc.setDirection(t)},!0)}(Sa),function(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,n){var r=this.options,o=r[e];r[e]==n&&"mode"!=e||(r[e]=n,t.hasOwnProperty(e)&&Xr(this,t[e])(this,n,o),ot(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](qi(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:Yr(function(t,n){var r=t.token?t:e.getMode(this.options,t);if(r.startState)throw new Error("Overlays may not be stateful.");!function(e,t,n){for(var r=0,o=n(t);r<e.length&&n(e[r])<=o;)r++;e.splice(r,0,t)}(this.state.overlays,{mode:r,modeSpec:t,opaque:n&&n.opaque,priority:n&&n.priority||0},function(e){return e.priority}),this.state.modeGen++,Qr(this)}),removeOverlay:Yr(function(e){for(var t=this.state.overlays,n=0;n<t.length;++n){var r=t[n].modeSpec;if(r==e||"string"==typeof e&&r.name==e)return t.splice(n,1),this.state.modeGen++,void Qr(this)}}),indentLine:Yr(function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),ge(this.doc,e)&&Oa(this,e,t,n)}),indentSelection:Yr(function(e){for(var t=this.doc.sel.ranges,n=-1,r=0;r<t.length;r++){var o=t[r];if(o.empty())o.head.line>n&&(Oa(this,o.head.line,e,!0),n=o.head.line,r==this.doc.sel.primIndex&&Tr(this));else{var i=o.from(),a=o.to(),s=Math.max(n,i.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;l<n;++l)Oa(this,l,e);var u=this.doc.sel.ranges;0==i.ch&&t.length==u.length&&u[r].from().ch>0&&Ko(this.doc,r,new _o(i,u[r].to()),U)}}}),getTokenAt:function(e,t){return Ut(this,e,t)},getLineTokens:function(e,t){return Ut(this,ve(e),t,!0)},getTokenTypeAt:function(e){e=Se(this.doc,e);var t,n=Rt(this,ue(this.doc,e.line)),r=0,o=(n.length-1)/2,i=e.ch;if(0==i)t=n[2];else for(;;){var a=r+o>>1;if((a?n[2*a-1]:0)>=i)o=a;else{if(!(n[2*a+1]<i)){t=n[2*a+2];break}r=a+1}}var s=t?t.indexOf("overlay "):-1;return s<0?t:0==s?null:t.slice(0,s-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=[];if(!n.hasOwnProperty(t))return r;var o=n[t],i=this.getModeAt(e);if("string"==typeof i[t])o[i[t]]&&r.push(o[i[t]]);else if(i[t])for(var a=0;a<i[t].length;a++){var s=o[i[t][a]];s&&r.push(s)}else i.helperType&&o[i.helperType]?r.push(o[i.helperType]):o[i.name]&&r.push(o[i.name]);for(var l=0;l<o._global.length;l++){var u=o._global[l];u.pred(i,this)&&-1==W(r,u.val)&&r.push(u.val)}return r},getStateAfter:function(e,t){var n=this.doc;return Bt(this,(e=Ce(n,null==e?n.first+n.size-1:e))+1,t).state},cursorCoords:function(e,t){var n=this.doc.sel.primary();return $n(this,null==e?n.head:"object"==typeof e?Se(this.doc,e):e?n.from():n.to(),t||"page")},charCoords:function(e,t){return Kn(this,Se(this.doc,e),t||"page")},coordsChar:function(e,t){return Jn(this,(e=qn(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=qn(this,{top:e,left:0},t||"page").top,he(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,n){var r,o=!1;if("number"==typeof e){var i=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>i&&(e=i,o=!0),r=ue(this.doc,e)}else r=e;return zn(this,r,{top:0,left:0},t||"page",n||o).top+(o?this.doc.height-Ke(r):0)},defaultTextHeight:function(){return nr(this.display)},defaultCharWidth:function(){return rr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,o){var i,a,s,l=this.display,u=(e=$n(this,Se(this.doc,e))).bottom,c=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),l.sizer.appendChild(t),"over"==r)u=e.top;else if("above"==r||"near"==r){var d=Math.max(l.wrapper.clientHeight,this.doc.height),p=Math.max(l.sizer.clientWidth,l.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>d)&&e.top>t.offsetHeight?u=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=d&&(u=e.bottom),c+t.offsetWidth>p&&(c=p-t.offsetWidth)}t.style.top=u+"px",t.style.left=t.style.right="","right"==o?(c=l.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==o?c=0:"middle"==o&&(c=(l.sizer.clientWidth-t.offsetWidth)/2),t.style.left=c+"px"),n&&(i=this,a={left:c,top:u,right:c+t.offsetWidth,bottom:u+t.offsetHeight},null!=(s=Er(i,a)).scrollTop&&Pr(i,s.scrollTop),null!=s.scrollLeft&&Lr(i,s.scrollLeft))},triggerOnKeyDown:Yr(aa),triggerOnKeyPress:Yr(la),triggerOnKeyUp:sa,triggerOnMouseDown:Yr(pa),execCommand:function(e){if(Ji.hasOwnProperty(e))return Ji[e].call(null,this)},triggerElectric:Yr(function(e){Pa(this,e)}),findPosH:function(e,t,n,r){var o=1;t<0&&(o=-1,t=-t);for(var i=Se(this.doc,e),a=0;a<t&&!(i=Aa(this.doc,i,o,n,r)).hitSide;++a);return i},moveH:Yr(function(e,t){var n=this;this.extendSelectionsBy(function(r){return n.display.shift||n.doc.extend||r.empty()?Aa(n.doc,r.head,e,t,n.options.rtlMoveVisually):e<0?r.from():r.to()},q)}),deleteH:Yr(function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):Ki(this,function(n){var o=Aa(r,n.head,e,t,!1);return e<0?{from:o,to:n.head}:{from:n.head,to:o}})}),findPosV:function(e,t,n,r){var o=1,i=r;t<0&&(o=-1,t=-t);for(var a=Se(this.doc,e),s=0;s<t;++s){var l=$n(this,a,"div");if(null==i?i=l.left:l.left=i,(a=ja(this,l,o,n)).hitSide)break}return a},moveV:Yr(function(e,t){var n=this,r=this.doc,o=[],i=!this.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy(function(a){if(i)return e<0?a.from():a.to();var s=$n(n,a.head,"div");null!=a.goalColumn&&(s.left=a.goalColumn),o.push(s.left);var l=ja(n,s,e,t);return"page"==t&&a==r.sel.primary()&&Or(n,Kn(n,l,"div").top-s.top),l},q),o.length)for(var a=0;a<r.sel.ranges.length;a++)r.sel.ranges[a].goalColumn=o[a]}),findWordAt:function(e){var t=this.doc,n=ue(t,e.line).text,r=e.ch,o=e.ch;if(n){var i=this.getHelper(e,"wordChars");"before"!=e.sticky&&o!=n.length||!r?++o:--r;for(var a=n.charAt(r),s=ne(a,i)?function(e){return ne(e,i)}:/\s/.test(a)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!ne(e)};r>0&&s(n.charAt(r-1));)--r;for(;o<n.length&&s(n.charAt(o));)++o}return new _o(ve(e.line,r),ve(e.line,o))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?F(this.display.cursorDiv,"CodeMirror-overwrite"):T(this.display.cursorDiv,"CodeMirror-overwrite"),ot(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==L()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:Yr(function(e,t){xr(this,e,t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Tn(this)-this.display.barHeight,width:e.scrollWidth-Tn(this)-this.display.barWidth,clientHeight:Mn(this),clientWidth:xn(this)}},scrollIntoView:Yr(function(e,t){null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:ve(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line?function(e,t){Mr(e),e.curOp.scrollToPos=t}(this,e):Dr(this,e.from,e.to,e.margin)}),setSize:Yr(function(e,t){var n=this,r=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=r(e)),null!=t&&(this.display.wrapper.style.height=r(t)),this.options.lineWrapping&&Hn(this);var o=this.display.viewFrom;this.doc.iter(o,this.display.viewTo,function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){Zr(n,o,"widget");break}++o}),this.curOp.forceUpdate=!0,ot(this,"refresh",this)}),operation:function(e){return $r(this,e)},startOperation:function(){return Vr(this)},endOperation:function(){return Gr(this)},refresh:Yr(function(){var e=this.display.cachedTextHeight;Qr(this),this.curOp.forceUpdate=!0,Wn(this),xr(this,this.doc.scrollLeft,this.doc.scrollTop),uo(this),(null==e||Math.abs(e-nr(this.display))>.5)&&sr(this),ot(this,"refresh",this)}),swapDoc:Yr(function(e){var t=this.doc;return t.cm=null,No(this,e),Wn(this),this.display.input.reset(),xr(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,un(this,"swapDoc",this,t),t}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},lt(e),e.registerHelper=function(t,r,o){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=o},e.registerGlobalHelper=function(t,r,o,i){e.registerHelper(t,r,i),n[t]._global.push({pred:o,val:i})}}(Sa);var Ga,Ua="iter insert remove copy getEditor constructor".split(" ");for(var za in Ti.prototype)Ti.prototype.hasOwnProperty(za)&&W(Ua,za)<0&&(Sa.prototype[za]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ti.prototype[za]));return lt(Ti),Sa.inputStyles={textarea:Va,contenteditable:Ia},Sa.defineMode=function(e){Sa.defaults.mode||"null"==e||(Sa.defaults.mode=e),function(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Et[e]=t}.apply(this,arguments)},Sa.defineMIME=function(e,t){Ot[e]=t},Sa.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Sa.defineMIME("text/plain","null"),Sa.defineExtension=function(e,t){Sa.prototype[e]=t},Sa.defineDocExtension=function(e,t){Ti.prototype[e]=t},Sa.fromTextArea=function(t,n){if((n=n?R(n):{}).value=t.value,!n.tabindex&&t.tabIndex&&(n.tabindex=t.tabIndex),!n.placeholder&&t.placeholder&&(n.placeholder=t.placeholder),null==n.autofocus){var r=L();n.autofocus=r==t||null!=t.getAttribute("autofocus")&&r==e.body}function o(){t.value=l.getValue()}var i;if(t.form&&(tt(t.form,"submit",o),!n.leaveSubmitMethodAlone)){var a=t.form;i=a.submit;try{var s=a.submit=function(){o(),a.submit=i,a.submit(),a.submit=s}}catch(e){}}n.finishInit=function(e){e.save=o,e.getTextArea=function(){return t},e.toTextArea=function(){e.toTextArea=isNaN,o(),t.parentNode.removeChild(e.getWrapperElement()),t.style.display="",t.form&&(rt(t.form,"submit",o),"function"==typeof t.form.submit&&(t.form.submit=i))}},t.style.display="none";var l=Sa(function(e){return t.parentNode.insertBefore(e,t.nextSibling)},n);return l},(Ga=Sa).off=rt,Ga.on=tt,Ga.wheelEventPixels=vo,Ga.Doc=Ti,Ga.splitLines=kt,Ga.countColumn=B,Ga.findColumn=K,Ga.isWordChar=te,Ga.Pass=G,Ga.signal=ot,Ga.Line=Kt,Ga.changeEnd=Co,Ga.scrollbarModel=Br,Ga.Pos=ve,Ga.cmpPos=be,Ga.modes=Et,Ga.mimeModes=Ot,Ga.resolveMode=Tt,Ga.getMode=xt,Ga.modeExtensions=Mt,Ga.extendMode=Dt,Ga.copyState=Pt,Ga.startState=Lt,Ga.innerMode=Nt,Ga.commands=Ji,Ga.keyMap=Bi,Ga.keyName=zi,Ga.isModifierKey=Gi,Ga.lookupKey=Vi,Ga.normalizeKeyMap=Wi,Ga.StringStream=Ft,Ga.SharedTextMarker=Ci,Ga.TextMarker=ki,Ga.LineWidget=bi,Ga.e_preventDefault=ut,Ga.e_stopPropagation=ct,Ga.e_stop=pt,Ga.addClass=F,Ga.contains=N,Ga.rmClass=T,Ga.keyNames=Ai,Sa.version="5.34.0",Sa}()},function(e,t,n){"use strict"; /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */e.exports=function(e,t,n,r,o,i,a,s){if(!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,o,i,a,s],c=0;(l=new Error(t.replace(/%s/g,function(){return u[c++]}))).name="Invariant Violation"}throw l.framesToPop=1,l}}},function(e,t,n){"use strict";var r=n(1),o=n.n(r),i=n(18),a=n.n(i),s=n(48),l=n.n(s),u=n(4),c=n.n(u),d=(n(1109),Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function f(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var h=function(e){function t(){var e,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var o=arguments.length,i=Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=r=f(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(i))),r._onChange=function(){var e=r.props,t=e.name,n=e.value,o=e._onChange,i=e.readonly,a=e.defaultValue;i||o(t,"on"===(!n&&a?a:n)?"off":"on")},f(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r["PureComponent"]),p(t,[{key:"render",value:function(){var e=this.props,t=e.className,n=e.onClick,r=e.value,i=e.name,s=e.id,l=e.defaultValue,u=!c()(this.props.button_options)&&"equal"===this.props.button_options.button_type,p=!r&&l?l:r,f=a()({"et-core-control-toggle":!0,"et-core-control-toggle--equal":u,"et-core-control-toggle--on":"on"===p,"et-core-control-toggle--off":!p||"off"===p},t);s||(s="et-fb-"+i);var h={};return this.props.readonly&&(h.disabled=!0),o.a.createElement("div",d({className:f,onClick:n||this._onChange},h),o.a.createElement("div",{className:"et-core-control-toggle__label et-core-control-toggle__label--on"},o.a.createElement("div",{className:"et-core-control-toggle__text"},this.props.options.on),o.a.createElement("div",{className:"et-core-control-toggle__handle"})),o.a.createElement("div",{className:"et-core-control-toggle__label et-core-control-toggle__label--off"},o.a.createElement("div",{className:"et-core-control-toggle__text"},this.props.options.off),o.a.createElement("div",{className:"et-core-control-toggle__handle"})),o.a.createElement("input",{type:"hidden",id:s,name:i,value:r}))}}]),t}();h.defaultProps={value:"off",_onChange:l.a},t.a=h},function(e,t,n){"use strict";var r=n(2),o=n.n(r),i=n(4),a=n.n(i),s=n(9),l=n.n(s),u=n(1),c=n.n(u),d=n(6),p=n.n(d),f=n(32),h=n.n(f),g=n(18),m=n.n(g),v=n(61),b=n.n(v),y=n(11),_=n.n(y),k=n(33),w=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var C=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onClick=n.onClick.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,c.a.Component),w(t,[{key:"onClick",value:function(e){e.preventDefault(),this.props.onClick(this.props.value)}},{key:"render",value:function(){var e=this.props,t=e.tag,n=e.className,r=e.children;return c.a.createElement(t,{className:n,onClick:this.onClick},r)}}]),t}();C.propTypes={tag:p.a.string.isRequired,className:p.a.string,children:p.a.arrayOf(p.a.node).isRequired,value:p.a.oneOfType([p.a.number,p.a.string,p.a.object,p.a.array]).isRequired,onClick:p.a.func.isRequired},C.defaultProps={className:""};var S=C,E=n(3),O=(n(1156),function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}());var T=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.tag="a",n.classes={icon:"et-fb-preset__icon",title:"et-fb-preset__title",content:"et-fb-preset__content"},n.onClick=n.onClick.bind(n),n.renderPreset=n.renderPreset.bind(n),n.shouldComponentUpdate=h.a.shouldComponentUpdate.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,c.a.Component),O(t,[{key:"onClick",value:function(e){var t=this.props,n=t._onChange,r=t.presets,i=t.name;n(i,e);var a=o()(b()(r,{value:e}),"fields",{});_()(a,function(e,t){return n(t,e)})}},{key:"renderTitle",value:function(e){return a()(e)?null:c.a.createElement("span",{className:this.classes.title},e)}},{key:"renderIcon",value:function(e){return a()(e)?null:c.a.createElement("span",{className:this.classes.icon},c.a.createElement(k.a,{icon:e}))}},{key:"renderContent",value:function(e){return a()(e)?null:c.a.createElement("span",{className:this.classes.content,dangerouslySetInnerHTML:{__html:e}})}},{key:"renderPreset",value:function(e,t){var n=e.title,r=e.icon,o=e.content,i=e.value,a=m()({"et-fb-preset":!0,"et-fb-preset--active":i===this.props.value});return c.a.createElement(S,{tag:this.tag,className:a,key:t,value:i,onClick:this.onClick},this.renderTitle(n),this.renderIcon(r),this.renderContent(o))}},{key:"render",value:function(){return c.a.createElement("div",{className:"et-fb-preset-container"},this.props.presets.map(this.renderPreset))}}]),t}();T.propTypes={name:p.a.string.isRequired,value:p.a.string.isRequired,presets:p.a.arrayOf(p.a.object).isRequired,_onChange:p.a.func.isRequired};var x=T,M=n(850),D=n(84),P=n.n(D),N=(n(57),n(87)),L=n.n(N),F=n(19),A=n.n(F),j=n(39),I=n.n(j),R=n(41),B=n.n(R),H=n(53),W=n.n(H),V=n(71),G=n.n(V),U=n(103),z=n.n(U),q=n(517),K=n.n(q),$=n(69),X=n.n($),Y=n(194),J=n.n(Y),Q=n(131),Z=n.n(Q),ee=n(1058),te=n.n(ee),ne=n(688),re=n.n(ne),oe=n(686),ie=n.n(oe),ae=n(434),se=n.n(ae),le=n(452),ue=n.n(le),ce=(n(149),n(12)),de=n.n(ce),pe=n(0),fe=n(10),he=n(781),ge=n(1106),me=(n(1163),n(15)),ve=n(133),be=function(e){return!te()(e)&&0!==parseInt(e)&&"false"!==e},ye=function(e){return e&&!1!==e?"true":"false"},_e=function(e,t){return e||t},ke=ve.a.instance(),we=P()({displayName:"ETBuilderControlInputMargins",mixins:[h.a],getInitialState:function(){var e=this._calculatePreviewMode(),t=o()(this.props,"value.activeTab","desktop"),n="wireframe"===e?t:e;return{activeTab:n,value:this.getCurrentInputValue(n)}},getDefaultValues:function(){var e=this._calculatePreviewMode();return"zoom"!==e&&"wireframe"!==e||(e="desktop"),{desktop:["","","",""],tablet:["","","",""],phone:["","","",""],activeTab:e,isResponsive:!1}},componentWillMount:function(){var e=this;this._onTopChange=this._onInputChange(0).bind(this),this._onRightChange=this._onInputChange(1).bind(this),this._onBottomChange=this._onInputChange(2).bind(this),this._onLeftChange=this._onInputChange(3).bind(this),this.getTopBottomLink=Z()(be,se()(4),function(t){return ue()(t,e.getDefaultValue(),_e)},ie()("|"),this.getStateValue),this.getLeftRightLink=Z()(be,se()(5),function(t){return ue()(t,e.getDefaultValue(),_e)},ie()("|"),this.getStateValue)},componentDidMount:function(){this.updatePreviewMode=L()(this._onPreviewModeChange,500,{leading:!1}),pe.default.appWindow().addEventListener("resize",this.updatePreviewMode),this.saveValue=L()(this.updateOptionValue,0,{leading:!1})},componentWillUnmount:function(){pe.default.appWindow().removeEventListener("resize",this.updatePreviewMode)},componentWillReceiveProps:function(e){var t=o()(e,"value.activeTab"),n=ke.isAnimating()?this.state.activeTab:this._calculatePreviewMode(),r="wireframe"===n?t:n,i=this.hasResponsiveValue()?r:"desktop",a=o()(e,"value",{}),s=B()(a)?a[i]:a;r===this.state.activeTab&&s===this.getStateValue()||this.setState({activeTab:r,value:s})},_calculatePreviewMode:function(){var e=E.a.getPreviewMode();return"zoom"!==e&&o()(this.props,"value.isResponsive",!1)?"wireframe"===e?"wireframe":ke.getViewModeByWidth(pe.default.$appWindow().width()):"desktop"},_onPreviewModeChange:function(){var e=this.getValue("isResponsive")?this._calculatePreviewMode():"desktop";l()(["desktop","tablet","phone"],e)&&this.setState({activeTab:e,value:this.getCurrentInputValue(e)})},getCSSProperty:function(){return o()({custom_padding:"padding",custom_margin:"margin"},this.props.type)},getValues:function(e){var t=this.getDefaultValues(),n=a()(e)?this.props:e,r=a()(n.value)||""===n.value?t:pe.default.intentionallyClone(n.value),o=["desktop","tablet","phone"];return W()(r)&&(r={desktop:r}),_()(r,function(e,n){if(l()(o,n)){var i=a()(e)||A()(e)?e:e.split("|");A()(i)&&2===G()(i)&&(i=[i[0],"",i[1],""]),r[n]=!a()(e)&&pe.default.hasValue(e)?i:t[n]}else"activeTab"===n&&(r.activeTab=l()(o,e)?e:t.activeTab)}),r},getValue:function(e,t){var n=this.getValues(t);return a()(n)||a()(n[e])?"":n[e]},getStateValue:function(){return re()(this.state.value)},getDefaultValue:function(e){var t=pe.default.getPrevBreakpoint(e),n=o()(this.props,"default_"+e,"");return t?n?n.split("|"):this.getDefaultValue(t):o()(this.props,"default","").split("|")},getCascadedDefault:function(e){var t=pe.default.getPrevBreakpoint(e);return t?pe.default.get(this.getCascadedValue(t),this.getDefaultValue(e)):this.getDefaultValue(e)},getCascadedValue:function(e){for(var t=pe.default.getBreakpoints(),n=X()(t,e),r=this.getValue(e);n>0;n--){var o=t[n-1];r=K()(r,this.getValue(o),function(e,t){return pe.default.hasValue(e)?e:t})}return r},getCurrentInputValue:function(e,t){var n=void 0,r="desktop";return a()(e)?(this.getActiveTab("tablet")&&this.getValue("isResponsive")&&(r="tablet"),this.getActiveTab("phone")&&this.getValue("isResponsive")&&(r="phone")):r=e,n=this.getValue(r,t),a()(n)||!A()(n)?"||||":n.join("|")},getActiveTab:function(e){var t="zoom"===this._calculatePreviewMode()?"desktop":o()(this,"state.activeTab");return this.hasResponsiveValue()?e===t:e===this.getValue("activeTab")},getPropsNameSuffix:function(){var e=this.state.activeTab;return!l()(["zoom","wireframe","desktop"],e)&&this.hasResponsiveValue()?"_"+e:""},getPropsNameLastEdited:function(){return this.props.name+"_last_edited"},getPropsValueLastEdited:function(e,t){return(e?"on":"off")+"|"+(t=e?t:"desktop")},hasMobileOptions:function(){return pe.default.hasValue(this.props.mobile_options)},hasResponsiveValue:function(){return this.hasMobileOptions()&&B()(this.props.value)&&this.props.value.isResponsive},shouldDisplayResetButton:function(){if(this.props.readonly||this.props.disableReset)return!1;var e=this.getValue("activeTab"),t=this.getStateValue().split("|"),n=o()(this.getDefaultValues(),e,["","","",""]);return!I()(t,n)},toggleResponsive:function(e){e.preventDefault();var t=!this.getValue("isResponsive"),n=t?o()(this,"state.activeTab","desktop"):"desktop";t&&this.removePaddingMobile(),this.props._onChange(this.getPropsNameLastEdited(),this.getPropsValueLastEdited(t,n)),this.setState({activeTab:n,value:this.getCurrentInputValue(n)})},reset:function(e){e.preventDefault();var t=this.getDefaultValues(),n=this.getValue("activeTab");this.getValues()[n]=t[n],this.props._onChange(this.props.name+this.getPropsNameSuffix(),t[n].join("|")),this.setState({value:t[n].join("|")})},changeTab:function(e){var t=E.a.getActiveModule(),n=this.getValue("isResponsive"),r=e.target.getAttribute("data-tab"),o=this._calculatePreviewMode();if("hover"===r)return fe.b.switchResponsiveMode("desktop"),fe.b.toggleModuleHover(!0),void fe.b.moduleSettingsChange(t,"hover_enabled",1);fe.b.toggleModuleHover(!1),fe.b.moduleSettingsChange(t,"hover_enabled",0),this.setState({activeTab:r,value:this.getCurrentInputValue(r)}),"wireframe"!==o&&fe.b.switchResponsiveMode(r),this.props._onChange(this.getPropsNameLastEdited(),this.getPropsValueLastEdited(n,r)),this.removePaddingMobile()},removePaddingMobile:function(){var e=o()(this,"props.name",!1),t=o()(this,"props.module.props.module.props.attrs.padding_mobile",!1),n=o()(this,"props.module.props.module.props.attrs.column_padding_mobile",!1);"custom_padding"===e&&pe.default.hasValue(t)&&this.props._onChange("padding_mobile",""),l()(["padding_1","padding_2","padding_3","padding_4","padding_5","padding_6"],e)&&pe.default.hasValue(n)&&this.props._onChange("column_padding_mobile","")},getInput:function(e,t,n,r){var i="et-fb-"+this.props.name,a="padding"===this.getCSSProperty()?0:void 0,s=n===r?"":n,l=o()({top:this._onTopChange,right:this._onRightChange,bottom:this._onBottomChange,left:this._onLeftChange},t);return c.a.createElement("div",{className:"et-fb-settings-option-input-wrap "+t},c.a.createElement(ge.a,{id:i+"-input-"+t,name:this.props.name+"-input-"+t,type:"text",className:"et-fb-settings-option-input et-fb-settings-option-input-margin et-fb-settings-option-input-margin--"+t,value:z()(s),defaultValue:r,"data-tab":e,"data-order":"0",onChange:l,speed:4,min:a,label:ETBuilderBackend.i18n.controls.inputMargin[t],defaultUnit:"px",property:this.getCSSProperty(),readonly:o()(this.props,"readonly",!1)}))},inputsWrap:function(e){var t=this.getStateValue().split("|"),n=this.getCascadedDefault(e);return c.a.createElement("div",{className:"et-fb-settings-option-inputs-wrap"},this.getInput(e,"top",t[0],n[0]),c.a.createElement(he.a,{active:this.getTopBottomLink(),onClick:this._topBottomLink}),this.getInput(e,"bottom",t[2],n[2]),this.getInput(e,"left",t[3],n[3]),c.a.createElement(he.a,{active:this.getLeftRightLink(),onClick:this._leftRightLink}),this.getInput(e,"right",t[1],n[1]))},render:function(){var e=this.getActiveTab("desktop")?"active":"",t=this.getActiveTab("tablet")?"active":"",n=this.getActiveTab("phone")?"active":"",r=this.getValue("isResponsive"),i=ETBuilderBackend.i18n.controls.responsiveTabs,a="et-fb-settings-option-inner et-fb-settings-option-inner-responsive et-fb-settings-option-inner-input-margins",s=void 0,l=void 0,u=void 0,d=void 0;if(r&&(a+=" et-fb-settings-option-inner-responsive--active"),this.getValue("isResponsive")){var p=me.a.getFieldBaseName(o()(this,"props.name","")),f=E.a.getActiveModule(),h=me.a.isEnabled("props.attrs."+p,f),g=!0===E.a.getHoverMode()?"active":"",m=h?c.a.createElement("li",{className:g,"data-tab":"hover",onClick:this.changeTab},ETBuilderBackend.i18n.controls.tabs.hover):"",v=h?"et-fb-settings-option-responsive-tab-nav et-fb-settings-option-responsive-tab-nav-hover-active ":"et-fb-settings-option-responsive-tab-nav";"active"===g&&(e=""),s=c.a.createElement("ul",{className:v},c.a.createElement("li",{className:e,"data-tab":"desktop",onClick:this.changeTab},i.desktop),m,c.a.createElement("li",{className:t,"data-tab":"tablet",onClick:this.changeTab},i.tablet),c.a.createElement("li",{className:n,"data-tab":"phone",onClick:this.changeTab},i.phone))}!this.getActiveTab("desktop")&&this.hasResponsiveValue()||(l=this.inputsWrap("desktop")),this.getActiveTab("tablet")&&r&&(u=this.inputsWrap("tablet")),this.getActiveTab("phone")&&r&&(d=this.inputsWrap("phone")),this.shouldDisplayResetButton()&&c.a.createElement("button",{className:"et-fb-settings-option-button--reset",onClick:this.reset});this.hasMobileOptions()&&c.a.createElement("button",{className:"et-fb-settings-option-button--responsive",onClick:this.toggleResponsive});return c.a.createElement("div",{className:a},s,l,u,d)},_topBottomLink:function(){if(!this.props.readonly){var e=this.getLastVerticalUpdated(),t=this.getStateValue().split("|");t[4]=ye(!this.getTopBottomLink()),this.getTopBottomLink()||t[0]===t[2]||(te()(e)?te()(t[0])?t[0]=t[2]:t[2]=t[0]:"top"===e?t[2]=t[0]:t[0]=t[2]),this.updatePadding(t.join("|"))}},_leftRightLink:function(){if(!this.props.readonly){var e=this.getLastHorizontalUpdated(),t=this.getStateValue().split("|");t[5]=ye(!this.getLeftRightLink()),this.getLeftRightLink()||t[1]===t[3]||(te()(e)?te()(t[3])?t[3]=t[1]:t[1]=t[3]:"left"===e?t[1]=t[3]:t[3]=t[1]),this.updatePadding(t.join("|"))}},_onInputChange:J()(function(e,t){if(!this.props.readonly){var n=this.getStateValue().split("|");switch(n[e]=t,e){case 0:n[2]=this.getTopBottomLink()?n[e]:n[2],this._lastVUpdated="top";break;case 1:n[3]=this.getLeftRightLink()?n[e]:n[3],this._lastHUpdated="right";break;case 2:n[0]=this.getTopBottomLink()?n[e]:n[0],this._lastVUpdated="bottom";break;case 3:n[1]=this.getLeftRightLink()?n[e]:n[1],this._lastHUpdated="left"}this.updatePadding(n.join("|"))}}),getLastVerticalUpdated:function(){return this._lastVUpdated},getLastHorizontalUpdated:function(){return this._lastHUpdated},updatePadding:function(e){this.removePaddingMobile(),this.setState({value:e}),this.saveValue.cancel(),this.saveValue()},updateOptionValue:function(){this.props._onChange(this.props.name+this.getPropsNameSuffix(),this.getStateValue())}});we.defaultProps={default:"|||||"};var Ce=we,Se=n(17),Ee=n.n(Se),Oe=(n(1164),function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}());var Te=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={date_time:null},n.shouldComponentUpdate=h.a.shouldComponentUpdate.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,u["Component"]),Oe(t,[{key:"componentDidMount",value:function(){var e=this,t=pe.default.$topWindow(Ee.a.findDOMNode(this.refs.input));t.datetimepicker({showButtonPanel:!1,dateFormat:"yy-mm-dd",onSelect:function(t,n){e.props._onChange(e.props.name,t)}}),t.datetimepicker("setDate",this.props.value)}},{key:"render",value:function(){return c.a.createElement("div",{className:"et-fb-settings-option-input-datetime",ref:"input"})}}]),t}(),xe=n(1086),Me=n(1062),De=n(1087),Pe=n(1088),Ne=n(1052),Le=n(1187),Fe=n(685),Ae=n(82),je=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ie=function(e){return c.a.createElement(Ae.a,{componentName:e.name},c.a.createElement(Fe.a,je({className:"et-fb-settings-option-select--dividers"},e)))},Re=n(21),Be=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var He=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n._onChange=n._onChange.bind(n),n.shouldComponentUpdate=h.a.shouldComponentUpdate.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,u["Component"]),Be(t,[{key:"render",value:function(){var e=Re.a.getWidgetAreas(),t={},n="";return _()(e,function(e,r){n||(n=r),t[r]=e.name}),c.a.createElement(Fe.a,{value:this.props.value,default:n,name:this.props.name,__onChange:this._onChange,options:t})}},{key:"_onChange",value:function(e){this.props._onChange(this.props.name,e)}}]),t}();He.propTypes={_onChange:p.a.func,className:p.a.object,computed_affects:p.a.array,name:p.a.string,description:p.a.string,value:p.a.string};var We=He,Ve=n(1189),Ge=n(91),Ue=n(690),ze=n(54),qe=n(7),Ke=n.n(qe),$e=n(27),Xe=n.n($e),Ye=n(76),Je=n.n(Ye),Qe=n(59),Ze=n.n(Qe),et=n(30),tt=n.n(et),nt=n(36),rt=n.n(nt),ot=(n(1191),Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}),it=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function at(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var st=ETBuilderBackend.i18n.fonts,lt=new Ge.AllHtmlEntities,ut={name:p.a.string,value:p.a.string,default:p.a.string,_onChange:p.a.func,_resetOption:p.a.func},ct=function(e){return o()(ETBuilderBackend,"removedFonts."+e+".parent_font",e)},dt=[{slug:"italic",icon:"text-italic"},{slug:"uppercase",icon:"text-uppercase"},{slug:"capitalize",icon:"text-smallcaps"},{slug:"underline",icon:"text-underline"},{slug:"line_through",icon:"text-strikethrough"}],pt=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.getDefaultValue=function(e){return o()(n.getDefaultValues(),e,"")},n.getValue=function(e){return o()(n.getValues(),e,"")},n.isDefault=function(e){switch(e){case"style":return rt()(dt,"slug").reduce(function(e,t){return e&&n.isDefault(t)},!0);default:return n.getValue(e)===n.getDefaultValue(e)}},n.updateFontWeight=function(e){return n.updateOptionValue("weight",e)},n.updateLineColor=function(e,t){return n.updateOptionValue("line_color",t)},n.updateLineStyle=function(e){return n.updateOptionValue("line_style",e)},n.resetOption=function(e){switch(e){case"style":var t=rt()(dt,"slug").reduce(function(e,t){return ot({},e,at({},t,!1))},{});n.updateFontStyle(t);break;default:n.updateOptionValue(e,"")}},n.toggleButton=function(e){return n.updateOptionValue(e,!n.getValue(e))},n.getLabel=function(e,t){return c.a.createElement(Ue.a,{isResetActive:!n.isDefault(e),onClickReset:function(t){return n.resetOption(e)},for:n.props.name+"_"+e,name:n.props.name,hoveredGroup:n.state.hoveredElement===e},lt.decode(t))},n.state={uploadedFonts:n.getUploadedFonts(),hoveredElement:null},n.shouldComponentUpdate=h.a.shouldComponentUpdate.bind(n),n.getDefaultValues=n.getDefaultValues.bind(n),n.getValues=n.getValues.bind(n),n.updateFontStyle=n.updateFontStyle.bind(n),n.updateFontFamily=n.updateFontFamily.bind(n),n.fontStyleButtonClassNames=n.fontStyleButtonClassNames.bind(n),n.getFontWeightOptions=n.getFontWeightOptions.bind(n),n.getFontWeight=n.getFontWeight.bind(n),n.updateOptionValue=n.updateOptionValue.bind(n),n._onFontUploaderUpdate=n._onFontUploaderUpdate.bind(n),n.maybeResetFont=n.maybeResetFont.bind(n),n._applyFontPreview=n._applyFontPreview.bind(n),n._applyFontPreviewOnLoad=n._applyFontPreviewOnLoad.bind(n),n._previewFontOnHover=n._previewFontOnHover.bind(n),n.updateLineStyle=n.updateLineStyle.bind(n),n._onMouseEnter=n._onMouseEnter.bind(n),n._onMouseLeave=n._onMouseLeave.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,c.a.Component),it(t,[{key:"componentDidMount",value:function(){this.props.isItemSelected||setTimeout(this.maybeResetFont,0),E.a.addFontUploaderUpdateListener(this._onFontUploaderUpdate),this._applyFontPreviewOnLoad();var e=o()(this.props,"additionalAttrs.oldOptionValue",""),t=o()(this.props,"attributes.data-old-option-ref",!1);if(""!==e&&t){var n={};"on"===e&&(n.uppercase="on",this.updateFontStyle(n)),this.props._resetOption(t)}}},{key:"componentWillUnmount",value:function(){E.a.removeFontUploaderUpdateListener(this._onFontUploaderUpdate)}},{key:"maybeResetFont",value:function(){var e=this.getValues(),t=ETBuilderBackend.removedFonts,n=e.font;if(!a()(t[n]))return this.updateOptionValue("font",t[n].parent_font),void this.updateOptionValue("weight",t[n].styles);a()(ETBuilderBackend.googleFonts[n])&&a()(ETBuilderBackend.customFonts[n])&&this.updateOptionValue("font","Default")}},{key:"getDefaultValues",value:function(){var e=(W()(this.props.default)?this.props.default:"||||||||").split("|");return{font:ct(e[0]||""),weight:this.processFontWeightValue(e[1])||"",italic:pe.default.isOn(e[2]),uppercase:pe.default.isOn(e[3]),underline:pe.default.isOn(e[4]),capitalize:pe.default.isOn(e[5]),line_through:pe.default.isOn(e[6]),line_color:e[7]||"",line_style:e[8]||""}}},{key:"getValues",value:function(){var e=a()(this.props.value)?this.getDefaultValues():this.props.value,t=B()(e)?e:e.split("|");return{font:ct(t[0]||""),weight:this.processFontWeightValue(Xe()(t[1]))||"",italic:pe.default.isOn(t[2]),uppercase:pe.default.isOn(t[3]),underline:pe.default.isOn(t[4]),capitalize:pe.default.isOn(t[5]),line_through:pe.default.isOn(t[6]),line_color:t[7]||"",line_style:t[8]||""}}},{key:"_onFontUploaderUpdate",value:function(){var e=this;setTimeout(function(){e.maybeResetFont()},100),this.setState({uploadedFonts:this.getUploadedFonts()})}},{key:"processFontWeightValue",value:function(e){return"on"===e?"700":e}},{key:"updateFontStyle",value:function(e){var t=this.getValues(),n=de()(t,e),r="Default"===n.font?"":n.font,o=r+"|"+("400"===n.weight?"":n.weight)+"|"+(n.italic?"on":"")+"|"+(n.uppercase?"on":"")+"|"+(n.underline?"on":"")+"|"+(n.capitalize?"on":"")+"|"+(n.line_through?"on":"")+"|"+n.line_color+"|"+n.line_style;this.props._onChange(this.props.name,o),this._applyFontPreview(r,"font-family"),this._applyFontPreview(r,"font-weight")}},{key:"updateFontFamily",value:function(e){this.updateFontStyle({font:e}),this._applyFontPreview(e,"font-family"),this._applyFontPreview(e,"font-weight")}},{key:"_previewFontOnHover",value:function(e){this._applyFontPreview(e,"font-family")}},{key:"_applyFontPreviewOnLoad",value:function(){var e=this.getValue("font");this._applyFontPreview(e,"font-weight"),this._applyFontPreview(e,"font-family")}},{key:"_applyFontPreview",value:function(e,t){var n=pe.default.$topWindow("head"),r="font-weight"===t?"et-fb-font-weight-"+this.props.name:e.replace(/ /g,"_");if("Default"!==e&&""!==e){pe.default.maybeLoadFont(e);var o="";if("font-weight"===t)n.find("style#"+r).length>0&&n.find("style#"+r).remove(),o='<style id="'+r+'" type="text/css">.et-fb-settings-option-inner--'+this.props.name+' .et-fb-font-weight-option { font-family:"'+e+'"; }</style>';else{if(n.find("style#et-fb-font-"+r).length>0)return;o='<style id="et-fb-font-'+r+'" type="text/css">.et-fb-option--font .select-option-item-'+r+' { font-family:"'+e+'"; }</style>'}n.append(o)}else"font-weight"===t&&n.find("style#"+r).length>0&&n.find("style#"+r).remove()}},{key:"getUploadedFonts",value:function(){var e=ETBuilderBackend.customFonts;return Ke()(e)?[]:tt()(e)}},{key:"getFontWeightOptions",value:function(){var e=ETBuilderBackend.googleFonts,t=ETBuilderBackend.customFonts,n=this.getValue("font"),r=o()(t,n,!1),i=tt()(ETBuilderBackend.allFontWeights),s={},l=[];if(""===n)l=["300","400","600","700","800"];else{if(r||(r=o()(e,n,!1)),!r||a()(r.styles))return ETBuilderBackend.allFontWeights;l=r.styles.split(",")}var u=Je()(Ze()(["400","700"],l),i);return _()(u,function(e){s[e]=ETBuilderBackend.allFontWeights[e]}),s}},{key:"getFontWeight",value:function(){var e=this.getValue("weight");return!0===e?"700":l()(tt()(this.getFontWeightOptions()),e)?e:"400"}},{key:"updateOptionValue",value:function(e,t){var n=this.getValues();n[e]=pe.default.get(t,""),_()([["uppercase","capitalize"],["underline","line_through"]],function(t){l()(t,e)&&_()(t,function(t){t!==e&&(n[t]=!1)})}),this.updateFontStyle(n)}},{key:"fontStyleButtonClassNames",value:function(e){var t;return m()((at(t={"et-fb-select-fontstyle-button":!0},"et-fb-select-fontstyle-button--"+e,!0),at(t,"et-fb-select-fontstyle-option--"+this.props.name,!0),t))}},{key:"fieldClassNames",value:function(e,t){var n;return m()(de()({},(at(n={"et-fb-font-option-container":!0,"et-fb-font-option-container-with-label":!0},"et-fb-font-option-container--"+this.props.name,!0),at(n,"et-fb-font-option-container--sub",!0),at(n,"et-fb-font-option-container--sub-"+e,!0),n),t))}},{key:"_onMouseEnter",value:function(e){!this.props.rightClickOpened&&this.props.isSettingsModal&&(fe.b.setHoveredSubElement(e),this.setState({hoveredElement:e}))}},{key:"_onMouseLeave",value:function(){!this.props.rightClickOpened&&this.props.isSettingsModal&&fe.b.setHoveredSubElement(!1)}},{key:"_extraProps",value:function(){var e={readonly:this.props.readonly,disableReset:this.props.disableReset};return de()({},e)}},{key:"_isFilterActive",value:function(){return l()(["styles_modified","active_content"],this.props.filterSelected)}},{key:"_isRenderSubFieldLabel",value:function(e){return!!a()(this.props.subFieldLabel)||(W()(this.props.subFieldLabel)?e===this.props.subFieldLabel:A()(this.props.subFieldLabel)?l()(this.props.subFieldLabel,e):this.props.subFieldLabel)}},{key:"_isRenderSubField",value:function(e){return!!a()(this.props.subField)||(W()(this.props.subField)?e===this.props.subField:A()(this.props.subField)?l()(this.props.subField,e):this.props.subField)}},{key:"_renderSubFieldFontFamily",value:function(){var e=this;if(!this._isRenderSubField("font"))return!1;var t=this.getValue("font");if(this._isFilterActive()&&(!t||"Default"===t))return!1;var n=this.fieldClassNames("font");return c.a.createElement("div",{className:n,onMouseEnter:function(){return e._onMouseEnter("font")},onMouseLeave:function(){return e._onMouseLeave("font")}},this._isRenderSubFieldLabel("font")&&this.props.formLabel,this._isRenderSubFieldLabel("font")&&this.props.formDescription,c.a.createElement(Fe.a,ot({default:"Default",recentCategory:"font_family",value:t,name:this.props.name,options:ETBuilderBackend.googleFontsList,additionalOptions:{uploaded:this.state.uploadedFonts},searchPlaceholder:st.searchFonts,searchable:!0,displayRecent:!0,_hoverAction:this._previewFontOnHover,__onChange:this.updateFontFamily},this._extraProps())))}},{key:"_renderSubFieldFontWeight",value:function(){var e=this;if(!this._isRenderSubField("weight"))return!1;var t=this.getFontWeight();if(this._isFilterActive()&&(!t||l()(["400","normal"],t)))return!1;var n=a()(this.props.group_label)?st.fontWeight:this.props.group_label+" "+st.fontWeight,r=!!this._isRenderSubFieldLabel("weight")&&this.getLabel("weight",n),o=this.fieldClassNames("weight");return c.a.createElement("div",{className:o,onMouseEnter:function(){return e._onMouseEnter("weight")},onMouseLeave:function(){return e._onMouseLeave("weight")}},r,c.a.createElement(Fe.a,ot({className:"et-fb-font-weight-option",name:this.props.name+"_weight",default:"normal",value:t,options:this.getFontWeightOptions(),__onChange:this.updateFontWeight},this._extraProps())))}},{key:"_renderSubFieldFontStyle",value:function(){var e=this;if(!this._isRenderSubField("style"))return!1;var t=dt.filter(function(t){return!e._isFilterActive()||e._isFilterActive()&&e.getValue(t.slug)});if(Ke()(t))return!1;var n=t.map(function(t){var n=e.getValue(t.slug)?ze.a.activeTabIcon:ze.a.optionTabIcon;return c.a.createElement("button",{key:t.slug,className:e.fontStyleButtonClassNames(t.slug),onClick:function(n){return e.toggleButton(t.slug)||n.preventDefault()},"data-button":t.slug,type:t},c.a.createElement(k.a,{icon:t.icon,color:n}))}),r=a()(this.props.group_label)?st.fontStyle:this.props.group_label+" "+st.fontStyle,o=!!this._isRenderSubFieldLabel("style")&&this.getLabel("style",r),i=this.fieldClassNames("style");return c.a.createElement("div",{className:i,onMouseEnter:function(){return e._onMouseEnter("style")},onMouseLeave:function(){return e._onMouseLeave("style")}},o,n)}},{key:"_renderSubFieldFontLineColor",value:function(){var e=this;if(!this._isRenderSubField("line_color"))return!1;var t=this.getValue("underline"),n=this.getValue("line_through");if(!t&&!n)return!1;var r=this.getValue("line_color");if(this._isFilterActive()&&!r)return!1;var o=t?st.underline:st.strikethrough,i=a()(this.props.group_label)?o+" "+st.color:this.props.group_label+" "+o+" "+st.color,s=!!this._isRenderSubFieldLabel("line_color")&&this.getLabel("line_color",i),l=this.fieldClassNames("line_color",{"et-fb-option--color-alpha":!0});return c.a.createElement("div",{className:l,onMouseEnter:function(){return e._onMouseEnter("line_color")},onMouseLeave:function(){return e._onMouseLeave("line_color")}},s,c.a.createElement(M.a,ot({name:this.props.name+"_line_color",type:"color-alpha",value:r,animate:!0,_onChange:this.updateLineColor},this._extraProps())))}},{key:"_renderSubFieldFontLineStyle",value:function(){var e=this;if(!this._isRenderSubField("line_style"))return!1;var t=this.getValue("underline"),n=this.getValue("line_through");if(!t&&!n)return!1;var r=Ke()(this.getValue("line_style"))?"solid":this.getValue("line_style");if(this._isFilterActive()&&"solid"===r)return!1;var o=t?st.underline:st.strikethrough,i=a()(this.props.group_label)?o+" "+st.style:this.props.group_label+" "+o+" "+st.style,s=!!this._isRenderSubFieldLabel("line_style")&&this.getLabel("line_style",i),l=this.fieldClassNames("line_style");return c.a.createElement("div",{className:l,onMouseEnter:function(){return e._onMouseEnter("line_style")},onMouseLeave:function(){return e._onMouseLeave("line_style")}},s,c.a.createElement(Fe.a,ot({name:this.props.name+"_line_style",className:"et-fb-font-line-style-option",default:"solid",value:r,options:["solid","double","dotted","dashed","wavy"],__onChange:this.updateLineStyle},this._extraProps())))}},{key:"render",value:function(){var e=m()(at({"et-fb-settings-option-inner":!0,"et-fb-settings-option-inner--select-fontstyle":!0},"et-fb-settings-option-inner--"+this.props.name,!0));return c.a.createElement("div",{className:e},this._renderSubFieldFontFamily(),this._renderSubFieldFontWeight(),this._renderSubFieldFontStyle(),this._renderSubFieldFontLineColor(),this._renderSubFieldFontLineStyle())}}]),t}();pt.propTypes=ut;var ft=pt,ht=(n(1192),function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}());var gt=function(e){switch(e){case"justified":return"text-justify";case"force_left":return"left";default:return e}},mt=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.shouldComponentUpdate=h.a.shouldComponentUpdate.bind(n),n._onClick=n._onClick.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,c.a.Component),ht(t,[{key:"_render_buttons",value:function(e){var t=this,n=this.props.value,r=this;return rt()(e,function(e,i){var a=l()(["module_alignment","button_alignment"],me.a.getFieldBaseName(r.props.name))||"module_align"===o()(t,"props.options_icon",""),s=a?"align":"text",u="justified"===i?gt(i):s+"-"+gt(i),d=i===n,p=d?"#4191DE":"#bec9d6",f=a?12:14,h={"et-fb-settings-option-select-align-button":!0,"et-fb-settings-option-select-align-button--active":d};return h["et-fb-settings-option-select-align-button--"+i]=!0,c.a.createElement("button",{className:m()(h),key:r.props.name+"-select-align-option-"+i,onClick:r._onClick,"data-value":i},c.a.createElement(k.a,{icon:u,color:p,size:f}))})}},{key:"render",value:function(){var e={"et-fb-settings-option-select-align":!0};return this.props.className?e[this.props.className]=!0:e["et-fb-main-setting"]=!0,c.a.createElement("div",{id:"et-fb-"+this.props.name,className:m()(e)},this._render_buttons(this.props.options))}},{key:"_onClick",value:function(e){e.preventDefault();var t=this.props.name,n=e.target.getAttribute("data-value");n===o()(this,"props.value")&&(n=""),this.props._onChange(t,n)}}]),t}(),vt=n(217),bt=n(1193),yt=n(1049),_t=n(1196),kt=(n(1198),P()({displayName:"ETBuilderSelectAnimation",mixins:[h.a],render:function(){var e={none:ETBuilderBackend.i18n.controls.selectAnimation.none,fade:ETBuilderBackend.i18n.controls.selectAnimation.fade,slide:ETBuilderBackend.i18n.controls.selectAnimation.slide,bounce:ETBuilderBackend.i18n.controls.selectAnimation.bounce,zoom:ETBuilderBackend.i18n.controls.selectAnimation.zoom,flip:ETBuilderBackend.i18n.controls.selectAnimation.flip,fold:ETBuilderBackend.i18n.controls.selectAnimation.fold,roll:ETBuilderBackend.i18n.controls.selectAnimation.roll},t=Object.keys(e),n=this;return c.a.createElement("div",{className:"et_select_animation"},t.map(function(t,r){var i="";t===n.props.value&&(i="et_active_animation");var a="animation-"+t,s=o()(e,t,e.none);return c.a.createElement("div",{className:"et_animation_button",key:r},c.a.createElement("a",{href:"#",className:i,onClick:n._onClick.bind(n,t)},c.a.createElement("span",{className:"et_animation_button_title","data-value":t,key:r},s),c.a.createElement("span",{className:"et_animation_button_icon"},c.a.createElement(k.a,{icon:a}))))}))},_onClick:function(e,t){t.preventDefault(),this.props._onChange(this.props.name,e)}})),wt=(n(1199),Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}),Ct=n(31),St=n.n(Ct),Et=(n(1200),function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}());var Ot=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,x),Et(t,[{key:"renderContent",value:function(e){return St()(e,"content")?c.a.createElement("span",{className:this.classes.content},c.a.createElement("span",{className:o()(e,"class")},e.content)):null}}]),t}(),Tt=n(1060),xt=(n(1204),n(1094)),Mt=n.n(xt),Dt=n(693),Pt=n.n(Dt),Nt=n(47),Lt=n.n(Nt),Ft=n(184),At=n.n(Ft),jt=n(1072),It=n.n(jt),Rt=n(1095),Bt=n.n(Rt),Ht=n(851),Wt=n.n(Ht),Vt=n(1092),Gt=n.n(Vt),Ut=n(1054),zt=n(1068),qt=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Kt=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,u["Component"]),qt(t,[{key:"render",value:function(){var e=this.props,t=e.connectDropTarget,n=e.tagName,r=e.children,o=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["connectDropTarget","tagName","children"]);return t(Object(u.createElement)(n,o,r))}}]),t}();Kt.propTypes={tagName:p.a.string,connectDropTarget:p.a.func.isRequired},Kt.defaultProps={tagName:"div"};var $t=Kt,Xt=n(1205),Yt=(n(1206),function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}());var Jt=function(e){function t(e){var n=e.type;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return r.defineContainer(n),r.defineItem(n),r.renderItem=r.renderItem.bind(r),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,u["Component"]),Yt(t,[{key:"defineContainer",value:function(e){var t=Object(Ut.DropTarget)(e,{drop:function(){}},function(e){return{connectDropTarget:e.dropTarget()}});this.Container=t($t)}},{key:"defineItem",value:function(e){var t=Object(Ut.DragSource)(e,{beginDrag:function(e){return{id:e.id,originalIndex:e.find(e.id).index}},endDrag:function(e,t){var n=t.getItem(),r=n.id,o=n.originalIndex;t.didDrop()||e.move(r,o)}},function(e,t){return{connectDragSource:e.dragSource(),isDragging:t.isDragging()}}),n=Object(Ut.DropTarget)(e,{canDrop:function(){return!1},hover:function(e,t){var n=t.getItem().id,r=e.id;if(n!==r){var o=e.find(r).index;e.move(n,o)}}},function(e){return{connectDropTarget:e.dropTarget()}});this.Item=n(t(Xt.a))}},{key:"getType",value:function(){return this.props.type}},{key:"getContainer",value:function(){return this.Container}},{key:"getItem",value:function(){return this.Item}},{key:"renderItem",value:function(e){var t=this.getItem();return!1===e.props.draggable?e:c.a.createElement(t,{id:e.props.id,key:e.props.id,find:this.props.find,move:this.props.move},e)}},{key:"render",value:function(){var e=this.getContainer(),t=this.props,n=(t.type,t.find,t.move,function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(t,["type","find","move"]));return c.a.createElement(zt.a,null,c.a.createElement(e,n,this.props.children.map(this.renderItem)))}}]),t}();Jt.propTypes={tagName:p.a.string,move:p.a.func.isRequired,find:p.a.func.isRequired,type:p.a.string.isRequired};var Qt=Jt,Zt=n(89),en=n.n(Zt),tn={jpg:"image/jpeg",jpeg:"image/jpeg",jpe:"image/jpeg",gif:"image/gif",png:"image/png",bmp:"image/bmp",tif:"image/tiff",tiff:"image/tiff",ico:"image/x-icon",asf:"video/x-ms-asf",asx:"video/x-ms-asf",wmv:"video/x-ms-wmv",wmx:"video/x-ms-wmx",wm:"video/x-ms-wm",avi:"video/avi",divx:"video/divx",flv:"video/x-flv",mov:"video/quicktime",qt:"video/quicktime",mpeg:"video/mpeg",mpg:"video/mpeg",mpe:"video/mpeg",mp4:"video/mp4",m4v:"video/mp4",ogv:"video/ogg",webm:"video/webm",mkv:"video/x-matroska",txt:"text/plain",asc:"text/plain",c:"text/plain",cc:"text/plain",h:"text/plain",csv:"text/csv",tsv:"text/tab-separated-values",ics:"text/calendar",rtx:"text/richtext",css:"text/css",htm:"text/html",html:"text/html",mp3:"audio/mpeg",m4a:"audio/mpeg",m4b:"audio/mpeg",ra:"audio/x-realaudio",ram:"audio/x-realaudio",wav:"audio/wav",ogg:"audio/ogg",oga:"audio/ogg",mid:"audio/midi",midi:"audio/midi",wma:"audio/x-ms-wma",wax:"audio/x-ms-wax",mka:"audio/x-matroska",rtf:"application/rtf",js:"application/javascript",pdf:"application/pdf",swf:"application/x-shockwave-flash",class:"application/java",tar:"application/x-tar",zip:"application/zip",gzip:"application/x-gzip",gz:"application/x-gzip",rar:"application/rar","7z":"application/x-7z-compressed",exe:"application/x-msdownload",doc:"application/msword",ppt:"application/vnd.ms-powerpoint",pps:"application/vnd.ms-powerpoint",pot:"application/vnd.ms-powerpoint",wri:"application/vnd.ms-write",xla:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlt:"application/vnd.ms-excel",xlw:"application/vnd.ms-excel",mdb:"application/vnd.ms-access",mpp:"application/vnd.ms-project",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",docm:"application/vnd.ms-word.document.macroEnabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",dotm:"application/vnd.ms-word.template.macroEnabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlsm:"application/vnd.ms-excel.sheet.macroEnabled.12",xlsb:"application/vnd.ms-excel.sheet.binary.macroEnabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xltm:"application/vnd.ms-excel.template.macroEnabled.12",xlam:"application/vnd.ms-excel.addin.macroEnabled.12",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",pptm:"application/vnd.ms-powerpoint.presentation.macroEnabled.12",ppsx:"application/vnd.openxmlformats-officedocument.presentationml.slideshow",ppsm:"application/vnd.ms-powerpoint.slideshow.macroEnabled.12",potx:"application/vnd.openxmlformats-officedocument.presentationml.template",potm:"application/vnd.ms-powerpoint.template.macroEnabled.12",ppam:"application/vnd.ms-powerpoint.addin.macroEnabled.12",sldx:"application/vnd.openxmlformats-officedocument.presentationml.slide",sldm:"application/vnd.ms-powerpoint.slide.macroEnabled.12",onetoc:"application/onenote",onetoc2:"application/onenote",onetmp:"application/onenote",onepkg:"application/onenote",odt:"application/vnd.oasis.opendocument.text",odp:"application/vnd.oasis.opendocument.presentation",ods:"application/vnd.oasis.opendocument.spreadsheet",odg:"application/vnd.oasis.opendocument.graphics",odc:"application/vnd.oasis.opendocument.chart",odb:"application/vnd.oasis.opendocument.database",odf:"application/vnd.oasis.opendocument.formula",wp:"application/wordperfect",wpd:"application/wordperfect",key:"application/vnd.apple.keynote",numbers:"application/vnd.apple.numbers",pages:"application/vnd.apple.pages"},nn=function(e){switch(e){case"image":return rn();case"video":return on();case"text":return an();case"audio":return sn();default:return en()(tn,[e])}},rn=function(e){return en()(tn,["jpg","jpeg","jpe","gif","png","bmp","tif","tiff","ico"])},on=function(e){return en()(tn,["asf","asx","wmv","wmx","wm","avi","divx","flv","mov","qt","mpeg","mpg","mpe","mp4","m4v","ogv","webm","mkv"])},an=function(e){return en()(tn,["txt","asc","c","cc","h","csv","tsv","ics","rtx","css","htm","html"])},sn=function(e){return en()(tn,["mp3","m4a","m4b","ra","ram","wav","ogg","oga","mid","midi","wma","wax","mka"])},ln={multiple:!1,mimeTypes:"image",selected:[]},un=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ln,t=pe.default.topWindow().wp.media({library:{type:nn(e.mimeTypes)},multiple:!!e.multiple&&"add"});return t.on("open",function(){var n=t.state().get("selection");e.selected.map(function(e){return n.add(pe.default.topWindow().wp.media.attachment(e))})}),t.open(),new Promise(function(e){return t.on("select",function(n){return e(t.state().get("selection").map(Pt()("attributes")))})})},cn=n(1096),dn=n(218),pn=n(16),fn=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var hn=function(e){return Object(cn.a)(e).then(Pt()("guid"))},gn=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.state={url:null,active:!1},e.setUrl=e.setUrl.bind(e),e.onMouseOver=e.onMouseOver.bind(e),e.onMouseLeave=e.onMouseLeave.bind(e),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,u["Component"]),fn(t,[{key:"onMouseOver",value:function(){this.setState({active:!0})}},{key:"onMouseLeave",value:function(){this.setState({active:!1})}},{key:"componentDidMount",value:function(){hn(this.props.id).then(this.setUrl)}},{key:"componentWillReceiveProps",value:function(e){var t=e.id;this.props.id!==t&&hn(t).then(this.setUrl)}},{key:"setUrl",value:function(e){this.setState({url:e})}},{key:"renderDelete",value:function(){var e=this,t={opacity:this.state.active?Object(pn.spring)(1,{stiffness:300,damping:20}):Object(pn.spring)(0,{stiffness:300,damping:20}),scale:this.state.active?Object(pn.spring)(1,{stiffness:300,damping:20}):Object(pn.spring)(0,{stiffness:300,damping:20}),top:this.state.active?Object(pn.spring)(5,{stiffness:300,damping:20}):Object(pn.spring)(-10,{stiffness:300,damping:20}),right:this.state.active?Object(pn.spring)(5,{stiffness:300,damping:20}):Object(pn.spring)(-10,{stiffness:300,damping:20})};return c.a.createElement(pn.Motion,{style:t},function(t){return c.a.createElement("button",{className:"et-fb-control-images-upload--item-delete",onClick:e.props.onRemove,style:{opacity:t.opacity,transform:"scale( "+t.scale+" )",top:t.top}},c.a.createElement(k.a,{icon:"delete",color:"#fff"}))})}},{key:"renderLoading",value:function(){return c.a.createElement("div",{className:"et-fb-control-images-upload--item-wrapper loading"},c.a.createElement("div",{className:"et-fb-control-images-upload--item",onMouseOver:this.onMouseOver,onMouseOut:this.onMouseLeave},c.a.createElement(dn.a,{isLoading:!0})),!this.props.readonly&&this.renderDelete())}},{key:"renderAttachment",value:function(){return c.a.createElement("div",{className:"et-fb-control-images-upload--item-wrapper"},c.a.createElement("div",{className:"et-fb-control-images-upload--item",style:{backgroundImage:"url("+this.state.url+")"},onMouseOver:this.onMouseOver,onMouseOut:this.onMouseLeave},!this.props.readonly&&this.renderDelete()))}},{key:"render",value:function(){return Ke()(this.state.url)?this.renderLoading():this.renderAttachment()}}]),t}();gn.propTypes={id:p.a.number,onRemove:p.a.func};var mn=gn,vn=(n(1209),function(e){var t=e.onClick,n=e.title;return!e.readonly&&c.a.createElement("div",{className:"et-fb-add-media",onClick:t},c.a.createElement("div",{className:"et-fb-add-media--container"},c.a.createElement("div",{className:"et-fb-add-media--button"},c.a.createElement(k.a,{icon:"add",color:"#fff"})),c.a.createElement("label",{className:"et-fb-add-media--title et-fb-form__label"},n)))}),bn=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function yn(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var _n=Z()(Mt()(Bt()(isNaN)),It()(parseInt),ie()(","),Xe.a),kn=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.getValue=e.getValue.bind(e),e.updateValue=e.updateValue.bind(e),e.onRemove=Z()(e.onRemove.bind(e),parseInt),e.onClick=e.onClick.bind(e),e.find=e.find.bind(e),e.move=e.move.bind(e),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,u["Component"]),bn(t,[{key:"componentWillMount",value:function(){Object(cn.b)(this.getValue())}},{key:"componentWillReceiveProps",value:function(e){var t=e.value;Object(cn.b)(_n(t))}},{key:"updateValue",value:function(e){this.props._onChange(this.props.name,Gt()(",",e),this.props.type)}},{key:"onClick",value:function(){var e=this;un({multiple:!0,selected:this.getValue()}).then(It()(Pt()("id"))).then(function(t){return Lt()(e.getValue(),t)}).then(this.updateValue)}},{key:"onRemove",value:function(e){this.updateValue(Mt()(Bt()(Wt()(e)),this.getValue()))}},{key:"getValue",value:function(){return _n(this.props.value)}},{key:"move",value:function(e,t){var n=this.find(e).attachment,r=this.getValue().filter(Bt()(Wt()(e)));this.updateValue([].concat(yn(r.slice(0,t)),[n],yn(r.slice(t))))}},{key:"find",value:function(e){return{attachment:this.getValue().find(Wt()(e)),index:At()(this.getValue(),Wt()(e))}}},{key:"renderItems",value:function(){var e=this;return[].concat(yn(this.getValue().map(function(t){return c.a.createElement(mn,{key:t,id:t,onRemove:function(){return e.onRemove(t)},readOnly:e.props.readonly})})),[c.a.createElement(vn,{key:-1,draggable:!1,onClick:this.onClick,title:ETBuilderBackend.i18n.controls.uploadGallery.addImages,readOnly:this.props.readonly})])}},{key:"render",value:function(){return c.a.createElement(Qt,{className:"et-fb-control-images-upload",type:"image-upload",move:this.move,find:this.find},this.renderItems())}}]),t}();kn.propTypes={value:p.a.string};var wn=kn,Cn=n(52),Sn=n.n(Cn),En=n(48),On=n.n(En),Tn=n(44),xn=n.n(Tn),Mn=n(35),Dn=(n(1210),function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}());var Pn=o()(Object(pe.topWindow)(),"google.maps",!1),Nn=Pn&&new Pn.Geocoder,Ln=m()({"et-fb-settings-option-inner":!0,"et-fb-settings-option-inner-center-map":!0}),Fn=m()({"et-fb-settings-button--center-map-update":!0,"et-fb-settings-button--additional-button":!0}),An=Pn?{url:ETBuilderBackend.images_uri+"/marker.png",size:new Pn.Size(46,43),anchor:new Pn.Point(16,43)}:{},jn={coord:[1,1,46,43],type:"rect"},In=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},Rn=function(e,t){return new Pn.LatLng(In(e)?parseFloat(e):0,In(t)?parseFloat(t):0)},Bn=function(e){o()(window,"alert",On.a)(e)},Hn=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={updateMapSize:!1,contentUpdate:!1},n.isUpdating=!1,n.forceCenter=!0,n.markers=[],n.onClick=n.onClick.bind(n),n.updateMap=n.updateMap.bind(n),n.geoCodeCallback=n.geoCodeCallback.bind(n),n.geoCodePinCallback=n.geoCodePinCallback.bind(n),n.zoomChanged=n.zoomChanged.bind(n),n.centerChanged=n.centerChanged.bind(n),n.dragEnd=n.dragEnd.bind(n),n.handleContentChange=n.handleContentChange.bind(n),n.handleMapWidthChange=n.handleMapWidthChange.bind(n),n.debouncedCenterChanged=xn()(n.centerChanged,500),n.debouncedUpdateMap=xn()(n.updateMap,200),n.debouncedWidthChange=xn()(n.handleMapWidthChange,500),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,c.a.Component),Dn(t,[{key:"componentDidMount",value:function(){Pn&&(E.a.addSettingsModalResizeListener(this.debouncedWidthChange),E.a.addChangeListener(this.debouncedWidthChange),E.a.addModuleItemsActionsListener(this.handleContentChange),this.wasModuleItemSettings=this.isModuleItemSettings(),this.createMap(),this.debouncedUpdateMap())}},{key:"componentDidUpdate",value:function(){if(Pn){var e=this.isModuleItemSettings();e&&!this.wasModuleItemSettings&&(this.forceCenter=!0),e!==this.wasModuleItemSettings&&this.removeMarkers(),this.wasModuleItemSettings=e,this.debouncedUpdateMap()}}},{key:"componentWillUnmount",value:function(){Pn&&Pn.event.clearInstanceListeners(this.map),this.debouncedUpdateMap.flush(),this.debouncedCenterChanged.cancel(),this.debouncedWidthChange.cancel(),E.a.removeSettingsModalResizeListener(this.debouncedWidthChange),E.a.removeChangeListener(this.debouncedWidthChange),E.a.removeModuleItemsActionsListener(this.handleContentChange)}},{key:"onClick",value:function(){this.geoCodeAddress()}},{key:"getModuleAttributeName",value:function(e){return this.isModuleItemSettings()&&"zoom_level"!==e?"pin_"+e:e}},{key:"getModuleAttributeValue",value:function(e){var t=this.getModuleAttributeName(e),n=o()(this.getModule(),"props.attrs."+t);return o()(this.props,t,n)}},{key:"getAddress",value:function(){return z()(this.getModuleAttributeValue("address"))}},{key:"getModule",value:function(){return o()(this,"props.module.props.module")}},{key:"moduleSettingsChange",value:function(e,t){var n=o()(this.props,"disableAction",!1),r=o()(this.props,"_onChange");n&&Sn()(r)?r(e,t):this.props.isItemSelected?fe.b.multiSelectSettingsChange(this.getModule(),e,t):fe.b.moduleSettingsChange(this.getModule(),e,t)}},{key:"geoCodeAddress",value:function(){var e=this.getAddress();e.length<=0||!1===Nn||Nn.geocode({address:e},this.geoCodeCallback)}},{key:"geoCodePinCallback",value:function(e,t){t===Pn.GeocoderStatus.OK?e[0]?(this.forceCenter=!0,this.moduleSettingsChange(this.getModuleAttributeName("address"),e[0].formatted_address)):Bn(ETBuilderBackend.i18n.controls.centerMap.noResults):Bn(ETBuilderBackend.i18n.controls.centerMap.geoCodeError_2+": "+t)}},{key:"geoCodeCallback",value:function(e,t){if(t===Pn.GeocoderStatus.OK){var n=this.getAddress(),r=e[0],o=r.geometry.location,i=function(e){var t=e.split(","),n=!!a()(t[0])&&parseFloat(t[0]),r=!!a()(t[1])&&parseFloat(t[1]);return!(!n||isNaN(n)||!r||isNaN(r))&&Rn(n,r)}(n);i&&(o=i),isNaN(o.lat())||isNaN(o.lng())?Bn(ETBuilderBackend.i18n.controls.centerMap.mapPinAddressInvalid):(this.moduleSettingsChange(this.getModuleAttributeName("address"),r.formatted_address),this.moduleSettingsChange(this.getModuleAttributeName("address_lat"),o.lat()),this.moduleSettingsChange(this.getModuleAttributeName("address_lng"),o.lng()),this.removeMarkers(),this.forceCenter=!0)}else Bn(ETBuilderBackend.i18n.controls.centerMap.geoCodeError+": "+t)}},{key:"isModuleItemSettings",value:function(){return!a()(o()(this,"props.module.props.module.isModuleItem"))}},{key:"handleContentChange",value:function(){this.removeMarkers()}},{key:"handleMapWidthChange",value:function(){this.map&&(Pn.event.trigger(this.map,"resize"),this.updateMap())}},{key:"allowEvent",value:function(){return!this.isUpdating&&!this.props.readonly}},{key:"zoomChanged",value:function(){this.allowEvent()&&this.moduleSettingsChange("zoom_level",this.map.getZoom())}},{key:"centerChanged",value:function(){if(this.allowEvent()&&!this.isModuleItemSettings()){var e=this.map.getCenter(),t=e.lat(),n=e.lng(),r=this.getModuleAttributeValue("address_lat"),o=this.getModuleAttributeValue("address_lng");t!==r&&this.moduleSettingsChange("address_lat",t),n!==o&&this.moduleSettingsChange("address_lng",n)}}},{key:"dragEnd",value:function(){if(this.allowEvent()){var e=this.markers[0].getPosition();this.moduleSettingsChange(this.getModuleAttributeName("address_lat"),e.lat()),this.moduleSettingsChange(this.getModuleAttributeName("address_lng"),e.lng());var t=Rn(e.lat(),e.lng());Nn.geocode({latLng:t},this.geoCodePinCallback)}}},{key:"createMap",value:function(){Pn&&(this.map=new Pn.Map(this.mapContainer,{gestureHandling:"cooperative",mapTypeId:Pn.MapTypeId.ROADMAP,zoomControl:!this.props.readonly,mapTypeControl:!this.props.readonly,scaleControl:!this.props.readonly,streetViewControl:!this.props.readonly,fullscreenControl:!this.props.readonly,scrollwheel:!this.props.readonly,draggable:!this.props.readonly,disableDoubleClickZoom:this.props.readonly}),this.props.readonly||(this.map.addListener("zoom_changed",this.zoomChanged),this.map.addListener("dragend",this.debouncedCenterChanged)))}},{key:"removeMarkers",value:function(){rt()(this.markers,function(e){B()(e)&&e.setMap(null)}),this.markers=[]}},{key:"addMarkers",value:function(){var e=this,t=this.getModule(),n=o()(t,"props.content"),r=this.getModuleAttributeValue("address_lat"),i=this.getModuleAttributeValue("address_lng");if(Ke()(n)||!A()(n)){if(this.isModuleItemSettings()){var s=new Pn.Marker({map:this.map,position:Rn(r,i),draggable:!this.props.readonly,icon:An,shape:jn});s.addListener("dragend",this.dragEnd),this.markers=[s]}}else A()(n)&&(this.markers=rt()(n,function(t){return!a()(t)&&new Pn.Marker({map:e.map,position:Rn(t.attrs.pin_address_lat,t.attrs.pin_address_lng),icon:An,shape:jn})}))}},{key:"updateMap",value:function(){var e=this.getModuleAttributeValue("address_lat"),t=this.getModuleAttributeValue("address_lng"),n=function(e){return In(e)?parseInt(e,10):10}(this.getModuleAttributeValue("zoom_level"));this.isUpdating=!0,n&&this.map.setZoom(n),this.isModuleItemSettings()&&!this.forceCenter||(this.map.setCenter(Rn(e,t)),this.forceCenter=!1),Ke()(this.markers)&&this.addMarkers(),this.isUpdating=!1}},{key:"render",value:function(){var e=this,t=!this.props.readonly&&!this.props.hideUpdateButton&&c.a.createElement(Mn.a,{className:Fn,_onClick:this.onClick,inverse:!0},ETBuilderBackend.i18n.controls.centerMap.updateMapButtonText);return c.a.createElement("div",{className:Ln},t,c.a.createElement("div",{className:"et-fb-settings-option-center-map",ref:function(t){e.mapContainer=t}}))}}]),t}(),Wn=n(1211),Vn=n(138),Gn=n.n(Vn),Un=(n(219),n(259)),zn=n(692),qn=n(1053),Kn=n(24),$n=(n(1073),function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}());var Xn={color:M.a,"color-alpha":M.a,number:vt.a,range:Me.a,select:Fe.a,text:vt.a,upload:Tt.a,yes_no_button:yt.a},Yn=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n._onTabMouseEnter=function(e){var t=n.props.onMouseEnterGroup;if(t){var r=e.target.getAttribute("data-tab"),i=o()(ETBuilderBackend.i18n.controls.background,r,void 0);t(n.props.name,i,"background-"+r,n.props.toggle_slug,n.props.tab_slug)}},n._onTabMouseLeave=function(){var e=n.props.onMouseLeaveGroup;e&&e(!1,"")},n.state={activeTab:null,isPreviewHover:!1,imagePreviewAttrs:n._getImagePreviewAttrs()},n.fieldsStructure={color:[n._getFieldName("background_color"),"use_background_color"],gradient:[n._getFieldName("background_color_gradient_start"),n._getFieldName("background_color_gradient_end"),n._getFieldName("use_background_color_gradient"),n._getFieldName("background_color_gradient_type"),n._getFieldName("background_color_gradient_direction"),n._getFieldName("background_color_gradient_direction_radial"),n._getFieldName("background_color_gradient_start_position"),n._getFieldName("background_color_gradient_end_position"),n._getFieldName("background_color_gradient_overlays_image")],image:[n.props.isColumnBackground?n._getFieldName("bg_img"):"background_image","background_url",n._getFieldName("parallax"),n._getFieldName("parallax_method"),n._getFieldName("background_size"),n._getFieldName("background_position"),n._getFieldName("background_repeat"),n._getFieldName("background_blend")],video:[n._getFieldName("background_video_mp4"),n._getFieldName("background_video_webm"),n._getFieldName("background_video_width"),n._getFieldName("background_video_height"),n._getFieldName("allow_player_pause"),n._getFieldName("background_video_pause_outside_viewport")]},n.fieldsNames=n._getFieldsNames(),n.tabNames=n._getTabNames(),n.shouldComponentUpdate=h.a.shouldComponentUpdate.bind(n),n._onSwitchTab=n._onSwitchTab.bind(n),n._onToggleGradient=n._onToggleGradient.bind(n),n._onToggleFirstGradientColorpicker=n._onToggleFirstGradientColorpicker.bind(n),n._onSwapGradientColor=n._onSwapGradientColor.bind(n),n._onChange=n._onChange.bind(n),n._onPreviewMouseEnter=n._onPreviewMouseEnter.bind(n),n._onPreviewMouseLeave=n._onPreviewMouseLeave.bind(n),n._getImagePreviewAttrs=n._getImagePreviewAttrs.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,u["Component"]),$n(t,[{key:"componentDidUpdate",value:function(){this.props.activeHover&&this.props.isHoverTab&&"color"!==this.state.activeTab&&this.setState({activeTab:"color"})}},{key:"componentDidMount",value:function(){this.setState({activeTab:this.props.activeTab||this._getActiveTab()})}},{key:"_getFieldName",value:function(e){return this.props.isColumnBackground?e+"_"+this.props.columnIndex:e}},{key:"_getFieldsNames",value:function(){return rt()(this.props.backgroundFields,function(e){return e.name})}},{key:"_getTabNames",value:function(){var e=this,t={};return _()(this.fieldsStructure,function(n,r){_()(n,function(n){a()(t[r])&&e._isFieldExist(n)&&(t[r]=r)})}),Gn()(t)}},{key:"_getActiveTab",value:function(){var e=this;if(this.state.activeTab&&(!this._isFilterActive()||this._isFilterActive()&&this._renderTabFields(this.state.activeTab)))return this.state.activeTab;var t="color",n=tt()(this.fieldsStructure);return _()(n,function(n){(e._isFilterActive()?e._renderTabFields(n):e._isTabFilled(n))&&(t=n)}),t}},{key:"_getAttrs",value:function(e,t){this.props.isColumnBackground&&(e=e+"_"+this.props.columnIndex);var n=a()(e)?o()(this,"props.module.props.module.props.attrs",{}):o()(this,"props.module.props.module.props.attrs."+e);return!a()(e)&&t&&a()(n)&&(n=this._getDefault(e)),n}},{key:"_getDefault",value:function(e){return this.props.isColumnBackground&&(e=e+"_"+this.props.columnIndex),o()(this,"props.backgroundFields."+e+".default","")}},{key:"_getImagePreviewAttrs",value:function(){var e=this._getFieldName("background_color"),t=this._getAttrs(e),n=this._getAttrs("background_size"),r=this._getAttrs("background_position"),o=this._getAttrs("background_repeat"),i=this._getAttrs("background_blend"),a=this._getAttrs("parallax"),s=!!pe.default.isOn(this._getAttrs("use_background_color_gradient"))&&pe.default.getGradient({type:this._getAttrs("background_color_gradient_type"),direction:this._getAttrs("background_color_gradient_direction"),radialDirection:this._getAttrs("background_color_gradient_direction_radial"),colorStart:this._getAttrs("background_color_gradient_start"),colorEnd:this._getAttrs("background_color_gradient_end"),startPosition:this._getAttrs("background_color_gradient_start_position"),endPosition:this._getAttrs("background_color_gradient_end_position")}),l=this._getAttrs("background_color_gradient_overlays_image");return{color:pe.default.hasValue(t)?t:this._getDefault(e),size:pe.default.hasValue(n)?n:this._getDefault("background_size"),position:pe.default.hasValue(r)?r:this._getDefault("background_position"),repeat:pe.default.hasValue(o)?o:this._getDefault("background_repeat"),blend:pe.default.hasValue(i)?i:this._getDefault("background_blend"),parallax:pe.default.isOn(a),gradient:s,gradientOverlaysImage:l}}},{key:"_isFieldExist",value:function(e){return l()(this.fieldsNames,e)}},{key:"_isVisible",value:function(e,t){var n=this,r=this,i=this.props.module,s=[];return _()(e.depends_on,function(l){if(o()(t[l],"depends_on",!1)&&!n._isVisible(t[l],t))return!1;var u=o()(i,"props.module.props.attrs."+l)||o()(r,"props.backgroundFields."+l+".default");a()(e.depends_show_if)||u!==e.depends_show_if||s.push(l),a()(e.depends_show_if_not)||u===e.depends_show_if_not||s.push(l)}),!Ke()(s)}},{key:"_isTabFilled",value:function(e){var t=!1;switch(e){case"color":t=pe.default.hasValue(this._getAttrs("background_color"));break;case"gradient":pe.default.isOn(this._getAttrs("use_background_color_gradient"))&&(t=!0);break;case"image":(pe.default.hasValue(this._getAttrs("bg_img"))||pe.default.hasValue(this._getAttrs("background_image"))||pe.default.hasValue(this._getAttrs("background_url")))&&(t=!0);break;case"video":(pe.default.hasValue(this._getAttrs("background_video_mp4"))||pe.default.hasValue(this._getAttrs("background_video_webm")))&&(t=!0)}return t}},{key:"_isFilterActive",value:function(){return l()(["styles_modified","active_content"],this.props.filterSelected)}},{key:"_onSwitchTab",value:function(e){e.preventDefault(),this.setState({activeTab:e.target.getAttribute("data-tab")})}},{key:"_onToggleGradient",value:function(e){if(e.preventDefault(),e.stopPropagation(),!this.props.readonly){var t=this._getAttrs("use_background_color_gradient"),n=this._getAttrs("background_color_gradient_start"),r=this._getAttrs("background_color_gradient_end"),o=pe.default.isOn(t)?"off":"on";this._onChange(this._getFieldName("use_background_color_gradient"),o),!pe.default.isOn(o)||pe.default.hasValue(n)||pe.default.hasValue(r)||(this._onChange(this._getFieldName("background_color_gradient_start"),"#2b87da"),this._onChange(this._getFieldName("background_color_gradient_end"),"#29c4a9"))}}},{key:"_onToggleFirstGradientColorpicker",value:function(e){if(e.preventDefault(),e.stopPropagation(),!this.props.readonly){var t=pe.default.$appWindow(Ee.a.findDOMNode(this)),n=a()(this.props.columnIndex)?"":"_"+this.props.columnIndex,r=t.find(".et-fb-form__group--background_color_gradient_start"+n+" .wp-color-picker");r.wpColorPicker("open",!0),pe.default.$topDocument().on("click.etClickOutsideColorpicker",function(){r.wpColorPicker("close")})}}},{key:"_onSwapGradientColor",value:function(e){if(e.preventDefault(),e.stopPropagation(),!this.props.readonly){var t=this._getAttrs("background_color_gradient_start",!0),n=this._getAttrs("background_color_gradient_end",!0);this._onChange(this._getFieldName("background_color_gradient_start"),n),this._onChange(this._getFieldName("background_color_gradient_end"),t)}}},{key:"_onChange",value:function(e,t,n,r){if(!this.props.readonly){this.props._onChange(e,t,n,r),this.forceUpdate();var o=Lt()([this._getFieldName("background_color"),this._getFieldName("parallax")],this.fieldsStructure.gradient,this.fieldsStructure.image);l()(o),e&&this.setState({imagePreviewAttrs:this._getImagePreviewAttrs()})}}},{key:"_onPreviewMouseEnter",value:function(){this.setState({isPreviewHover:!0});var e=this.props.onMouseEnterGroup;if(e){var t=ETBuilderBackend.i18n.controls.background.gradientColors;e(this.props.name,t,"background-gradient",this.props.toggle_slug,this.props.tab_slug)}}},{key:"_onPreviewMouseLeave",value:function(){this.setState({isPreviewHover:!1});var e=this.props.onMouseLeaveGroup;e&&e(!1,"")}},{key:"_renderGradientPreview",value:function(){var e=this,t=pe.default.isOn(this._getAttrs("use_background_color_gradient")),n=t?{backgroundImage:pe.default.getGradient({type:this._getAttrs("background_color_gradient_type"),direction:this._getAttrs("background_color_gradient_direction"),radialDirection:this._getAttrs("background_color_gradient_direction_radial"),colorStart:this._getAttrs("background_color_gradient_start"),colorEnd:this._getAttrs("background_color_gradient_end"),startPosition:this._getAttrs("background_color_gradient_start_position"),endPosition:this._getAttrs("background_color_gradient_end_position")}),marginBottom:"70px"}:{},r={opacity:this.state.isPreviewHover?Object(pn.spring)(1,{stiffness:300,damping:20}):Object(pn.spring)(0,{stiffness:300,damping:20}),scale:this.state.isPreviewHover?Object(pn.spring)(1,{stiffness:300,damping:20}):Object(pn.spring)(0,{stiffness:300,damping:20}),top:this.state.isPreviewHover?Object(pn.spring)(20,{stiffness:300,damping:20}):Object(pn.spring)(-10,{stiffness:300,damping:20})},o=t?"":c.a.createElement(zn.a,{title:ETBuilderBackend.i18n.controls.background.addGradient,className:"et-fb-button et-fb-settings-option-add",onClick:this._onToggleGradient}),i=t?c.a.createElement(pn.Motion,{style:r},function(t){return c.a.createElement("button",{className:"et-fb-button et-fb-settings-option-remove",onClick:e._onToggleGradient,style:{opacity:t.opacity,transform:"scale( "+t.scale+" )",top:t.top}},c.a.createElement(k.a,{icon:"delete",color:"#fff"}))}):"",a=t?c.a.createElement(pn.Motion,{style:r},function(t){return c.a.createElement("button",{className:"et-fb-button et-fb-settings-option-swap",onClick:e._onSwapGradientColor,style:{opacity:t.opacity,transform:"scale( "+t.scale+" )",top:t.top}},c.a.createElement(k.a,{icon:"swap",color:"#fff"}))}):"";return c.a.createElement("div",{className:"et-fb-settings-option-color--previewable",ref:"previewContainer"},c.a.createElement("div",{className:m()({"et-fb-settings-option-preview":!0,"et-fb-settings-option-preview--empty":!t}),style:n,onClick:t?this._onToggleFirstGradientColorpicker:this._onToggleGradient,onMouseEnter:this._onPreviewMouseEnter,onMouseLeave:this._onPreviewMouseLeave},o,i,a))}},{key:"_renderTabNavs",value:function(){var e=this,t="et-fb-settings-background-tab-nav",n=this._getActiveTab(),r=o()(this,"props.name","background"),i=me.a.isEnabled("module.props.module.props.attrs."+r,this.props),a=!0===E.a.getHoverMode(),s=this._onSwitchTab,l=!1,u=rt()(this.tabNames,function(r){var o=t+"--"+r,u=[t,o];i&&a&&"color"!==r&&(u.push(t+"--disabled"),s=function(e){e.preventDefault()});var d=n===r||e._isTabFilled(r)?ze.a.info:ze.a.inactiveGrey;return!(e._isFilterActive()&&!e._renderTabFields(r))&&(n===r&&u.push(t+"--active"),l=!0,c.a.createElement("li",{key:o},c.a.createElement("button",{className:m()(u),"data-tab":r,onClick:s,name:r,onMouseEnter:e._onTabMouseEnter,onMouseLeave:e._onTabMouseLeave},c.a.createElement(k.a,{icon:"background-"+r,color:d}))))});return!!l&&u}},{key:"_renderTabs",value:function(){var e=this,t=this,n=this._getActiveTab(),r=!1,o=rt()(this.tabNames,function(o){var i="et-fb-settings-background-tab--"+o,a=["et-fb-settings-background-tab",i],s="gradient"===o?t._renderGradientPreview():"";o===n&&a.push("et-fb-settings-background-tab--active");var l=e._renderTabFields(o);return!(e._isFilterActive()&&!l)&&(r=!0,c.a.createElement("div",{className:m()(a),key:i},s,l))});return!!r&&o}},{key:"_renderTabFields",value:function(e){var t=this,n=this.props.backgroundFields,r=o()(this,"props.module.props.module.props.attrs"),i=o()(this.props,"name","background"),s=o()(this,"props.module.props.module.props.attrs",{}),d=[],p=!1,f=rt()(this.fieldsStructure[e],function(f){var h=n[f];if(a()(h))return!1;var g=!0===E.a.getHoverMode(),v="use_background_color"===f?f:me.a.getCompositeFieldOnHover(f,i,r),b=h.type,y=pe.default.get(s[v],function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return g?pe.default.get(s[e.replace(me.a.hoverSuffix(),"")],h.default):h.default}(v)),_=!pe.default.hasValue(s[v])||s[v]===h.default;if(!t._isFieldExist(f))return!1;if("skip"===h.type)return!1;if("warning"===h.type&&h.display_if!==h.value)return!1;if(a()(Xn[b]))return!1;if(!a()(h.depends_on)&&!t._isVisible(h,n))return d.push(h.name),!1;if(!a()(h.depends_on)&&I()(h.depends_on,Je()(h.depends_on,d)))return!1;if(t._isFilterActive()){if(_)return!1;if(!a()(h.name)&&!l()(["background_color","use_background_color_gradient","bg_img","background_image","background_url","background_video_mp4","background_video_webm"],h.name)&&!t._isTabFilled(e))return!1}p=!0;var k=m()(["et-fb-settings-options","et-fb-option--"+b.replace("_","-")]);a()(h.depends_default)&&a()(h.depends_show_if)&&a()(h.depends_show_if_not)||(k=m()("et-fb-option--depends-on",k));var w=!a()(h.description)&&""!==h.description,C="";switch(b){case"color":case"color-alpha":C=ETBuilderBackend.i18n.controls.background.addColor;break;case"upload":C="video"===h.data_type?ETBuilderBackend.i18n.controls.background.addVideo:ETBuilderBackend.i18n.controls.background.addImage}var S=a()(h.label)||""===h.label?"":c.a.createElement(Un.c,{name:h.name,activeHelp:t.props.isDescriptionVisible(h.name),hoveredGroup:t.props.isHoveredGroup(h.name),key:"general-form-label-"+f,onClickHelp:!!w&&t.props.onClickHelp},h.label),O=w?c.a.createElement(Un.a,{active:t.props.isDescriptionVisible(h.name),key:"general-form-description-"+f},h.description):"",T=!(!l()(["color","color-alpha","upload"],b)||l()([t._getFieldName("background_color_gradient_start"),t._getFieldName("background_color_gradient_end")],h.name)),x=l()([t._getFieldName("bg_img"),"background_image","background_url"],f)?t.state.imagePreviewAttrs:void 0,M=o()(h,"data_type",!1),D=h.type+(M?"_"+M:""),P=Object(u.createElement)(Xn[b],de()({key:f,value:y,className:void 0,module:o()(t,"props.module"),content:"",resetValue:!1,previewMode:"",_onChange:t._onChange,hasPreview:T,imagePreviewAttrs:x,tab:e,addTitle:C},h,{name:v}));return"background_image"!==f&&"bg_img_"!==f.substr(0,7)||(P=c.a.createElement(qn.a,{key:f,type:"image",fieldName:h.name,fieldType:h.type,previewMode:"background",previewAttributes:x,value:y||"",dynamicAttributes:Object(Kn.e)(s),onChange:t._onChange,onReset:function(e){return t._onChange(e,"",h.type,!1)}},P)),c.a.createElement(Un.b,{name:h.name,className:"et-fb-form__group--"+f,key:"general-form-group-"+f,onMouseEnterGroup:function(){t.props.onMouseEnterGroup(h.name,h.label,D,t.props.toggle_slug,t.props.tab_slug)},onMouseLeaveGroup:function(){t.props.onMouseLeaveGroup(h.name,h.label)},_unsyncGlobalSetting:h._unsyncGlobalSetting,isGlobalOptionSynced:h.isGlobalOptionSynced,isSelectiveSyncAvailable:h.isSelectiveSyncAvailable},S,O,c.a.createElement("div",{className:k,key:"et-fb-option-advanced_"+f},c.a.createElement("div",{className:"et-fb-option-container",key:"et-fb-option-container-"+f},P)))});return!!p&&f}},{key:"render",value:function(){var e=m()(["et-fb-settings-background-tab-navs","et-fb-settings-background-tab-navs-items--"+this.tabNames.length]),t=this._renderTabNavs(),n=this._renderTabs();return!(!t||!n)&&c.a.createElement("div",null,c.a.createElement("ul",{className:e},t),c.a.createElement("div",{className:"et-fb-settings-background-tabs"},n))}}]),t}();Yn.propTypes={_onChange:p.a.func,additional_code:p.a.string,content:p.a.oneOfType([p.a.array,p.a.string]),default:p.a.oneOfType([p.a.bool,p.a.string]),depends_show_if:p.a.string,depends_on:p.a.array,description:p.a.string,label:p.a.string,module:p.a.object,name:p.a.string,type:p.a.string,value:p.a.oneOfType([p.a.bool,p.a.string]),backgroundFields:p.a.object,onMouseEnterGroup:p.a.func,onMouseLeaveGroup:p.a.func,isDescriptionVisible:p.a.func,isHoveredGroup:p.a.func,onClickHelp:p.a.func,toggle_slug:p.a.string,tab_slug:p.a.string};var Jn=Yn,Qn=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Zn={color:M.a,"color-alpha":M.a,number:vt.a,range:Me.a,select:Fe.a,text:vt.a,upload:Tt.a,yes_no_button:yt.a},er=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));n._onTabMouseEnter=function(e){var t=n.props.onMouseEnterGroup;if(t){var r=e.target.getAttribute("data-tab"),i=o()(ETBuilderBackend.i18n.controls.background,r,void 0);t(n.props.name,i,"background-"+r,n.props.toggle_slug,n.props.tab_slug)}},n._onTabMouseLeave=function(){var e=n.props.onMouseLeaveGroup;e&&e(!1,"")},n.state={activeTab:null,isPreviewHover:!1,imagePreviewAttrs:n._getImagePreviewAttrs()},n.baseName=n.props.base_name,n.fieldsStructure={color:[n.baseName+"_color"],gradient:[n.baseName+"_color_gradient_start",n.baseName+"_color_gradient_end",n.baseName+"_use_color_gradient",n.baseName+"_color_gradient_type",n.baseName+"_color_gradient_direction",n.baseName+"_color_gradient_direction_radial",n.baseName+"_color_gradient_start_position",n.baseName+"_color_gradient_end_position",n.baseName+"_color_gradient_overlays_image"],image:[n.baseName+"_image",n.baseName+"_parallax",n.baseName+"_parallax_method",n.baseName+"_size",n.baseName+"_position",n.baseName+"_repeat",n.baseName+"_blend"],video:[n.baseName+"_video_mp4",n.baseName+"_video_webm",n.baseName+"_video_width",n.baseName+"_video_height",n.baseName+"_allow_player_pause",n.baseName+"_video_pause_outside_viewport"]};var r=n.props.background_fields;return _()(r,function(e,t){r[t].name=t,St()(e,"affects")&&_()(e.affects,function(e){St()(r,[e,"depends_on"])?r[e].depends_on.push(t):r[e].depends_on=[t]})}),n.backgroundFields=r,n.fieldsNames=n._getFieldsNames(),n.tabNames=n._getTabNames(),n.shouldComponentUpdate=h.a.shouldComponentUpdate.bind(n),n._onSwitchTab=n._onSwitchTab.bind(n),n._onToggleGradient=n._onToggleGradient.bind(n),n._onToggleFirstGradientColorpicker=n._onToggleFirstGradientColorpicker.bind(n),n._onSwapGradientColor=n._onSwapGradientColor.bind(n),n._onChange=n._onChange.bind(n),n._onPreviewMouseEnter=n._onPreviewMouseEnter.bind(n),n._onPreviewMouseLeave=n._onPreviewMouseLeave.bind(n),n._getImagePreviewAttrs=n._getImagePreviewAttrs.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,u["Component"]),Qn(t,[{key:"componentDidMount",value:function(){this.setState({activeTab:this._getActiveTab()})}},{key:"_getFieldsNames",value:function(){return rt()(this.props.background_fields,function(e){return e.name})}},{key:"_getTabNames",value:function(){var e=this,t={};return _()(this.fieldsStructure,function(n,r){_()(n,function(n){a()(t[r])&&e._isFieldExist(n)&&(t[r]=r)})}),Gn()(t)}},{key:"_getActiveTab",value:function(){if(this.state.activeTab)return this.state.activeTab;var e=this,t=tt()(this.fieldsStructure),n="color";return _()(t,function(t){e._isTabFilled(t)&&(n=t)}),n}},{key:"_getAttrs",value:function(e,t){var n=a()(e)?o()(this,"props.module.props.module.props.attrs",{}):o()(this,"props.module.props.module.props.attrs."+this.baseName+"_"+e);return!a()(e)&&t&&a()(n)&&(n=this._getDefault(e)),n}},{key:"_getDefault",value:function(e){return o()(this,"backgroundFields."+this.baseName+"_"+e+".default","")}},{key:"_getImagePreviewAttrs",value:function(){var e=this._getAttrs("color"),t=this._getAttrs("size"),n=this._getAttrs("position"),r=this._getAttrs("repeat"),o=this._getAttrs("blend"),i=this._getAttrs("parallax"),a=!!pe.default.isOn(this._getAttrs("use_color_gradient"))&&pe.default.getGradient({type:this._getAttrs("color_gradient_type"),direction:this._getAttrs("color_gradient_direction"),radialDirection:this._getAttrs("color_gradient_direction_radial"),colorStart:this._getAttrs("color_gradient_start"),colorEnd:this._getAttrs("color_gradient_end"),startPosition:this._getAttrs("color_gradient_start_position"),endPosition:this._getAttrs("color_gradient_end_position")}),s=this._getAttrs("color_gradient_overlays_image");return{color:pe.default.hasValue(e)?e:this._getDefault("color"),size:pe.default.hasValue(t)?t:this._getDefault("size"),position:pe.default.hasValue(n)?n:this._getDefault("position"),repeat:pe.default.hasValue(r)?r:this._getDefault("repeat"),blend:pe.default.hasValue(o)?o:this._getDefault("blend"),parallax:pe.default.isOn(i),gradient:a,gradientOverlaysImage:s}}},{key:"_isFieldExist",value:function(e){return l()(this.fieldsNames,e)}},{key:"_isVisible",value:function(e,t){var n=this,r=this,i=this.props.module,s=[];return _()(e.depends_on,function(l){if(o()(t[l],"depends_on",!1)&&!n._isVisible(t[l],t))return!1;var u=o()(i,"props.module.props.attrs."+l)||o()(r,"backgroundFields."+l+".default");a()(e.depends_show_if)||u!==e.depends_show_if||s.push(l),a()(e.depends_show_if_not)||u===e.depends_show_if_not||s.push(l)}),!Ke()(s)}},{key:"_isTabFilled",value:function(e){var t=!1;switch(e){case"color":pe.default.hasValue(this._getAttrs("color"))&&(t=!0);break;case"gradient":pe.default.isOn(this._getAttrs("use_color_gradient"))&&(t=!0);break;case"image":pe.default.hasValue(this._getAttrs("image"))&&(t=!0);break;case"video":(pe.default.hasValue(this._getAttrs("video_mp4"))||pe.default.hasValue(this._getAttrs("video_webm")))&&(t=!0)}return t}},{key:"_onSwitchTab",value:function(e){e.preventDefault(),this.setState({activeTab:e.target.getAttribute("data-tab")})}},{key:"_onToggleGradient",value:function(e){e.preventDefault(),e.stopPropagation();var t=this._getAttrs("use_color_gradient"),n=this._getAttrs("color_gradient_start"),r=this._getAttrs("color_gradient_end"),o=pe.default.isOn(t)?"off":"on";this._onChange(this.baseName+"_use_color_gradient",o),!pe.default.isOn(o)||pe.default.hasValue(n)||pe.default.hasValue(r)||(this._onChange(this.baseName+"_color_gradient_start",ETBuilderBackend.defaults.backgroundOptions.colorStart),this._onChange(this.baseName+"_color_gradient_end",ETBuilderBackend.defaults.backgroundOptions.colorEnd))}},{key:"_onToggleFirstGradientColorpicker",value:function(e){if(e.preventDefault(),e.stopPropagation(),!this.props.readonly){var t=pe.default.$appWindow(Ee.a.findDOMNode(this)).find(".et-fb-form__group--background_color_gradient_start .wp-color-picker");t.wpColorPicker("open",!0),pe.default.$topDocument().on("click.etClickOutsideColorpicker",function(){t.wpColorPicker("close")})}}},{key:"_onSwapGradientColor",value:function(e){if(e.preventDefault(),e.stopPropagation(),!this.props.readonly){var t=this._getAttrs("color_gradient_start",!0),n=this._getAttrs("color_gradient_end",!0);this._onChange(this.baseName+"_color_gradient_start",n),this._onChange(this.baseName+"_color_gradient_end",t)}}},{key:"_onChange",value:function(e,t,n,r){this.props._onChange(e,t,n,r),this.forceUpdate();var o=Lt()([this.baseName+"_color",this.baseName+"_parallax"],this.fieldsStructure.gradient,this.fieldsStructure.image);l()(o),e&&this.setState({imagePreviewAttrs:this._getImagePreviewAttrs()})}},{key:"_onPreviewMouseEnter",value:function(){this.setState({isPreviewHover:!0});var e=this.props.onMouseEnterGroup;if(e){var t=ETBuilderBackend.i18n.controls.background.gradientColors;e(this.props.name,t,"background-gradient",this.props.toggle_slug,this.props.tab_slug)}}},{key:"_onPreviewMouseLeave",value:function(){this.setState({isPreviewHover:!1});var e=this.props.onMouseLeaveGroup;e&&e(!1,"")}},{key:"_renderGradientPreview",value:function(){var e=this,t=pe.default.isOn(this._getAttrs("use_color_gradient")),n=t?{backgroundImage:pe.default.getGradient({type:this._getAttrs("color_gradient_type"),direction:this._getAttrs("color_gradient_direction"),radialDirection:this._getAttrs("color_gradient_direction_radial"),colorStart:this._getAttrs("color_gradient_start"),colorEnd:this._getAttrs("color_gradient_end"),startPosition:this._getAttrs("color_gradient_start_position"),endPosition:this._getAttrs("color_gradient_end_position")}),marginBottom:"70px"}:{},r={opacity:this.state.isPreviewHover?Object(pn.spring)(1,{stiffness:300,damping:20}):Object(pn.spring)(0,{stiffness:300,damping:20}),scale:this.state.isPreviewHover?Object(pn.spring)(1,{stiffness:300,damping:20}):Object(pn.spring)(0,{stiffness:300,damping:20}),top:this.state.isPreviewHover?Object(pn.spring)(20,{stiffness:300,damping:20}):Object(pn.spring)(-10,{stiffness:300,damping:20})},o=t?"":c.a.createElement(zn.a,{title:ETBuilderBackend.i18n.controls.background.addGradient,className:"et-fb-button et-fb-settings-option-add",onClick:this._onToggleGradient}),i=t?c.a.createElement(pn.Motion,{style:r},function(t){return c.a.createElement("button",{className:"et-fb-button et-fb-settings-option-remove",onClick:e._onToggleGradient,style:{opacity:t.opacity,transform:"scale( "+t.scale+" )",top:t.top}},c.a.createElement(k.a,{icon:"delete",color:"#fff"}))}):"",a=t?c.a.createElement(pn.Motion,{style:r},function(t){return c.a.createElement("button",{className:"et-fb-button et-fb-settings-option-swap",onClick:e._onSwapGradientColor,style:{opacity:t.opacity,transform:"scale( "+t.scale+" )",top:t.top}},c.a.createElement(k.a,{icon:"swap",color:"#fff"}))}):"",s=t?this._onToggleFirstGradientColorpicker:this._onToggleGradient;return c.a.createElement("div",{className:"et-fb-settings-option-color--previewable",ref:"previewContainer"},c.a.createElement("div",{className:m()({"et-fb-settings-option-preview":!0,"et-fb-settings-option-preview--empty":!t}),style:n,onClick:s,onMouseEnter:this._onPreviewMouseEnter,onMouseLeave:this._onPreviewMouseLeave},o,i,a))}},{key:"_renderTabNavs",value:function(){var e=this,t="et-fb-settings-background-tab-nav",n=this._getActiveTab(),r=o()(this,"props.name","background"),i=me.a.isEnabled(r,o()(this,"props.module.props.module.props.attrs")),a=me.a.isHoverMode(),s=this._onSwitchTab;return rt()(this.tabNames,function(r){var o=t+"--"+r,l=[t,o];i&&a&&"color"!==r&&(l.push(t+"--disabled"),s=function(e){e.preventDefault()});var u=n===r||e._isTabFilled(r)?ze.a.info:ze.a.inactiveGrey;return n===r&&l.push(t+"--active"),c.a.createElement("li",{key:o},c.a.createElement("button",{className:m()(l),"data-tab":r,onClick:s,name:r,onMouseEnter:e._onTabMouseEnter,onMouseLeave:e._onTabMouseLeave},c.a.createElement(k.a,{icon:"background-"+r,color:u})))})}},{key:"_renderTabs",value:function(){var e=this,t=this._getActiveTab();return rt()(this.tabNames,function(n){var r="et-fb-settings-background-tab--"+n,o=["et-fb-settings-background-tab",r],i="gradient"===n?e._renderGradientPreview():"";return n===t&&o.push("et-fb-settings-background-tab--active"),c.a.createElement("div",{className:m()(o),key:r},i,e._renderTabFields(n))})}},{key:"_renderTabFields",value:function(e){var t=this,n=this.backgroundFields,r=o()(this,"props.module.props.module.props.attrs",{}),i=[];return rt()(this.fieldsStructure[e],function(s){var d=n[s];if(a()(d))return"";var p=me.a.getHoverFieldOnHover(s,r),f=d.type,h=pe.default.get(r[p],pe.default.get(t.props.default,d.default));if(t._isFieldExist(s)&&"skip"!==d.type){if("warning"===d.type&&d.display_if!==d.value)return!1;if(a()(Zn[f]))return!1;if(!a()(d.depends_on)&&!t._isVisible(d,n))return i.push(d.name),!1;if(!a()(d.depends_on)&&I()(d.depends_on,Je()(d.depends_on,i)))return!1;var g=m()(["et-fb-settings-options","et-fb-option--"+f.replace("_","-")]);a()(d.depends_default)&&a()(d.depends_show_if)&&a()(d.depends_show_if_not)||(g=m()("et-fb-option--depends-on",g));var v=!a()(d.description)&&""!==d.description,b=a()(d.label)||""===d.label?"":c.a.createElement(Un.c,{name:d.name,activeHelp:t.props.isDescriptionVisible(d.name),hoveredGroup:t.props.isHoveredGroup(d.name),key:"general-form-label-"+s,onClickHelp:!!v&&t.props.onClickHelp},d.label),y=v?c.a.createElement(Un.a,{active:t.props.isDescriptionVisible(d.name),key:"general-form-description-"+s},d.description):"",_=!(!l()(["color","color-alpha","upload"],f)||l()([t.baseName+"_color_gradient_start",t.baseName+"_color_gradient_end"],d.name)),k=t.baseName+"_image"===s?t.state.imagePreviewAttrs:void 0,w="";switch(f){case"color":case"color-alpha":w=ETBuilderBackend.i18n.controls.background.addColor;break;case"upload":w="video"===d.data_type?ETBuilderBackend.i18n.controls.background.addVideo:ETBuilderBackend.i18n.controls.background.addImage}var C=o()(d,"data_type",!1),S=d.type+(C?"_"+C:""),E=Object(u.createElement)(Zn[f],de()({key:s,value:h,className:void 0,module:o()(t,"props.module"),content:"",resetValue:!1,previewMode:"",_onChange:t._onChange,hasPreview:_,imagePreviewAttrs:k,tab:e,addTitle:w},d,{name:p}));return"upload"===f&&"video"!==d.data_type&&(E=c.a.createElement(qn.a,{key:s,type:"image",fieldName:d.name,fieldType:d.type,previewMode:"background",previewAttributes:k,value:h||"",dynamicAttributes:Object(Kn.e)(r),onChange:t._onChange,onReset:function(e){return t._onChange(e,"",d.type,!1)}},E)),c.a.createElement(Un.b,{name:d.name,className:"et-fb-form__group--"+s.replace(t.baseName,"background"),key:"general-form-group-"+s,onMouseEnterGroup:function(){t.props.onMouseEnterGroup(d.name,d.label,S,t.props.toggle_slug,t.props.tab_slug)},onMouseLeaveGroup:function(){t.props.onMouseLeaveGroup(d.name,d.label)},_unsyncGlobalSetting:d._unsyncGlobalSetting,isGlobalOptionSynced:d.isGlobalOptionSynced,isSelectiveSyncAvailable:d.isSelectiveSyncAvailable},b,y,c.a.createElement("div",{className:g,key:"et-fb-option-advanced_"+s},c.a.createElement("div",{className:"et-fb-option-container",key:"et-fb-option-container-"+s},E)))}})}},{key:"render",value:function(){var e=m()(["et-fb-settings-background-tab-navs","et-fb-settings-background-tab-navs-items--"+this.tabNames.length]);return c.a.createElement("div",null,c.a.createElement("ul",{className:e},this._renderTabNavs()),c.a.createElement("div",{className:"et-fb-settings-background-tabs"},this._renderTabs()))}}]),t}();er.propTypes={_onChange:p.a.func,additional_code:p.a.string,content:p.a.oneOfType([p.a.array,p.a.string]),default:p.a.oneOfType([p.a.bool,p.a.string]),depends_show_if:p.a.string,depends_on:p.a.array,description:p.a.string,label:p.a.string,module:p.a.object,name:p.a.string,type:p.a.string,value:p.a.oneOfType([p.a.bool,p.a.string]),background_fields:p.a.object,onMouseEnterGroup:p.a.func,onMouseLeaveGroup:p.a.func,isDescriptionVisible:p.a.func,isHoveredGroup:p.a.func,onClickHelp:p.a.func,toggle_slug:p.a.string,tab_slug:p.a.string};var tr=er,nr=n(1224),rr=n(1103),or=n(1230),ir=(n(1232),function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}());function ar(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var sr=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={ajax_in_progress:!1},n.shouldComponentUpdate=h.a.shouldComponentUpdate.bind(n),n._onClickCancelButton=n._onClickCancelButton.bind(n),n._onClickSubmitButton=n._onClickSubmitButton.bind(n),n.onAddAccountAjaxComplete=function(){return n.setState({ajax_in_progress:!1})},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,c.a.Component),ir(t,[{key:"componentWillMount",value:function(){E.a.addSignupModuleAddAccountAjaxCompleteEventListener(this.onAddAccountAjaxComplete)}},{key:"componentWillUnmount",value:function(){E.a.removeSignupModuleAddAccountAjaxCompleteEventListener(this.onAddAccountAjaxComplete)}},{key:"_onClickCancelButton",value:function(){E.a.emitSignupModuleAddAccountCancelEvent.call(E.a),this.state.ajax_in_progress&&this.setState({ajax_in_progress:!1})}},{key:"_onClickSubmitButton",value:function(){E.a.emitSignupModuleAddAccountSubmitEvent.call(E.a),this.setState({ajax_in_progress:!0})}},{key:"render",value:function(){var e,t=this.props.type.replace(/_/g,"-"),n=m()({"et-fb-settings-button--additional-button":!0}),r=m()((ar(e={},"et-fb-option--"+t,!0),ar(e,"et-fb-option-group--last-field",!0),e));return c.a.createElement("div",{className:r},c.a.createElement(vt.a,{name:this.props.name,value:a()(this.props.value)?"":this.props.value,className:m()("et-fb-settings-option--with-after-element"),groups:!0,options:this.props.options,module:this.props.module,_onChange:this.props._onChange}),c.a.createElement(Mn.a,{className:m()(n,"et-fb-button--cancel"),_onClick:this._onClickCancelButton,inverse:!0},o()(this.props,"after[0].text","")),c.a.createElement(dn.a,{useWrapper:!1,isLoading:this.state.ajax_in_progress},c.a.createElement(Mn.a,{className:n,_onClick:this._onClickSubmitButton,inverse:!0},o()(this.props,"after[1].text",""))))}}]),t}(),lr=n(297),ur=n.n(lr),cr=(n(1233),Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}),dr=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var pr=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,u["PureComponent"]),dr(t,[{key:"render",value:function(){var e=Object(u.createElement)(vt.a,cr({},this.props));return c.a.createElement(u.Fragment,null,e,c.a.createElement("div",{className:"et-fb-settings-unsupported-notice",dangerouslySetInnerHTML:{__html:ur()(o()(ETBuilderBackend,"i18n.vbSupport.unsupportedFieldType",""))}}))}}]),t}(),fr=n(1102),hr=n(1099),gr=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var mr=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return gr(e,null,[{key:"getControl",value:function(t){return!a()(t)&&""!==t&&!l()(["skip","computed","hidden","column_settings_background","column_settings_padding","et_builder_generate_pin_zoom_level_input"],t)&&o()(e._map,t,pr)}}]),e}();mr._map={transform:hr.a,color:M.a,"color-alpha":M.a,background:Jn,"background-field":tr,"border-radius":nr.a,custom_margin:Ce,custom_padding:Ce,composite:rr.a,date_picker:Te,divider:Ie,categories:xe.a,center_map:Hn,upload_gallery:wn,"upload-gallery":wn,select_icon:Ve.a,select_sidebar:We,font:ft,number:vt.a,multiple_buttons:Le.a,multiple_checkboxes:Ne.a,presets:x,presets_shadow:Ot,range:Me.a,select:Fe.a,text:vt.a,input:vt.a,textarea:De.a,codemirror:Pe.a,text_align:mt,tiny_mce:bt.a,upload:Tt.a,yes_no_button:yt.a,options_list:fr.d,conditional_logic:_t.a,select_animation:kt,select_box_shadow:function(e){return c.a.createElement(x,wt({},e,{className:"et_box_shadow "+e.className}))},warning:Wn.a,select_with_option_groups:or.a,text_api_key:sr,sortable_list:fr.d};t.a=mr},function(e,t,n){"use strict";(function(e){var r=n(1),o=n.n(r),i=n(6),a=n.n(i),s=n(18),l=n.n(s),u=n(36),c=n.n(u),d=n(27),p=n.n(d),f=n(4),h=n.n(f),g=n(19),m=n.n(g),v=n(7),b=n.n(v),y=n(41),_=n.n(y),k=n(9),w=n.n(k),C=n(30),S=n.n(C),E=n(2),O=n.n(E),T=n(59),x=n.n(T),M=n(111),D=n.n(M),P=n(76),N=n.n(P),L=n(1063),F=n(1064),A=(n(1108),Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}),j=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function I(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var R=function(t){function n(){var t,r,o;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);for(var i=arguments.length,a=Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=o=I(this,(t=n.__proto__||Object.getPrototypeOf(n)).call.apply(t,[this].concat(a))),o.getGroupForSelected=function(){return e(o.node).find(":selected").parent().attr("label")},o._onChange=function(e){var t=o.props.name,n=o.getGroupForSelected(),r=o.props.overwrite_onchange,i=o.props.value_overwrite,a=e.target.value;n&&(a=n+"|"+a,o.props.group_prop&&o.props._onChange(o.props.group_prop,n)),o.props._onChange(t,a),r&&m()(r)&&i&&_()(i)&&c()(o.props.overwrite_onchange,function(e){h()(i[a])||o.props._onChange(e,i[a])})},I(o,r)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,r["PureComponent"]),j(n,[{key:"componentDidMount",value:function(){this.props.group_prop&&this.props._onChange(this.props.group_prop,this.getGroupForSelected())}},{key:"_render_options",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=S()(e),r=this.props;if(!b()(r.order)){var i=c()(r.order,String);n=x()(N()(i,n),D()(n,i))}return c()(n,function(n){var r=O()(e,n),i=n;return""!==t&&(i=t+"-"+n),o.a.createElement(L.a,{key:i,value:n,name:r})})}},{key:"render",value:function(){var e=this,t=p()(this.props.value)?this.props.value:this.props.default,n=void 0;!w()(S()(this.props.options),t)&&w()(S()(this.props.options),p()(t))&&(t=p()(t));var r={"et-core-control-select":!0,"et-fb-settings-option-select":!0};this.props.className&&(r[this.props.className]=!0),n=this.props.groups?c()(this.props.options,function(t,n){return"0"===n?e._render_options(t,n):o.a.createElement(F.a,{label:n,key:"option-group-"+n},e._render_options(t,n))}):this._render_options(this.props.options);var i={};this.props.readonly&&(i.disabled=!0);var a=this.props.id;return a||(a="et-fb-"+this.props.name),o.a.createElement("select",A({ref:function(t){return e.node=t},className:l()(r),value:t,name:this.props.name,id:a,onChange:this._onChange},i),n)}}]),n}();R.propTypes={name:a.a.string.isRequired},t.a=R}).call(this,n(28))},function(e,t,n){"use strict";var r=n(1),o=n.n(r),i=n(6),a=n.n(i),s=n(7),l=n.n(s),u=n(12),c=n.n(u),d=n(138),p=n.n(d),f=n(36),h=n.n(f),g=n(160),m=n.n(g),v=n(71),b=n.n(v),y=n(4),_=n.n(y),k=n(53),w=n.n(k),C=n(0),S=n(32),E=n.n(S),O=(n(1186),Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}),T=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var x=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.shouldComponentUpdate=E.a.shouldComponentUpdate.bind(n),n._getDefaults=n._getDefaults.bind(n),n._getValue=n._getValue.bind(n),n._onChange=n._onChange.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r["Component"]),T(t,[{key:"_getDefaults",value:function(){var e=this.props.options,t=this.props.defaults;return _()(t)?h()(m()(b()(e)),function(){return"off"}):t}},{key:"_getValue",value:function(){var e=this._getDefaults(),t=this.props.value,n=_()(t)?e:h()(t.split("|"),function(e){return C.default.hasValue(e)?e:"off"});return b()(n)<b()(e)&&(n=c()(e,n)),n}},{key:"_onChange",value:function(e){var t=e.target.checked?"on":"off",n=e.target.getAttribute("data-index"),r=this._getValue();r[n]=t;var o=r.join("|");this.props._onChange(this.props.name,o)}},{key:"render",value:function(){var e=this,t=this._getValue(),n=this.props.options,r={};this.props.readonly&&(r.readOnly=!0);var i="";return l()(n)||(i=p()(n).map(function(n,i){var a=w()(n)?n:n.value,s=w()(n)?n:n.label,l="et-fb-multiple-checkbox-"+e.props.name+"-"+e.props.shortcut_index+"-"+i,u=!_()(t[i])&&C.default.isOn(t[i]);return o.a.createElement("p",{key:l},o.a.createElement("label",{htmlFor:l},o.a.createElement("input",O({type:"checkbox",id:l,name:"et_fb_multiple_checkboxes["+i+"]",value:a,onChange:e._onChange,checked:u,"data-index":i},r))," ",s))})),o.a.createElement("div",{className:"et-fb-multiple-checkboxes-wrap"},i)}}]),t}();x.propTypes={options:a.a.oneOfType([a.a.array,a.a.object]),defaults:a.a.array,value:a.a.string,name:a.a.string,_onChange:a.a.func},t.a=x},function(e,t,n){"use strict";var r=n(1),o=n.n(r),i=n(17),a=n.n(i),s=n(6),l=n.n(s),u=n(18),c=n.n(u),d=n(12),p=n.n(d),f=n(79),h=n.n(f),g=n(11),m=n.n(g),v=n(7),b=n.n(v),y=n(4),_=n.n(y),k=n(9),w=n.n(k),C=n(30),S=n.n(C),E=n(101),O=n.n(E),T=n(48),x=n.n(T),M=n(193),D=n.n(M),P=n(2),N=n.n(P),L=n(0),F=n(24),A=n(1213),j=n(685),I=n(36),R=n.n(I),B=(n(1221),n(33)),H=n(46),W=(n(1222),function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}());var V=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.a.PureComponent),W(t,[{key:"_renderPreview",value:function(){var e=this.props.dynamic.image;return e.loading?Object(F.l)("image"):b()(e.value)?o.a.createElement(B.a,{icon:"none",color:"#6e7b8a"}):o.a.createElement("img",{src:e.value,alt:""})}},{key:"render",value:function(){return o.a.createElement("div",{className:"et-fb-control-image-preview__preview et-fb-control-image-preview__preview--image"},this._renderPreview())}}]),t}();V.propTypes={value:l.a.string.isRequired,dynamicEnabled:l.a.bool.isRequired};var G=Object(H.b)(function(e){return{image:{attribute:"image",type:"image",value:e.value}}},function(e){return{_dynamic_attributes:e.dynamicEnabled?"image":""}})(V),U=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function z(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var q=function(e){function t(){var e,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var o=arguments.length,i=Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=r=z(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(i))),r.getStyle=function(e,t){var n={backgroundImage:"url("+encodeURI(e)+")"};return t.parallax?p()(n,{backgroundRepeat:"no-repeat",backgroundSize:"cover",backgroundPosition:"center"}):(_()(t.position)||(n.backgroundPosition=t.position.replace("_"," ")),_()(t.color)||(n.backgroundColor=t.color),_()(t.blend)||(n.backgroundBlendMode=t.blend),_()(t.repeat)||(n.backgroundRepeat=t.repeat),_()(t.size)||(n.backgroundSize=t.size),t.gradient&&(e&&(n.backgroundColor="initial"),L.default.isOn(t.gradientOverlaysImage)?n.backgroundImage=t.gradient+", "+n.backgroundImage:n.backgroundImage=n.backgroundImage+", "+t.gradient),n)},z(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.a.PureComponent),U(t,[{key:"render",value:function(){var e=this.props.dynamic.image;return e.loading?o.a.createElement("div",{className:"et-fb-control-image-preview__preview et-fb-control-image-preview__preview--background"},Object(F.l)("image")):b()(e.value)?o.a.createElement("div",{className:"et-fb-control-image-preview__preview et-fb-control-image-preview__preview--background"},o.a.createElement(B.a,{icon:"none",color:"#FF0000"})):o.a.createElement("div",{className:"et-fb-control-image-preview__preview et-fb-control-image-preview__preview--background",style:this.getStyle(e.value,this.props.attributes)})}}]),t}();q.propTypes={value:l.a.string.isRequired,attributes:l.a.object,dynamicEnabled:l.a.bool.isRequired},q.defaultProps={attributes:{}};var K=Object(H.b)(function(e){return{image:{attribute:"image",type:"image",value:e.value}}},function(e){return{_dynamic_attributes:e.dynamicEnabled?"image":""}})(q),$=n(16),X=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function Y(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var J=function(e){function t(){var e,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var o=arguments.length,i=Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=r=Y(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(i))),r.getStyle=function(){return{opacity:r.props.forward?Object($.spring)(1,{stiffness:300,damping:20}):Object($.spring)(0,{stiffness:300,damping:20}),scale:r.props.forward?Object($.spring)(1,{stiffness:300,damping:20}):Object($.spring)(0,{stiffness:300,damping:20}),top:r.props.forward?Object($.spring)(14,{stiffness:300,damping:20}):Object($.spring)(-10,{stiffness:300,damping:20})}},Y(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r["Component"]),X(t,[{key:"render",value:function(){var e=this;return o.a.createElement($.Motion,{style:this.getStyle()},function(t){return e.props.children({opacity:t.opacity,transform:"scale("+t.scale+")",top:t.top})})}}]),t}();J.propTypes={children:l.a.func.isRequired,forward:l.a.bool},J.defaultProps={forward:!0};var Q=J,Z=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var ee=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.handleMouseEnter=function(){n.setState({isHovered:!0})},n.handleMouseMove=function(){n.state.isHovered||n.setState({isHovered:!0})},n.handleMouseLeave=function(){n.setState({isHovered:!1})},n.state={isHovered:!1},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.a.PureComponent),Z(t,[{key:"render",value:function(){var e=this;return o.a.createElement("div",{className:c()({"et-fb-control-image-preview":!0,"et-fb-control-image-preview--hovered":this.state.isHovered}),onMouseEnter:this.handleMouseEnter,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave},"image"===this.props.mode?o.a.createElement(G,{value:this.props.value,dynamicEnabled:this.props.dynamicEnabled}):o.a.createElement(K,{value:this.props.value,attributes:this.props.attributes,dynamicEnabled:this.props.dynamicEnabled}),o.a.createElement("div",{className:"et-fb-control-image-preview__buttons"},R()(this.props.children,function(t,n){return o.a.createElement(Q,{key:n,forward:e.state.isHovered},function(e){return o.a.createElement("div",{className:"et-fb-control-image-preview__button",style:e},t)})})),this.props.label&&o.a.createElement("div",{className:"et-fb-control-image-preview__label"},this.props.label))}}]),t}();ee.propTypes={value:l.a.string.isRequired,label:l.a.string,mode:l.a.oneOf(["image","background"]),attributes:l.a.object,dynamicEnabled:l.a.bool.isRequired},ee.defaultProps={label:"",mode:"image",attributes:{}};var te=ee,ne=n(78),re=n.n(ne),oe=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var ie=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r["PureComponent"]),oe(t,[{key:"componentDidMount",value:function(){re.a.rebuild()}},{key:"render",value:function(){return o.a.createElement("button",{type:"button",className:"et-fb-settings-option-dynamic__button et-fb-settings-option-dynamic__button--"+this.props.type+" "+this.props.className,onClick:this.props.onClick,"data-tip":this.props.tooltip},o.a.createElement(B.a,{size:"14",icon:this.props.icon}))}}]),t}();ie.propTypes={type:l.a.string.isRequired,icon:l.a.string.isRequired,tooltip:l.a.string,className:l.a.string,onClick:l.a.func},ie.defaultProps={tooltip:"",className:"",onClick:x.a};var ae=ie,se=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var le=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.a.PureComponent),se(t,[{key:"render",value:function(){var e=w()(["upload","background"],this.props.fieldType),t=b()(this.props.settingsFields)?null:o.a.createElement(ae,{type:this.props.fieldType,icon:"setting",tooltip:ETBuilderBackend.i18n.dynamicContent.tooltips.settings,onClick:this.props.onSettings}),n=this.props.showDisableButton?o.a.createElement(ae,{type:this.props.fieldType,icon:"delete",tooltip:ETBuilderBackend.i18n.dynamicContent.tooltips.disable,onClick:this.props.onDisable}):null;return o.a.createElement("div",{className:"et-fb-settings-option-dynamic__preview"},e?o.a.createElement(te,{value:this.props.value,label:this.props.label,mode:this.props.mode,attributes:this.props.attributes,dynamicEnabled:this.props.dynamicEnabled},t,n):o.a.createElement("div",{className:"et-fb-settings-option-dynamic__preview--text"},t,o.a.createElement("div",{className:"et-fb-settings-option-dynamic__label"},this.props.label),n))}}]),t}();le.propTypes={fieldType:l.a.string.isRequired,value:l.a.string.isRequired,label:l.a.string.isRequired,mode:l.a.oneOf(["image","background"]),attributes:l.a.object,settingsFields:l.a.object.isRequired,dynamicEnabled:l.a.bool.isRequired,onSettings:l.a.func,onDisable:l.a.func},le.defaultProps={mode:"image",attributes:{},onSettings:x.a,onDisable:x.a};var ue=le,ce=(n(1223),function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}());function de(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pe(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var fe=L.default.condition("is_bfb"),he=function(e){function t(){var e,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var o=arguments.length,i=Array(o),s=0;s<o;s++)i[s]=arguments[s];return n=r=pe(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(i))),r.selectRef=null,r.controlRef=null,r.buttonRef=null,r.state={settingsOpen:!1,classModifier:""},r.isTinyMCE=function(){return"tiny_mce"===N()(r,"props.fieldType")},r.handleEnable=function(){r.selectRef.toggleMenu({target:null})},r.handleDisable=function(){r.props.isContentField?r.props.onChange(r.props.fieldName,"",r.props.fieldType,r.props.isContentField):r.props.onReset(r.props.fieldName),r.handleEnabledDynamicAttributesChange(h()(r.props.dynamicAttributes,function(e){return r.props.fieldName!==e}))},r.handleDynamicContentChange=function(e){r.props.onChange(r.props.fieldName,Object(F.b)({dynamic:!0,content:e,settings:r.getDynamicContentFieldDefaultSettings(e)}),r.props.fieldType,r.props.isContentField),-1===r.props.dynamicAttributes.indexOf(r.props.fieldName)&&r.handleEnabledDynamicAttributesChange(r.props.dynamicAttributes.concat([r.props.fieldName]))},r.openSettings=function(){var e=r.getDynamicContentSettingsFields(Object(F.d)(r.props.value).content,r.props.type);b()(e)||r.setState({settingsOpen:!0})},r.closeSettings=function(){r.setState({settingsOpen:!1})},r.handleSettingsChange=function(e){var t=Object(F.d)(r.props.value);r.props.onChange(r.props.fieldName,Object(F.b)(p()({},t,{settings:e})),r.props.fieldType,r.props.isContentField)},r.handleEnabledDynamicAttributesChange=function(e){r.props.onChange("_dynamic_attributes",e.join(","),"multiple_checkboxes",!1)},r.updateButtonPositionForTinyMCE=function(e){if(r.isTinyMCE()){r.setState({classModifier:"tinymce-mode-"+e});var t=L.default.$topWindow(a.a.findDOMNode(r.buttonRef)),n=L.default.$topWindow(a.a.findDOMNode(r.controlRef)),o=n.find(".mce-tinymce .mce-toolbar-grp:first").height(),i=Math.max(0,n.find(".et-fb-tinymce-media-buttons:first").height()-38),s=50+(o>0&&t.length>0?o:0)+i;t.css({top:s})}},r.isEnabledDynamicContent=function(e){var t=e.dynamicAttributes,n=e.fieldName,r=e.value;return w()(t,n)&&Object(F.g)(r)},r.getDynamicContentSettingsFields=function(e,t){var n=r.getDynamicContentField(e).fields||{};return D()(n,function(e){return!_()(e.show_on)&&e.show_on!==t})},pe(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r["PureComponent"]),ce(t,[{key:"getDynamicContentField",value:function(e){return ETBuilderBackend.dynamicContentFields[e]||{label:ETBuilderBackend.i18n.dynamicContent.invalidField,type:"text",fields:{}}}},{key:"getDynamicContentFieldLabel",value:function(e){return this.getDynamicContentField(e).label}},{key:"getDynamicContentFieldDefaultSettings",value:function(e){return O()(this.getDynamicContentField(e).fields,function(e){return e.default||""})}},{key:"getDynamicContentFieldOptions",value:function(e){var t={Divi:{}};return m()(ETBuilderBackend.dynamicContentFields,function(n,r){"any"!==n.type&&n.type!==e||(n.custom&&_()(t["Custom Fields"])&&(t["Custom Fields"]={}),t[n.custom?"Custom Fields":"Divi"][r]=n.label)}),t}},{key:"componentDidMount",value:function(){L.default.$topWindow().on("wp-toolbar-toggle",this.updateButtonPositionForTinyMCE)}},{key:"componentDidUpdate",value:function(e){var t=Object(F.g)(e.value),n=this.isEnabledDynamicContent(e),r=this.isEnabledDynamicContent(this.props);if(!n&&r){var o=Object(F.d)(this.props.value),i=this.getDynamicContentSettingsFields(o.content,this.props.type),a="text"===this.props.type?3:1;S()(i).length>=a&&this.openSettings()}t&&!r&&(_()(this.controlRef.focus)||this.controlRef.focus()),this.updateButtonPositionForTinyMCE()}},{key:"render",value:function(){var e,t=this,n=w()(["upload","background"],this.props.fieldType),i=this.isEnabledDynamicContent(this.props),a=Object(F.d)(this.props.value),s=this.getDynamicContentFieldOptions(this.props.type),l=!n||b()(this.props.value),u=o.a.cloneElement(this.props.children,{ref:function(e){return t.controlRef=e}});if(b()(s))return o.a.createElement(r.Fragment,null,this.props.children);var d="";if("ETBuilderControlTinyMCE"===u.type.displayName){u=o.a.cloneElement(u,{onModeSwitch:this.updateButtonPositionForTinyMCE});fe||b()(this.state.classModifier)||(this.props.modalWidth>=538&&this.props.modalWidth<998?d=this.state.classModifier+"-medium":this.props.modalWidth>=998&&this.props.modalWidth<1202&&(d=this.state.classModifier+"-wide"))}return o.a.createElement("div",{className:c()((e={"et-fb-settings-option-dynamic":!0},de(e,"et-fb-settings-option-dynamic--"+this.props.fieldType,!0),de(e,"et-fb-settings-option-dynamic--"+this.state.classModifier,this.state.classModifier),de(e,"et-fb-settings-option-dynamic--"+d,!!d),e))},i&&this.state.settingsOpen&&o.a.createElement(A.a,{title:this.getDynamicContentFieldLabel(a.content),fields:this.getDynamicContentSettingsFields(a.content,this.props.type),values:a.settings,onChange:this.handleSettingsChange,onClose:this.closeSettings}),i&&o.a.createElement(ue,{fieldType:this.props.fieldType,value:this.props.value,label:this.getDynamicContentFieldLabel(a.content),mode:this.props.previewMode,attributes:this.props.previewAttributes,settingsFields:this.props.showSettingsButton?this.getDynamicContentSettingsFields(a.content,this.props.type):{},showDisableButton:this.props.showDisableButton,dynamicEnabled:-1!==this.props.dynamicAttributes.indexOf(this.props.fieldName),onSettings:this.openSettings,onDisable:this.handleDisable}),!i&&o.a.createElement(r.Fragment,null,o.a.createElement("div",{className:"et-fb-settings-option-select-discrete"},o.a.createElement(j.a,{ref:function(e){return t.selectRef=e},name:this.props.fieldName+"_dynamic_content",value:i?a.content:"",options:this.getDynamicContentFieldOptions(this.props.type),__onChange:this.handleDynamicContentChange,selectFirst:!1})),u,l&&o.a.createElement(ae,{ref:function(e){return t.buttonRef=e},type:this.props.fieldType,icon:"dynamic",tooltip:ETBuilderBackend.i18n.dynamicContent.tooltips.enable,className:c()("et-fb-settings-option-dynamic__enable","et-fb-settings-option-dynamic__enable--"+this.props.fieldType),onClick:this.handleEnable})))}}]),t}();he.supportedFieldTypes=["text","tiny_mce","upload"],he.propTypes={children:l.a.element.isRequired,type:l.a.string.isRequired,fieldName:l.a.string.isRequired,fieldType:l.a.oneOf(he.supportedFieldTypes).isRequired,previewMode:l.a.oneOf(["image","background"]),previewAttributes:l.a.object,isContentField:l.a.bool,dynamicAttributes:l.a.arrayOf(l.a.string).isRequired,value:l.a.string.isRequired,showSettingsButton:l.a.bool,showDisableButton:l.a.bool,onChange:l.a.func,onReset:l.a.func,modalWidth:l.a.number},he.defaultProps={previewMode:"image",previewAttributes:{},isContentField:!1,showSettingsButton:!0,showDisableButton:!0,onChange:x.a,onReset:x.a};t.a=he},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1074);Object.defineProperty(t,"DragDropContext",{enumerable:!0,get:function(){return l(r).default}});var o=n(1130);Object.defineProperty(t,"DragDropContextProvider",{enumerable:!0,get:function(){return l(o).default}});var i=n(1131);Object.defineProperty(t,"DragLayer",{enumerable:!0,get:function(){return l(i).default}});var a=n(1132);Object.defineProperty(t,"DragSource",{enumerable:!0,get:function(){return l(a).default}});var s=n(1142);function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"DropTarget",{enumerable:!0,get:function(){return l(s).default}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.END_DRAG=t.DROP=t.HOVER=t.PUBLISH_DRAG_SOURCE=t.BEGIN_DRAG=void 0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.beginDrag=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{publishSource:!0,clientOffset:null},n=t.publishSource,r=t.clientOffset,s=t.getSourceClientOffset;(0,o.default)((0,i.default)(e),"Expected sourceIds to be an array.");var l=this.getMonitor(),c=this.getRegistry();(0,o.default)(!l.isDragging(),"Cannot call beginDrag while dragging.");for(var d=0;d<e.length;d++)(0,o.default)(c.getSource(e[d]),"Expected sourceIds to be registered.");for(var p=null,f=e.length-1;f>=0;f--)if(l.canDragSource(e[f])){p=e[f];break}if(null===p)return;var h=null;r&&((0,o.default)("function"==typeof s,"When clientOffset is provided, getSourceClientOffset must be a function."),h=s(p));var g=c.getSource(p).beginDrag(l,p);(0,o.default)((0,a.default)(g),"Item must be an object."),c.pinSource(p);var m=c.getSourceType(p);return{type:u,itemType:m,item:g,sourceId:p,clientOffset:r,sourceClientOffset:h,isSourcePublic:n}},t.publishDragSource=function(){if(!this.getMonitor().isDragging())return;return{type:c}},t.hover=function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).clientOffset,n=void 0===t?null:t;(0,o.default)((0,i.default)(e),"Expected targetIds to be an array.");var r=e.slice(0),a=this.getMonitor(),l=this.getRegistry();(0,o.default)(a.isDragging(),"Cannot call hover while not dragging."),(0,o.default)(!a.didDrop(),"Cannot call hover after drop.");for(var u=0;u<r.length;u++){var c=r[u];(0,o.default)(r.lastIndexOf(c)===u,"Expected targetIds to be unique in the passed array.");var p=l.getTarget(c);(0,o.default)(p,"Expected targetIds to be registered.")}for(var f=a.getItemType(),h=r.length-1;h>=0;h--){var g=r[h],m=l.getTargetType(g);(0,s.default)(m,f)||r.splice(h,1)}for(var v=0;v<r.length;v++){var b=r[v],y=l.getTarget(b);y.hover(a,b)}return{type:d,targetIds:r,clientOffset:n}},t.drop=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.getMonitor(),i=this.getRegistry();(0,o.default)(n.isDragging(),"Cannot call drop while not dragging."),(0,o.default)(!n.didDrop(),"Cannot call drop twice during one drag operation.");var s=n.getTargetIds().filter(n.canDropOnTarget,n);s.reverse(),s.forEach(function(s,l){var u=i.getTarget(s),c=u.drop(n,s);(0,o.default)(void 0===c||(0,a.default)(c),"Drop result must either be an object or undefined."),void 0===c&&(c=0===l?{}:n.getDropResult()),e.store.dispatch({type:p,dropResult:r({},t,c)})})},t.endDrag=function(){var e=this.getMonitor(),t=this.getRegistry();(0,o.default)(e.isDragging(),"Cannot call endDrag while not dragging.");var n=e.getSourceId();return t.getSource(n,!0).endDrag(e,n),t.unpinSource(),{type:f}};var o=l(n(1048)),i=l(n(19)),a=l(n(41)),s=l(n(1077));function l(e){return e&&e.__esModule?e:{default:e}}var u=t.BEGIN_DRAG="dnd-core/BEGIN_DRAG",c=t.PUBLISH_DRAG_SOURCE="dnd-core/PUBLISH_DRAG_SOURCE",d=t.HOVER="dnd-core/HOVER",p=t.DROP="dnd-core/DROP",f=t.END_DRAG="dnd-core/END_DRAG"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addSource=function(e){return{type:r,sourceId:e}},t.addTarget=function(e){return{type:o,targetId:e}},t.removeSource=function(e){return{type:i,sourceId:e}},t.removeTarget=function(e){return{type:a,targetId:e}};var r=t.ADD_SOURCE="dnd-core/ADD_SOURCE",o=t.ADD_TARGET="dnd-core/ADD_TARGET",i=t.REMOVE_SOURCE="dnd-core/REMOVE_SOURCE",a=t.REMOVE_TARGET="dnd-core/REMOVE_TARGET"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){0}},function(e,t,n){var r=n(167)("isEmpty",n(7),n(384));r.placeholder=n(155),e.exports=r},function(e,t,n){var r=n(167)("last",n(68),n(384));r.placeholder=n(155),e.exports=r},function(e,t,n){"use strict";(function(e){var r=n(1),o=n.n(r),i=n(6),a=n.n(i),s=n(84),l=n.n(s),u=n(18),c=n.n(u),d=n(32),p=n.n(d),f=n(16),h=n(91),g=n(4),m=n.n(g),v=n(48),b=n.n(v),y=n(2),_=n.n(y),k=n(9),w=n.n(k),C=n(1061),S=n(54),E=n(692),O=n(0),T=n(33),x=n(1262),M=(n(1203),Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e});function D(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var P=new h.AllHtmlEntities,N={},L=l()({displayName:"ETBuilderControlUpload",mixins:[p.a],getInitialState:function(){return{isPreviewHover:!1}},_getDataType:function(){return m()(this.props.data_type)?"image":this.props.data_type},_hasPreview:function(){return"image"===this._getDataType()||"video"===this._getDataType()},render:function(){var e=this,t=this._hasPreview(),n=m()(this.props.value)?"":this.props.value,r=this.props.additional_attrs?this.props.additional_attrs:{},i={"et-fb-settings-option-inner":!0,"et-fb-settings-option-inner-upload":!0,"et-fb-settings-option-inner-upload--previewable":t},a={"et-fb-settings-option-input":!0,"et-fb-settings-option-upload":!0},s=_()(this,"props.module.props.module.props"),l="background_image"===_()(this,"props.name")&&w()(ETBuilderBackend.modulesFeaturedImageBackground,_()(s,"type"))&&O.default.isOn(_()(s,"attrs.featured_image"))&&"background"===_()(s,"attrs.featured_placement"),u="";if(this.props.className?a[this.props.className]=!0:(a["et-fb-main-setting"]=!0,a["regular-text"]=!0),_()(this,"props.attachment_id")&&O.default.hasValue(n)&&(n=_()(N,n,ETBuilderBackend.currentPage.thumbnailUrl)),l&&(n=ETBuilderBackend.currentPage.thumbnailUrl),t){var d,p={},h="";if(O.default.hasValue(n)){if("image"===this._getDataType())if("background"===_()(this,"props.toggle_slug","")){var g=_()(this,"props.imagePreviewAttrs",{});p.backgroundImage="url("+n+")",p.backgroundPosition=m()(g.position)?"":g.position.replace("_"," "),g.parallax?(p.backgroundRepeat="no-repeat",p.backgroundSize="cover",p.backgroundPosition="center"):(p.backgroundColor=g.color,p.backgroundBlendMode=g.blend,p.backgroundRepeat=g.repeat,p.backgroundSize=g.size,g.gradient&&(n&&(p.backgroundColor="initial"),O.default.isOn(g.gradientOverlaysImage)?p.backgroundImage=g.gradient+", url("+n+")":p.backgroundImage="url("+n+"), "+g.gradient))}else p.backgroundColor=S.a.uploadImagePreview,h=o.a.createElement("img",{src:n});"video"===this._getDataType()&&(h=o.a.createElement(x.a,{className:"et-fb-settings-option-preview-content",loop:"loop",muted:"muted",autoPlay:"autoplay",height:190,style:{width:"100%",background:"rgb(51, 59, 68)"},src:Object(C.d)({width:500,controls:0,fs:0,iv_load_policy:3,modestbranding:1,showinfo:0},n)}))}var v={opacity:this.state.isPreviewHover?Object(f.spring)(1,{stiffness:300,damping:20}):Object(f.spring)(0,{stiffness:300,damping:20}),scale:this.state.isPreviewHover?Object(f.spring)(1,{stiffness:300,damping:20}):Object(f.spring)(0,{stiffness:300,damping:20}),top:this.state.isPreviewHover?Object(f.spring)(20,{stiffness:300,damping:20}):Object(f.spring)(-10,{stiffness:300,damping:20})},y=!this.props.readonly&&o.a.createElement(f.Motion,{style:v},function(t){return O.default.hasValue(n)?o.a.createElement("button",{className:"et-fb-button et-fb-settings-option-edit",onClick:e._onClick,style:{opacity:O.default.hasValue(n)?t.opacity:1,transform:O.default.hasValue(n)?"scale( "+t.scale+" )":"",top:O.default.hasValue(n)?t.top:"50%"}},o.a.createElement(T.a,{icon:"setting",color:"#fff"})):o.a.createElement(E.a,{className:"et-fb-button et-fb-settings-option-add",stopPropagation:!0,__onClick:e._onClick,title:e.getAddTitle()})}),k=o.a.createElement(f.Motion,{style:v},function(t){return o.a.createElement("button",{className:"et-fb-button et-fb-settings-option-remove",onClick:e._onClickRemove,style:{opacity:O.default.hasValue(n)?t.opacity:1,transform:O.default.hasValue(n)?"scale( "+t.scale+" )":"",top:O.default.hasValue(n)?t.top:"50%"}},o.a.createElement(T.a,{icon:"delete",color:"#fff"}))}),P=O.default.hasValue(n)&&"image"!==this._getDataType()||l?b.a:this._onClick;u=o.a.createElement("div",{className:c()((d={"et-fb-settings-option-preview":!0},D(d,"et-fb-settings-option-upload-type-"+this._getDataType(),!0),D(d,"et-fb-settings-option-preview--empty",!O.default.hasValue(n)),d)),onClick:P,onMouseEnter:this._onPreviewMouseEnter,onMouseLeave:this._onPreviewMouseLeave,style:p},h,y,k)}return o.a.createElement("div",{className:c()(i)},u,o.a.createElement("input",M({className:c()(a),type:"text",value:n,name:this.props.name,id:"et-fb-"+this.props.name,onChange:this._onChange},r)),o.a.createElement("button",{className:"et-fb-settings-option-upload-button",onClick:this._onClick},ETBuilderBackend.i18n.controls.upload.buttonText))},_onChange:function(e){var t=e.target.value;this.props._onChange(this.props.name,t)},_onClick:function(t){if(!this.props.readonly){"function"==typeof t.preventDefault&&t.preventDefault(),"function"==typeof t.stopPropagation&&t.stopPropagation();var n,r=O.default.topWindow().wp.media,o=this,i=o.props;!0===this.props.hide_metadata&&e("body").addClass("et-bp-settings-option-upload-hide-metadata"),void 0===n?((n=r.frames.file_frame=new r.view.MediaFrame.ETSelect({title:P.decode(o.props.choose_text),library:{type:this._getDataType()},button:{text:P.decode(o.props.upload_button_text)},multiple:!1,embed:i.embed})).on("select",function(){var e=n.state().props.get("url");o.props._onChange(o.props.name,e)}),n.on("close",function(){e("body").removeClass("et-bp-settings-option-upload-hide-metadata")}),n.on("insert",function(){var e=_()(n.state().get("selection"),"models.0");if(!m()(e)){var t=e.get("url"),r=t;if(i.attachment_id){var o=e.get("id");N[o]=t,r=o}i._onChange(i.name,r)}}),n.open()):n.open()}},_onClickRemove:function(e){e.preventDefault(),e.stopPropagation(),this.props._onChange(this.props.name,"")},_onPreviewMouseEnter:function(e){this.setState({isPreviewHover:!0})},_onPreviewMouseLeave:function(e){this.setState({isPreviewHover:!1})},getAddTitle:function(){var e=ETBuilderBackend.i18n.controls.upload,t="video"===this._getDataType()?e.addVideo:e.addImage;return _()(this,"props.addTitle",t)}});L.propTypes={choose_text:a.a.string,upload_button_text:a.a.string,embed:a.a.bool,attachment_id:a.a.bool},L.defaultProps={choose_text:"",upload_button_text:"",embed:!0,attachment_id:!1},t.a=L}).call(this,n(28))},function(e,t,n){"use strict";n.d(t,"a",function(){return I}),n.d(t,"c",function(){return R}),n.d(t,"b",function(){return B}),n.d(t,"d",function(){return H});var r=n(194),o=n.n(r),i=n(131),a=n.n(i),s=n(693),l=n.n(s),u=n(688),c=n.n(u),d=n(686),p=n.n(d),f=n(689),h=n.n(f),g=n(737),m=n.n(g),v=n(1072),b=n.n(v),y=n(1092),_=n.n(y),k=n(1201),w=n.n(k),C=n(1202),S=n.n(C),E=n(251),O=n.n(E),T=n(1093),x=n.n(T),M=n(1094),D=n.n(M),P=n(1058),N=n.n(P),L=n(1095),F=n.n(L),A=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};var j=a()(_()("&"),b()(_()("=")),w.a),I=a()(function(e){return O()(e,"/")},h.a,p()("?"),c.a),R=a()(S.a,D()(a()(F()(N.a),h.a)),b()(p()("=")),p()("&"),m.a,p()("?"),c.a),B=o()(function(e,t){return l()(e,R(t))}),H=o()(function(e,t){return I(t)+"?"+j(A({},R(t),e))});o()(function(e,t,n){return H(function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},e,t),n)}),o()(function(e,t){return H(x()(e,R(t)),I(t))})},function(e,t,n){"use strict";var r=n(1),o=n.n(r),i=n(6),a=n.n(i),s=n(84),l=n.n(s),u=n(18),c=n.n(u),d=n(48),p=n.n(d),f=n(4),h=n.n(f),g=n(44),m=n.n(g),v=n(41),b=n.n(v),y=n(53),_=n.n(y),k=n(9),w=n.n(k),C=n(11),S=n.n(C),E=n(87),O=n.n(E),T=n(27),x=n.n(T),M=n(31),D=n.n(M),P=n(2),N=n.n(P),L=n(186),F=n.n(L),A=n(45),j=n.n(A),I=n(0),R=n(112),B=n(3),H=n(58),W=n(32),V=n.n(W),G=n(10),U=n(131),z=n.n(U),q=n(689),K=n.n(q),$=n(1059),X=n.n($),Y=n(1104),J=n(1085),Q=n(175),Z=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var ee=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r["Component"]),Z(t,[{key:"componentWillMount",value:function(){var e=this;this.sanitize=this.sanitize.bind(this),this.onChange=this.onChange.bind(this),this.onIncrease=this.onIncrease.bind(this),this.onDecrease=this.onDecrease.bind(this),this.sanitizeIncrease=z()(this.sanitize,function(t){return t+e.getStep()*(Object(R.e)()?10:1)}),this.sanitizeDecrease=z()(this.sanitize,function(t){return t-e.getStep()*(Object(R.e)()?10:1)}),this.getNumericValue=z()(parseFloat,this.sanitize,this.getValue)}},{key:"onChange",value:function(e){this.setUpdateSource(1),this.props.onChange(Object(J.a)(this.getDefaultUnit(),e,this.sanitize))}},{key:"onIncrease",value:function(){this.setUpdateSource(2),this.props.onChange(Object(J.a)(this.getDefaultUnit(),this.getValue(),this.sanitizeIncrease))}},{key:"onDecrease",value:function(){this.setUpdateSource(2),this.props.onChange(Object(J.a)(this.getDefaultUnit(),this.getValue(),this.sanitizeDecrease))}},{key:"sanitize",value:function(e){return Object(Q.f)(this.props.min,this.props.max,Object(Q.g)(Object(Q.b)(this.props.precision),e))}},{key:"getValue",value:function(){if(_()(this.props.isTransformOrigin))switch(this.props.value){case"center":return"50%";case"left":case"top":return"0%";case"right":case"bottom":return"100%"}return this.props.value||this.props.defaultValue||0}},{key:"getStep",value:function(){return this._step||this.props.step}},{key:"setUpdateSource",value:function(e){this._updateSource=[e,K()(this._updateSource||[void 0])];var t=this.getStep(),n=this.props.step,r=Object(Q.b)(this.getNumericValue()),o=r>Object(Q.b)(n)?Object(Q.h)(r,n):this.isSameSource()?t:n;this._step=o}},{key:"isSameSource",value:function(){var e=this._updateSource||[void 0,void 0];return K()(e)===X()(e)}},{key:"getDefaultUnit",value:function(){return Object(H.c)(this.props.defaultValue,this.props.defaultUnit)}},{key:"render",value:function(){return o.a.createElement(Y.a,{id:this.props.id,onChange:this.onChange,onIncrease:this.onIncrease,onDecrease:this.onDecrease,value:this.props.value,placeholder:this.props.defaultValue})}}]),t}();ee.propTypes={onChange:a.a.func.isRequired,step:a.a.number,precision:a.a.number,min:a.a.number,max:a.a.number,value:a.a.string,defaultValue:a.a.oneOfType([a.a.string,a.a.number]),isTransformOrigin:a.a.oneOfType([a.a.string,a.a.bool])},ee.defaultProps={step:1,precision:.01,min:-9999999999,max:9999999999,defaultValue:"",isTransformOrigin:!1};var te=ee,ne=(n(1166),n(15)),re=n(133),oe=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ie=re.a.instance(),ae="desktop";I.default.$appWindow().on("resize",m()(function(){ae=ie.getViewModeByWidth(I.default.$appWindow().width()),I.default.$appWindow().trigger("et_builder_range_resize")},400));var se=l()({displayName:"ETBuilderControlRange",mixins:[V.a],isChangingRange:!1,getRangeSettings:function(){return h()(this.props.range_settings)?{min:0,max:100,step:1}:this.props.range_settings},getInitialState:function(){var e=this._calculatePreviewMode(),t=N()(this.props,"value.activeTab","desktop"),n="wireframe"===e?t:e,r=this.getRangeSettings();return{activeTab:n,rangeMin:r.min,rangeMax:r.max,rangeStep:r.step,value:this.getValue(n),rangeFocus:!1}},componentDidMount:function(){var e=this.props.mobile_options?this.getValue(this.state.activeTab):this.props.value;this.deferredUpdate=m()(this.updateOptionAndState,700),b()(e)&&!h()(e.desktop)&&(e=e.desktop),parseFloat(this.state.rangeStep)>.1&&parseFloat(e)%1>0&&this.setState({rangeStep:"0.1"}),this.checkRangeBoundaries(this.state.value),this.hasMobileOptions()&&(this.updatePreviewMode=O()(this._onResize,500,{leading:!1}),I.default.$appWindow().on("et_builder_range_resize",this.updatePreviewMode),B.a.addPreviewModeListener(this._onPreviewModeChange))},componentDidUpdate:function(e){(this.props.previewMode&&this.props.previewMode!==e.previewMode||this.state.value!==e.value)&&this.setState({value:this.emptyIfDefault(this.getCurrentInputValue())})},componentWillUnmount:function(){this.deferredUpdate.cancel(),this.hasMobileOptions()&&(this.updatePreviewMode.cancel(),I.default.$appWindow().off("et_builder_range_resize",this.updatePreviewMode),B.a.removePreviewModeListener(this._onPreviewModeChange))},_calculatePreviewMode:function(){var e=B.a.getPreviewMode();return"zoom"===e?"desktop":"wireframe"===e?"wireframe":ae},_onResize:function(){var e=this.getValue("isResponsive")?this._calculatePreviewMode():"desktop";w()(["desktop","tablet","phone"],e)&&this.state.activeTab!==e&&this.setState({activeTab:e,value:this.getCurrentInputValue(e)})},_onPreviewModeChange:function(){var e=B.a.getPreviewMode(),t=function(e){switch(e){case"wireframe":case"zoom":case"desktop":return ne.a.isHoverMode()?"hover":"desktop";case"tablet":case"phone":return e;default:return"desktop"}}(e);this.state.activeTab!==e&&"wireframe"!==e&&this.setState({activeTab:t,value:this.getCurrentInputValue(t)})},getCurrentInputValue:function(e){var t="";if(_()(this.props.isTransformOrigin)){if("50%"===this.props.value)return"center";if("x"===this.props.isTransformOrigin){if("0%"===this.props.value)return"left";if("100%"===this.props.value)return"right"}else if("y"===this.props.isTransformOrigin){if("0%"===this.props.value)return"top";if("100%"===this.props.value)return"bottom"}}if(this.hasMobileOptions()){var n="desktop";this.getActiveTab("tablet")&&this.getValue("isResponsive")&&(n="tablet"),this.getActiveTab("phone")&&this.getValue("isResponsive")&&(n="phone"),t=this.getValue(n,e)}else t=this.props.value;return h()(t)||j()(t)||F()(t)?"":t},getDefaultValue:function(e){var t=N()(this,"props.allow_empty",!1)?void 0:0,n=N()(this,"props.additionalAttrs.getDefaultFrom",!1),r=N()(this,"props.default_values_mapping",!1),o=this.props.default;return n&&r&&(o=N()(r,n,o)),!h()(e)&&w()(["tablet","phone"],e)&&D()(this,"props.default_"+e)&&(o=N()(this,"props.default_"+e)),I.default.hasValue(o)?o:t},getDefaultUnit:function(){return Object(H.c)(this.getDefaultValue())},getValues:function(){var e=["desktop","tablet","phone"],t=this.props.value;return _()(t)?t:(S()(t,function(n,r){"activeTab"===r?t.activeTab=w()(e,n)?n:"desktop":t[r]=F()(n)||j()(n)?"":n}),t)},getValue:function(e){return N()(this.getValues(),e,"")},getActiveTab:function(e){var t="zoom"===this._calculatePreviewMode()?"desktop":N()(this,"state.activeTab");return this.hasResponsiveValue()?e===t:e===this.getValue("activeTab")},getPropsNameSuffix:function(){var e=this.state.activeTab;return!w()(["zoom","wireframe","desktop","hover"],e)&&this.hasResponsiveValue()?"_"+e:""},getPropsNameLastEdited:function(){return this.props.name+"_last_edited"},getPropsValueLastEdited:function(e,t){return(e?"on":"off")+"|"+(t=e?t:"desktop")},emptyIfDefault:function(e){return e===this.getDefaultValue(N()(this,"state.activeTab"))?"":e},isFixedUnit:function(){return I.default.hasValue(this.props.fixed_unit)},isValidateUnit:function(){return!1!==this.props.validate_unit},hasMobileOptions:function(){return I.default.hasValue(this.props.mobile_options)},hasResponsiveValue:function(){return this.hasMobileOptions()&&b()(this.props.value)&&this.props.value.isResponsive},validateValue:function(e){var t=this.getValue("activeTab"),n=this.hasMobileOptions()?this.getValue(t)||this.getDefaultValue(t):this.props.value||this.props.default,r=H.a.getUnit(this.isChangingRange?n:e,this.props.default_unit),o=this.isFixedUnit()?this.props.fixed_unit:r,i=this.isValidateUnit()&&!0!==this.props.unitless?o:"";return H.a.sanitizeInputUnit(x()(parseFloat(e)),!1,i)},toggleResponsive:function(e){e.preventDefault();var t=!this.getValue("isResponsive"),n=t?this.getValue("activeTab"):"desktop";t||(n="desktop"),"wireframe"!==this._calculatePreviewMode()?G.b.switchResponsiveMode(n):this.setState({activeTab:n}),this.props._onChange(this.getPropsNameLastEdited(),this.getPropsValueLastEdited(t,n))},reset:function(e){e.preventDefault(),this.updateOptionAndState("")},changeTab:function(e){var t=B.a.getActiveModule(),n=this.getValue("isResponsive"),r=e.target.getAttribute("data-tab"),o="hover"===r,i=this._calculatePreviewMode(),a=o?"desktop":r;G.b.toggleModuleHover(o),G.b.moduleSettingsChange(t,"hover_enabled",o?1:0),this.setState({activeTab:r,value:this.getCurrentInputValue(r)}),"wireframe"!==i&&G.b.switchResponsiveMode(a),o||this.props._onChange(this.getPropsNameLastEdited(),this.getPropsValueLastEdited(n,r))},onRangeFocus:function(){this.setState({rangeFocus:!0})},onRangeBlur:function(){this.setState({rangeFocus:!1})},inputsWrap:function(e){var t="et-fb-"+this.props.name,n=this.props.name,r=h()(this.getDefaultValue(e))?"0":this.getDefaultValue(e),i=this.getCurrentInputValue()===r?"":this.getCurrentInputValue(),a=""===i?r:i;if(_()(this.props.isTransformOrigin))switch(i){case"center":a=50;break;case"top":case"left":a=0;break;case"right":case"bottom":a=100}var s={};I.default.hasValue(this.getRangeSettings().min_limit)&&(s.min=parseFloat(this.getRangeSettings().min_limit)),I.default.hasValue(this.getRangeSettings().max_limit)&&(s.max=parseFloat(this.getRangeSettings().max_limit)),isNaN(parseFloat(a))&&(a=this.state.rangeMax);var l={};return l.onInput=this._updateFromRange,l.onChange=p.a,o.a.createElement("div",{className:"et-fb-settings-option-inputs-wrap"},o.a.createElement("input",oe({id:t,name:n,type:"range",min:this.state.rangeMin,max:this.state.rangeMax,step:this.getRangeStep(),className:"et-fb-range",value:parseFloat(a),"data-tab":e,"data-shortcuts-allowed":!0},l,{onFocus:this.onRangeFocus,onBlur:this.onRangeBlur})),o.a.createElement("div",{className:"et-fb-range-number et-fb-settings-option-input"},o.a.createElement(te,oe({id:t+"-number"},s,{value:i,"data-tab":e,onChange:this._onChange,defaultValue:r,defaultUnit:this.getDefaultUnit(),step:parseFloat(this.getRangeSettings().step),precision:this.props.precision,isTransformOrigin:this.props.isTransformOrigin}))))},render:function(){var e=this.getActiveTab("desktop")?"active":"",t=this.getActiveTab("tablet")?"active":"",n=this.getActiveTab("phone")?"active":"",r=this.getValue("isResponsive")?this.state.activeTab:"desktop",i=this.getDefaultValue(r),a=this.hasMobileOptions()?this.getValue(r):this.props.value,s=ETBuilderBackend.i18n.controls.responsiveTabs,l="",u="",d="",p="",f={"et-fb-settings-option-inner":!0,"et-fb-settings-option-inner-range":!0};if(this.hasMobileOptions()&&(f["et-fb-settings-option-inner-responsive"]=!0),this.getValue("isResponsive")&&(f["et-fb-settings-option-inner-responsive--active"]=!0),this.getValue("isResponsive")){var h=ne.a.getFieldBaseName(N()(this,"props.name","")),g=B.a.getActiveModule(),m=ne.a.isEnabled("props.attrs."+h,g),v=!0===B.a.getHoverMode()?"active":"",b=m?o.a.createElement("li",{className:v,"data-tab":"hover",onClick:this.changeTab},ETBuilderBackend.i18n.controls.tabs.hover):"",y=m?"et-fb-settings-option-responsive-tab-nav et-fb-settings-option-responsive-tab-nav-hover-active ":"et-fb-settings-option-responsive-tab-nav";"active"===v&&(e=""),l=o.a.createElement("ul",{className:y},o.a.createElement("li",{className:e,"data-tab":"desktop",onClick:this.changeTab},s.desktop),b,o.a.createElement("li",{className:t,"data-tab":"tablet",onClick:this.changeTab},s.tablet),o.a.createElement("li",{className:n,"data-tab":"phone",onClick:this.changeTab},s.phone))}return(this.getActiveTab("desktop")||this.getActiveTab("hover")||!this.hasResponsiveValue())&&(u=this.inputsWrap("desktop")),this.getActiveTab("tablet")&&this.getValue("isResponsive")&&(d=this.inputsWrap("tablet")),this.getActiveTab("phone")&&this.getValue("isResponsive")&&(p=this.inputsWrap("phone")),!a||a===i||this.props.readonly||this.props.disableReset||o.a.createElement("button",{className:"et-fb-settings-option-button--reset",onClick:this.reset}),o.a.createElement("div",{className:c()(f)},l,u,d,p)},updateOptionAndState:function(e){e=h()(e)?this.state.value:e;var t=this.validateValue(e);this.setState({value:this.emptyIfDefault(t)}),this.props._onChange(this.props.name+this.getPropsNameSuffix(),t,this.props.type)},_updateFromRange:function(e){this.props.readonly||(this.isChangingRange=!0,this.updateOptionAndState(e.target.value),this.isChangingRange=!1,this.checkAnimationReset())},_onChange:function(e){this.props.readonly||(this.updateOptionAndState(e),this.checkRangeBoundaries(e),this.checkAnimationReset())},checkAnimationReset:function(){var e=this._calculatePreviewMode();if(!1!==N()(this.props,"reset_animation",!1)&&"wireframe"!==e){var t=B.a.getActiveModule();if(t){var n=N()(t,"refs.module");if(n||(n=N()(t,"_row")),n||(n=N()(t,"_section")),n){var r=N()(t,"props.attrs.animation_style","none");if("none"!==r){var o=N()(t,"props.attrs.animation_direction","");"center"===o&&(o="");var i=r;""!==o&&"fade"!==i&&(i=i+o[0].toUpperCase()+o.slice(1)),n.classList.remove(i),setTimeout(function(){n.classList.add(i)},0);var a=B.a.getMultiSelectItemsData();S()(a,function(e){if(e.props.address!==t.props.address){var n=N()(e,"refs.module");n||(n=N()(e,"_row")),n||(n=N()(e,"_section")),n&&(n.classList.remove(i),setTimeout(function(){n.classList.add(i)},0))}})}}}}},checkRangeBoundaries:function(e){if(I.default.hasValue(e)){var t=parseFloat(e);!I.default.hasValue(this.getRangeSettings().max_limit)&&t>this.state.rangeMax&&this.setState({rangeMax:t}),!I.default.hasValue(this.getRangeSettings().min_limit)&&t<this.state.rangeMin&&this.setState({rangeMin:t}),parseFloat(this.state.rangeStep)>.1&&t%1>0?this.setState({rangeStep:"0.1"}):parseFloat(this.state.rangeStep)<1&&t%1==0&&this.setState({rangeStep:this.getRangeSettings().step})}},getRangeStep:function(){return parseFloat(this.state.rangeStep)*(this.state.rangeFocus&&Object(R.e)()?10:1)}});se.propTypes={default_unit:a.a.string,precision:a.a.number,name:a.a.string,value:a.a.oneOfType([a.a.string,a.a.object,a.a.array]),range_settings:a.a.object,mobile_options:a.a.bool,reset_animation:a.a.bool,previewMode:a.a.string,default:a.a.oneOfType([a.a.string,a.a.number]),default_tablet:a.a.string,default_phone:a.a.string,type:a.a.string,fixed_unit:a.a.string,validate_unit:a.a.bool,readonly:a.a.bool,_onChange:a.a.func,unitless:a.a.bool,isTransformOrigin:a.a.oneOfType([a.a.string,a.a.bool])},se.defaultProps={default_unit:"",isTransformOrigin:!1};t.a=se},function(e,t,n){"use strict";var r=n(1),o=n.n(r),i=n(91),a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var s=new i.AllHtmlEntities,l=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r["PureComponent"]),a(t,[{key:"render",value:function(){return o.a.createElement("option",{value:this.props.value},s.decode(this.props.name))}}]),t}();t.a=l},function(e,t,n){"use strict";var r=n(1),o=n.n(r),i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var a=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r["PureComponent"]),i(t,[{key:"render",value:function(){return o.a.createElement("optgroup",{label:this.props.label},this.props.children)}}]),t}();t.a=a},function(e,t,n){"use strict";var r=n(1),o=n.n(r),i=n(6),a=n.n(i),s=(n(17),n(32),n(10)),l=n(3),u=n(2),c=n.n(u),d=n(7),p=n.n(d),f=(n(36),function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}());var h={module:a.a.object,isResponsiveEnabled:a.a.bool,isHover:a.a.bool,fieldName:a.a.string,onChange:a.a.oneOfType([a.a.func,a.a.bool])},g=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n._setActiveTab=n._setActiveTab.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r["Component"]),f(t,[{key:"getModule",value:function(){return this.props.module}},{key:"getBulk",value:function(){var e,t,n,r=this.getModule(),o=c()(r,"props.address");return p()(r)?{}:l.a.isMultiItemSelected(o)?l.a.getMultiSelectItemsData():(n=r,(t=o)in(e={})?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e)}},{key:"_setActiveTab",value:function(e,t){t.preventDefault();var n="hover"===e,r=this.getModule(),o=c()(r,"props.address");s.b.toggleModuleHover(n),l.a.isMultiItemSelected(o)?s.b.multiSelectSettingsChange(r,"hover_enabled",!0===n?1:0):s.b.moduleSettingsChange(r,"hover_enabled",!0===n?1:0)}},{key:"render",value:function(){var e=this;if(!0===this.props.isResponsiveEnabled)return"";var t=l.a.getHoverMode(),n=!1===t?"et-fb-settings-tab-title et-fb-settings-tab-title-active":"et-fb-settings-tab-title",r=!0===t?"et-fb-settings-tab-title et-fb-settings-tab-title-active":"et-fb-settings-tab-title";return o.a.createElement("ul",{className:"et-fb-settings-tab-titles et-fb-settings-tab-titles-hover"},o.a.createElement("li",null,o.a.createElement("button",{className:n,onClick:function(t){return e._setActiveTab("default",t)}},ETBuilderBackend.i18n.controls.hoverOptions.default)),o.a.createElement("li",null,o.a.createElement("button",{className:r,onClick:function(t){return e._setActiveTab("hover",t)}},ETBuilderBackend.i18n.controls.hoverOptions.hover)))}}]),t}();g.propTypes=h,g.defaultProps={isResponsiveEnabled:!1,isHover:!1,fieldName:"",mobileOptions:!1,onChange:!1},t.a=g},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(e===t)return!0;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=Object.prototype.hasOwnProperty,i=0;i<n.length;i+=1){if(!o.call(t,n[i])||e[n[i]]!==t[n[i]])return!1;var a=e[n[i]],s=t[n[i]];if(a!==s)return!1}return!0}},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e){return Boolean(e&&"function"==typeof e.dispose)},e.exports=t.default},function(e,t,n){"use strict";n(1054);var r=n(1),o=n(6),i=n.n(o),a=n(1075),s=n(1147),l=n.n(s),u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var c=void 0;function d(){if(c)return c;var e=window.top||window;return c=new a.DragDropManager(l.a,{window:e})}var p=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r["Component"]),u(t,[{key:"getChildContext",value:function(){return{dragDropManager:d()}}},{key:"render",value:function(){return React.createElement("div",null,this.props.children)}}]),t}();p.childContextTypes={dragDropManager:i.a.object.isRequired},t.a=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.FILE="__NATIVE_FILE__",t.URL="__NATIVE_URL__",t.TEXT="__NATIVE_TEXT__"},function(e,t,n){ // CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE !function(e){"use strict";var t,n,r=e.Pos;function o(e){return e.global?e:new RegExp(e.source,function(e){var t=e.flags;return null!=t?t:(e.ignoreCase?"i":"")+(e.global?"g":"")+(e.multiline?"m":"")}(e)+"g")}function i(e,t,n){t=o(t);for(var i=n.line,a=n.ch,s=e.lastLine();i<=s;i++,a=0){t.lastIndex=a;var l=e.getLine(i),u=t.exec(l);if(u)return{from:r(i,u.index),to:r(i,u.index+u[0].length),match:u}}}function a(e,t){for(var n,r=0;;){t.lastIndex=r;var o=t.exec(e);if(!o)return n;if((r=(n=o).index+(n[0].length||1))==e.length)return n}}function s(e,t,n,r){if(e.length==t.length)return n;for(var o=0,i=n+Math.max(0,e.length-t.length);;){if(o==i)return o;var a=o+i>>1,s=r(e.slice(0,a)).length;if(s==n)return a;s>n?i=a:o=a+1}}function l(e,l,u,c){var d;this.atOccurrence=!1,this.doc=e,u=u?e.clipPos(u):r(0,0),this.pos={from:u,to:u},"object"==typeof c?d=c.caseFold:(d=c,c=null),"string"==typeof l?(null==d&&(d=!1),this.matches=function(o,i){return(o?function(e,o,i,a){if(!o.length)return null;var l=a?t:n,u=l(o).split(/\r|\n\r?/);e:for(var c=i.line,d=i.ch,p=e.firstLine()-1+u.length;c>=p;c--,d=-1){var f=e.getLine(c);d>-1&&(f=f.slice(0,d));var h=l(f);if(1==u.length){var g=h.lastIndexOf(u[0]);if(-1==g)continue e;return{from:r(c,s(f,h,g,l)),to:r(c,s(f,h,g+u[0].length,l))}}var m=u[u.length-1];if(h.slice(0,m.length)==m){for(var v=1,i=c-u.length+1;v<u.length-1;v++)if(l(e.getLine(i+v))!=u[v])continue e;var b=e.getLine(c+1-u.length),y=l(b);if(y.slice(y.length-u[0].length)==u[0])return{from:r(c+1-u.length,s(b,y,b.length-u[0].length,l)),to:r(c,s(f,h,m.length,l))}}}}:function(e,o,i,a){if(!o.length)return null;var l=a?t:n,u=l(o).split(/\r|\n\r?/);e:for(var c=i.line,d=i.ch,p=e.lastLine()+1-u.length;c<=p;c++,d=0){var f=e.getLine(c).slice(d),h=l(f);if(1==u.length){var g=h.indexOf(u[0]);if(-1==g)continue e;var i=s(f,h,g,l)+d;return{from:r(c,s(f,h,g,l)+d),to:r(c,s(f,h,g+u[0].length,l)+d)}}var m=h.length-u[0].length;if(h.slice(m)==u[0]){for(var v=1;v<u.length-1;v++)if(l(e.getLine(c+v))!=u[v])continue e;var b=e.getLine(c+u.length-1),y=l(b),_=u[u.length-1];if(y.slice(0,_.length)==_)return{from:r(c,s(f,h,m,l)+d),to:r(c+u.length-1,s(b,y,_.length,l))}}}})(e,l,i,d)}):(l=o(l),c&&!1===c.multiline?this.matches=function(t,n){return(t?function(e,t,n){t=o(t);for(var i=n.line,s=n.ch,l=e.firstLine();i>=l;i--,s=-1){var u=e.getLine(i);s>-1&&(u=u.slice(0,s));var c=a(u,t);if(c)return{from:r(i,c.index),to:r(i,c.index+c[0].length),match:c}}}:i)(e,l,n)}:this.matches=function(t,n){return(t?function(e,t,n){t=o(t);for(var i,s=1,l=n.line,u=e.firstLine();l>=u;){for(var c=0;c<s;c++){var d=e.getLine(l--);i=null==i?d.slice(0,n.ch):d+"\n"+i}s*=2;var p=a(i,t);if(p){var f=i.slice(0,p.index).split("\n"),h=p[0].split("\n"),g=l+f.length,m=f[f.length-1].length;return{from:r(g,m),to:r(g+h.length-1,1==h.length?m+h[0].length:h[h.length-1].length),match:p}}}}:function(e,t,n){if(!function(e){return/\\s|\\n|\n|\\W|\\D|\[\^/.test(e.source)}(t))return i(e,t,n);t=o(t);for(var a,s=1,l=n.line,u=e.lastLine();l<=u;){for(var c=0;c<s;c++){var d=e.getLine(l++);a=null==a?d:a+"\n"+d}s*=2,t.lastIndex=n.ch;var p=t.exec(a);if(p){var f=a.slice(0,p.index).split("\n"),h=p[0].split("\n"),g=n.line+f.length-1,m=f[f.length-1].length;return{from:r(g,m),to:r(g+h.length-1,1==h.length?m+h[0].length:h[h.length-1].length),match:p}}}})(e,l,n)})}String.prototype.normalize?(t=function(e){return e.normalize("NFD").toLowerCase()},n=function(e){return e.normalize("NFD")}):(t=function(e){return e.toLowerCase()},n=function(e){return e}),l.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(t){for(var n=this.matches(t,this.doc.clipPos(t?this.pos.from:this.pos.to));n&&0==e.cmpPos(n.from,n.to);)t?n.from.ch?n.from=r(n.from.line,n.from.ch-1):n=n.from.line==this.doc.firstLine()?null:this.matches(t,this.doc.clipPos(r(n.from.line-1))):n.to.ch<this.doc.getLine(n.to.line).length?n.to=r(n.to.line,n.to.ch+1):n=n.to.line==this.doc.lastLine()?null:this.matches(t,r(n.to.line+1,0));if(n)return this.pos=n,this.atOccurrence=!0,this.pos.match||!0;var o=r(t?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:o,to:o},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(t,n){if(this.atOccurrence){var o=e.splitLines(t);this.doc.replaceRange(o,this.pos.from,this.pos.to,n),this.pos.to=r(this.pos.from.line+o.length-1,o[o.length-1].length+(1==o.length?this.pos.from.ch:0))}}},e.defineExtension("getSearchCursor",function(e,t,n){return new l(this.doc,e,t,n)}),e.defineDocExtension("getSearchCursor",function(e,t,n){return new l(this,e,t,n)}),e.defineExtension("selectMatches",function(t,n){for(var r=[],o=this.getSearchCursor(t,this.getCursor("from"),n);o.findNext()&&!(e.cmpPos(o.to(),this.getCursor("to"))>0);)r.push({anchor:o.from(),head:o.to()});r.length&&this.setSelections(r,0)})}(n(1047))},function(e,t,n){ // CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE !function(e){"use strict";function t(e){for(var t={},n=0;n<e.length;++n)t[e[n].toLowerCase()]=!0;return t}e.defineMode("css",function(t,n){var r=n.inline;n.propertyKeywords||(n=e.resolveMode("text/css"));var o,i,a=t.indentUnit,s=n.tokenHooks,l=n.documentTypes||{},u=n.mediaTypes||{},c=n.mediaFeatures||{},d=n.mediaValueKeywords||{},p=n.propertyKeywords||{},f=n.nonStandardPropertyKeywords||{},h=n.fontProperties||{},g=n.counterDescriptors||{},m=n.colorKeywords||{},v=n.valueKeywords||{},b=n.allowNested,y=n.lineComment,_=!0===n.supportsAtComponent;function k(e,t){return o=t,e}function w(e){return function(t,n){for(var r,o=!1;null!=(r=t.next());){if(r==e&&!o){")"==e&&t.backUp(1);break}o=!o&&"\\"==r}return(r==e||!o&&")"!=e)&&(n.tokenize=null),k("string","string")}}function C(e,t){return e.next(),e.match(/\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=w(")"),k(null,"(")}function S(e,t,n){this.type=e,this.indent=t,this.prev=n}function E(e,t,n,r){return e.context=new S(n,t.indentation()+(!1===r?0:a),e.context),n}function O(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function T(e,t,n){return D[n.context.type](e,t,n)}function x(e,t,n,r){for(var o=r||1;o>0;o--)n.context=n.context.prev;return T(e,t,n)}function M(e){var t=e.current().toLowerCase();i=v.hasOwnProperty(t)?"atom":m.hasOwnProperty(t)?"keyword":"variable"}var D={top:function(e,t,n){if("{"==e)return E(n,t,"block");if("}"==e&&n.context.prev)return O(n);if(_&&/@component/i.test(e))return E(n,t,"atComponentBlock");if(/^@(-moz-)?document$/i.test(e))return E(n,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(e))return E(n,t,"atBlock");if(/^@(font-face|counter-style)/i.test(e))return n.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return E(n,t,"at");if("hash"==e)i="builtin";else if("word"==e)i="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return E(n,t,"interpolation");if(":"==e)return"pseudo";if(b&&"("==e)return E(n,t,"parens")}return n.context.type},block:function(e,t,n){if("word"==e){var r=t.current().toLowerCase();return p.hasOwnProperty(r)?(i="property","maybeprop"):f.hasOwnProperty(r)?(i="string-2","maybeprop"):b?(i=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(i+=" error","maybeprop")}return"meta"==e?"block":b||"hash"!=e&&"qualifier"!=e?D.top(e,t,n):(i="error","block")},maybeprop:function(e,t,n){return":"==e?E(n,t,"prop"):T(e,t,n)},prop:function(e,t,n){if(";"==e)return O(n);if("{"==e&&b)return E(n,t,"propBlock");if("}"==e||"{"==e)return x(e,t,n);if("("==e)return E(n,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(t.current())){if("word"==e)M(t);else if("interpolation"==e)return E(n,t,"interpolation")}else i+=" error";return"prop"},propBlock:function(e,t,n){return"}"==e?O(n):"word"==e?(i="property","maybeprop"):n.context.type},parens:function(e,t,n){return"{"==e||"}"==e?x(e,t,n):")"==e?O(n):"("==e?E(n,t,"parens"):"interpolation"==e?E(n,t,"interpolation"):("word"==e&&M(t),"parens")},pseudo:function(e,t,n){return"meta"==e?"pseudo":"word"==e?(i="variable-3",n.context.type):T(e,t,n)},documentTypes:function(e,t,n){return"word"==e&&l.hasOwnProperty(t.current())?(i="tag",n.context.type):D.atBlock(e,t,n)},atBlock:function(e,t,n){if("("==e)return E(n,t,"atBlock_parens");if("}"==e||";"==e)return x(e,t,n);if("{"==e)return O(n)&&E(n,t,b?"block":"top");if("interpolation"==e)return E(n,t,"interpolation");if("word"==e){var r=t.current().toLowerCase();i="only"==r||"not"==r||"and"==r||"or"==r?"keyword":u.hasOwnProperty(r)?"attribute":c.hasOwnProperty(r)?"property":d.hasOwnProperty(r)?"keyword":p.hasOwnProperty(r)?"property":f.hasOwnProperty(r)?"string-2":v.hasOwnProperty(r)?"atom":m.hasOwnProperty(r)?"keyword":"error"}return n.context.type},atComponentBlock:function(e,t,n){return"}"==e?x(e,t,n):"{"==e?O(n)&&E(n,t,b?"block":"top",!1):("word"==e&&(i="error"),n.context.type)},atBlock_parens:function(e,t,n){return")"==e?O(n):"{"==e||"}"==e?x(e,t,n,2):D.atBlock(e,t,n)},restricted_atBlock_before:function(e,t,n){return"{"==e?E(n,t,"restricted_atBlock"):"word"==e&&"@counter-style"==n.stateArg?(i="variable","restricted_atBlock_before"):T(e,t,n)},restricted_atBlock:function(e,t,n){return"}"==e?(n.stateArg=null,O(n)):"word"==e?(i="@font-face"==n.stateArg&&!h.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==n.stateArg&&!g.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},keyframes:function(e,t,n){return"word"==e?(i="variable","keyframes"):"{"==e?E(n,t,"top"):T(e,t,n)},at:function(e,t,n){return";"==e?O(n):"{"==e||"}"==e?x(e,t,n):("word"==e?i="tag":"hash"==e&&(i="builtin"),"at")},interpolation:function(e,t,n){return"}"==e?O(n):"{"==e||";"==e?x(e,t,n):("word"==e?i="variable":"variable"!=e&&"("!=e&&")"!=e&&(i="error"),"interpolation")}};return{startState:function(e){return{tokenize:null,state:r?"block":"top",stateArg:null,context:new S(r?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var n=(t.tokenize||function(e,t){var n=e.next();if(s[n]){var r=s[n](e,t);if(!1!==r)return r}return"@"==n?(e.eatWhile(/[\w\\\-]/),k("def",e.current())):"="==n||("~"==n||"|"==n)&&e.eat("=")?k(null,"compare"):'"'==n||"'"==n?(t.tokenize=w(n),t.tokenize(e,t)):"#"==n?(e.eatWhile(/[\w\\\-]/),k("atom","hash")):"!"==n?(e.match(/^\s*\w*/),k("keyword","important")):/\d/.test(n)||"."==n&&e.eat(/\d/)?(e.eatWhile(/[\w.%]/),k("number","unit")):"-"!==n?/[,+>*\/]/.test(n)?k(null,"select-op"):"."==n&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?k("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(n)?k(null,n):("u"==n||"U"==n)&&e.match(/rl(-prefix)?\(/i)||("d"==n||"D"==n)&&e.match("omain(",!0,!0)||("r"==n||"R"==n)&&e.match("egexp(",!0,!0)?(e.backUp(1),t.tokenize=C,k("property","word")):/[\w\\\-]/.test(n)?(e.eatWhile(/[\w\\\-]/),k("property","word")):k(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),k("number","unit")):e.match(/^-[\w\\\-]+/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?k("variable-2","variable-definition"):k("variable-2","variable")):e.match(/^\w+-/)?k("meta","meta"):void 0})(e,t);return n&&"object"==typeof n&&(o=n[1],n=n[0]),i=n,"comment"!=o&&(t.state=D[t.state](o,e,t)),i},indent:function(e,t){var n=e.context,r=t&&t.charAt(0),o=n.indent;return"prop"!=n.type||"}"!=r&&")"!=r||(n=n.prev),n.prev&&("}"!=r||"block"!=n.type&&"top"!=n.type&&"interpolation"!=n.type&&"restricted_atBlock"!=n.type?(")"!=r||"parens"!=n.type&&"atBlock_parens"!=n.type)&&("{"!=r||"at"!=n.type&&"atBlock"!=n.type)||(o=Math.max(0,n.indent-a)):(n=n.prev,o=n.indent)),o},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:y,fold:"brace"}});var n=["domain","regexp","url","url-prefix"],r=t(n),o=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],i=t(o),a=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover"],s=t(a),l=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive"],u=t(l),c=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],d=t(c),p=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],f=t(p),h=t(["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),g=t(["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"]),m=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],v=t(m),b=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],y=t(b),_=n.concat(o).concat(a).concat(l).concat(c).concat(p).concat(m).concat(b);function k(e,t){for(var n,r=!1;null!=(n=e.next());){if(r&&"/"==n){t.tokenize=null;break}r="*"==n}return["comment","comment"]}e.registerHelper("hintWords","css",_),e.defineMIME("text/css",{documentTypes:r,mediaTypes:i,mediaFeatures:s,mediaValueKeywords:u,propertyKeywords:d,nonStandardPropertyKeywords:f,fontProperties:h,counterDescriptors:g,colorKeywords:v,valueKeywords:y,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=k,k(e,t))}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:i,mediaFeatures:s,mediaValueKeywords:u,propertyKeywords:d,nonStandardPropertyKeywords:f,colorKeywords:v,valueKeywords:y,fontProperties:h,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=k,k(e,t)):["operator","operator"]},":":function(e){return!!e.match(/\s*\{/,!1)&&[null,null]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:i,mediaFeatures:s,mediaValueKeywords:u,propertyKeywords:d,nonStandardPropertyKeywords:f,colorKeywords:v,valueKeywords:y,fontProperties:h,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=k,k(e,t)):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),e.defineMIME("text/x-gss",{documentTypes:r,mediaTypes:i,mediaFeatures:s,propertyKeywords:d,nonStandardPropertyKeywords:f,fontProperties:h,counterDescriptors:g,colorKeywords:v,valueKeywords:y,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=k,k(e,t))}},name:"css",helperType:"gss"})}(n(1047))},function(e,t,n){var r=n(167)("map",n(36));r.placeholder=n(155),e.exports=r},function(e,t,n){},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unpackBackendForEs5Users=t.createChildContext=t.CHILD_CONTEXT_TYPES=void 0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.default=function(e){p.default.apply(void 0,["DragDropContext","backend"].concat(Array.prototype.slice.call(arguments)));var t=m(e),n=g(t);return function(e){var t,i,l=e.displayName||e.name||"Component",u=(i=t=function(t){function i(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(i.__proto__||Object.getPrototypeOf(i)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(i,t),o(i,[{key:"getDecoratedComponentInstance",value:function(){return(0,c.default)(this.child,"In order to access an instance of the decorated component it can not be a stateless component."),this.child}},{key:"getManager",value:function(){return n.dragDropManager}},{key:"getChildContext",value:function(){return n}},{key:"render",value:function(){var t=this;return s.default.createElement(e,r({},this.props,{ref:function(e){t.child=e}}))}}]),i}(a.Component),t.DecoratedComponent=e,t.displayName="DragDropContext("+l+")",t.childContextTypes=h,i);return(0,d.default)(u,e)}};var a=n(1),s=f(a),l=f(n(6)),u=n(1075),c=f(n(1048)),d=f(n(697)),p=f(n(1057));function f(e){return e&&e.__esModule?e:{default:e}}var h=t.CHILD_CONTEXT_TYPES={dragDropManager:l.default.object.isRequired},g=t.createChildContext=function(e,t){return{dragDropManager:new u.DragDropManager(e,t)}},m=t.unpackBackendForEs5Users=function(e){var t=e;return"object"===(void 0===t?"undefined":i(t))&&"function"==typeof t.default&&(t=t.default),(0,c.default)("function"==typeof t,"Expected the backend to be a function or an ES6 module exporting a default function. Read more: http://react-dnd.github.io/react-dnd/docs-drag-drop-context.html"),t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1113);Object.defineProperty(t,"DragDropManager",{enumerable:!0,get:function(){return s(r).default}});var o=n(1127);Object.defineProperty(t,"DragSource",{enumerable:!0,get:function(){return s(o).default}});var i=n(1128);Object.defineProperty(t,"DropTarget",{enumerable:!0,get:function(){return s(i).default}});var a=n(1129);function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"createTestBackend",{enumerable:!0,get:function(){return s(a).default}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i,t=arguments[1];switch(t.type){case o.BEGIN_DRAG:return{initialSourceClientOffset:t.sourceClientOffset,initialClientOffset:t.clientOffset,clientOffset:t.clientOffset};case o.HOVER:return function(e,t){if(e===t)return!0;return e&&t&&e.x===t.x&&e.y===t.y}(e.clientOffset,t.clientOffset)?e:r({},e,{clientOffset:t.clientOffset});case o.END_DRAG:case o.DROP:return i;default:return e}},t.getSourceClientOffset=function(e){var t=e.clientOffset,n=e.initialClientOffset,r=e.initialSourceClientOffset;if(!t||!n||!r)return null;return{x:t.x+r.x-n.x,y:t.y+r.y-n.y}},t.getDifferenceFromInitialOffset=function(e){var t=e.clientOffset,n=e.initialClientOffset;if(!t||!n)return null;return{x:t.x-n.x,y:t.y-n.y}};var o=n(1055),i={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return(0,i.default)(e)?e.some(function(e){return e===t}):e===t};var r,o=n(19),i=(r=o)&&r.__esModule?r:{default:r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];var e=arguments[1],t=arguments[2];switch(e.type){case i.HOVER:break;case a.ADD_SOURCE:case a.ADD_TARGET:case a.REMOVE_TARGET:case a.REMOVE_SOURCE:return l;case i.BEGIN_DRAG:case i.PUBLISH_DRAG_SOURCE:case i.END_DRAG:case i.DROP:default:return u}var n=e.targetIds,o=t.targetIds,s=(0,r.default)(n,o),c=!1;if(0===s.length){for(var d=0;d<n.length;d++)if(n[d]!==o[d]){c=!0;break}}else c=!0;if(!c)return l;var p=o[o.length-1],f=n[n.length-1];p!==f&&(p&&s.push(p),f&&s.push(f));return s},t.areDirty=function(e,t){if(e===l)return!1;if(e===u||void 0===t)return!0;return(0,o.default)(t,e).length>0};var r=s(n(509)),o=s(n(76)),i=n(1055),a=n(1056);function s(e){return e&&e.__esModule?e:{default:e}}var l=[],u=[]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.default=function(e,t){if(e===t)return!0;if("object"!==(void 0===e?"undefined":r(e))||null===e||"object"!==(void 0===t?"undefined":r(t))||null===t)return!1;var n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(var i=Object.prototype.hasOwnProperty,a=0;a<n.length;a+=1){if(!i.call(t,n[a]))return!1;var s=e[n[a]],l=t[n[a]];if(s!==l||"object"===(void 0===s?"undefined":r(s))||"object"===(void 0===l?"undefined":r(l)))return!1}return!0}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t.default=function(e){var t,n,h=e.DecoratedComponent,g=e.createHandler,m=e.createMonitor,v=e.createConnector,b=e.registerHandler,y=e.containerDisplayName,_=e.getType,k=e.collect,w=e.options.arePropsEqual,C=void 0===w?f.default:w,S=h.displayName||h.name||"Component",E=(n=t=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r.handleChange=r.handleChange.bind(r),r.handleChildRef=r.handleChildRef.bind(r),(0,c.default)("object"===o(r.context.dragDropManager),"Could not find the drag and drop manager in the context of %s. Make sure to wrap the top-level component of your app with DragDropContext. Read more: http://react-dnd.github.io/react-dnd/docs-troubleshooting.html#could-not-find-the-drag-and-drop-manager-in-the-context",S,S),r.manager=r.context.dragDropManager,r.handlerMonitor=m(r.manager),r.handlerConnector=v(r.manager.getBackend()),r.handler=g(r.handlerMonitor),r.disposable=new u.SerialDisposable,r.receiveProps(e),r.state=r.getCurrentState(),r.dispose(),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"getHandlerId",value:function(){return this.handlerId}},{key:"getDecoratedComponentInstance",value:function(){return this.decoratedComponentInstance}},{key:"shouldComponentUpdate",value:function(e,t){return!C(e,this.props)||!(0,p.default)(t,this.state)}}]),i(t,[{key:"componentDidMount",value:function(){this.isCurrentlyMounted=!0,this.disposable=new u.SerialDisposable,this.currentType=null,this.receiveProps(this.props),this.handleChange()}},{key:"componentWillReceiveProps",value:function(e){C(e,this.props)||(this.receiveProps(e),this.handleChange())}},{key:"componentWillUnmount",value:function(){this.dispose(),this.isCurrentlyMounted=!1}},{key:"receiveProps",value:function(e){this.handler.receiveProps(e),this.receiveType(_(e))}},{key:"receiveType",value:function(e){if(e!==this.currentType){this.currentType=e;var t=b(e,this.handler,this.manager),n=t.handlerId,r=t.unregister;this.handlerId=n,this.handlerMonitor.receiveHandlerId(n),this.handlerConnector.receiveHandlerId(n);var o=this.manager.getMonitor(),i=o.subscribeToStateChange(this.handleChange,{handlerIds:[n]});this.disposable.setDisposable(new u.CompositeDisposable(new u.Disposable(i),new u.Disposable(r)))}}},{key:"handleChange",value:function(){if(this.isCurrentlyMounted){var e=this.getCurrentState();(0,p.default)(e,this.state)||this.setState(e)}}},{key:"dispose",value:function(){this.disposable.dispose(),this.handlerConnector.receiveHandlerId(null)}},{key:"handleChildRef",value:function(e){this.decoratedComponentInstance=e,this.handler.receiveComponent(e)}},{key:"getCurrentState",value:function(){var e=k(this.handlerConnector.hooks,this.handlerMonitor);return e}},{key:"render",value:function(){return s.default.createElement(h,r({},this.props,this.state,{ref:this.handleChildRef}))}}]),t}(a.Component),t.DecoratedComponent=h,t.displayName=y+"("+S+")",t.contextTypes={dragDropManager:l.default.object.isRequired},n);return(0,d.default)(E,h)};var a=n(1),s=h(a),l=h(n(6)),u=n(1133),c=(h(n(176)),h(n(1048))),d=h(n(697)),p=h(n(1066)),f=h(n(1079));function h(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t={};return Object.keys(e).forEach(function(n){var r=function(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if((0,o.isValidElement)(t)){var r=t;!function(e){if("string"!=typeof e.type){var t=e.type.displayName||e.type.name||"the component";throw new Error("Only native element nodes can now be passed to React DnD connectors.You can either wrap "+t+" into a <div>, or turn it into a drag source or a drop target itself.")}}(r);var i=n?function(t){return e(t,n)}:e;return(0,a.default)(r,i)}var s=t;e(s,n)}}(e[n]);t[n]=function(){return r}}),t};var r,o=n(1),i=n(1141),a=(r=i)&&r.__esModule?r:{default:r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(t===e)return!0;return null!==t&&null!==e&&(0,i.default)(t,e)};var r,o=n(1066),i=(r=o)&&r.__esModule?r:{default:r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.default=function e(t,n){return"string"==typeof t||"symbol"===(void 0===t?"undefined":r(t))||n&&(0,a.default)(t)&&t.every(function(t){return e(t,!1)})};var o,i=n(19),a=(o=i)&&o.__esModule?o:{default:o}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isSafari=t.isFirefox=void 0;var r,o=n(174),i=(r=o)&&r.__esModule?r:{default:r};t.isFirefox=(0,i.default)(function(){return/firefox/i.test(navigator.userAgent)}),t.isSafari=(0,i.default)(function(){return Boolean(window.safari)})},function(e,t,n){"use strict";var r=n(194),o=n.n(r),i=n(1162),a=n.n(i),s=n(58),l=n(175),u=o()(function(e,t){return Object(s.f)(t,void 0,e)});t.a=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a.a;return void 0!==Object(l.d)(t)?u(Object(s.c)(t,e),n(function(e){return Object(l.d)(e,0)}(t))):""}},function(e,t,n){"use strict";var r=n(1),o=n.n(r),i=n(6),a=n.n(i),s=n(32),l=n.n(s),u=n(36),c=n.n(u),d=n(9),p=n.n(d),f=n(7),h=n.n(f),g=n(4),m=n.n(g),v=n(27),b=n.n(v),y=n(231),_=n.n(y),k=n(76),w=n.n(k),C=n(138),S=n.n(C),E=n(2),O=n.n(E),T=n(59),x=n.n(T),M=n(74),D=n.n(M),P=n(91),N=n(3),L=(n(1165),function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}());var F=new P.AllHtmlEntities,A=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.shouldComponentUpdate=l.a.shouldComponentUpdate.bind(n),n._onChange=n._onChange.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r["Component"]),L(t,[{key:"render",value:function(){var e=this,t=S()(this._getCategories()),n=N.a.getTaxonomyLabels(this._getTermName()),r=this.props.value,i=m()(r)?[]:r.split(","),a=[];return h()(t)||(a=t.map(function(t,n){if(h()(t))return!1;var r="select-category-"+O()(e.props,"module.props.module.props.shortcut_index",e._getTermName())+"-"+t.term_id;return!h()(t)&&o.a.createElement("p",{key:r},o.a.createElement("label",{htmlFor:r},o.a.createElement("input",{type:"checkbox",id:r,name:"et_fb_select_category["+n+"]",value:t.term_id,onChange:e._onChange,checked:p()(i,t.term_id.toString())})," ",t.name))})),h()(D()(a))&&(a=[]),h()(D()(a))&&(a=m()(n.not_found)?"":F.decode(n.not_found)),o.a.createElement("div",{className:"et-fb-checkboxes-category-wrap"},a)}},{key:"_getTermName",value:function(){return O()(this.props,"renderer_options.use_terms",!1)?O()(this.props,"renderer_options.term_name"):this.props.taxonomy_name}},{key:"_getCategories",value:function(){var e=N.a.getTaxonomy(this._getTermName()),t=O()(this.props,"renderer_options.custom_items",[]);return x()(t,this._getMetaCategories(),e)}},{key:"_useMetaCategories",value:function(){return!m()(this.props.meta_categories)&&!h()(this.props.meta_categories)}},{key:"_getMetaCategories",value:function(){return this._useMetaCategories()?c()(this.props.meta_categories,function(e,t){return{term_id:t,name:e}}):[]}},{key:"_onChange",value:function(e){var t=this.props.value,n=this._getCategories(),r=c()(n,function(e){return b()(e.term_id)}),o=e.target.checked,i=b()(e.target.value),a=m()(t)?[]:t.split(",");o?h()(a)?a=[i]:a.push(i):a=_()(a,function(e){return e!==i});var s=w()(a,r);this.props._onChange(this.props.name,s.join(","))}}]),t}();A.propTypes={taxonomy_name:a.a.string,value:a.a.string,_onChange:a.a.func},t.a=A},function(e,t,n){"use strict";var r=n(1),o=n.n(r),i=n(84),a=n.n(i),s=n(18),l=n.n(s),u=n(32),c=n.n(u),d=n(48),p=n.n(d),f=n(4),h=n.n(f),g=n(87),m=n.n(g),v=n(2),b=n.n(v),y=n(10),_=(n(1167),Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}),k=a()({displayName:"ETBuilderControlTextarea",mixins:[c.a],getInitialState:function(){return this.isEditing=!1,this.getNewState()},getModuleAddres:function(){return b()(this,"props.module.props.module.props.address")},getNewState:function(){var e=this.props.is_fb_content?this.props.content:this.props.value;return{value:this.processValue(e),id:this.getModuleAddres()}},componentDidMount:function(){this.saveValue=m()(this.updateOptionValue,0,{leading:!1})},componentDidUpdate:function(){this.getModuleAddres()!==this.state.id&&this.setState(this.getNewState())},componentWillReceiveProps:function(e){if(this.isEditing)this.isEditing=!1;else{var t=this.props,n=t.is_fb_content?t.content:t.value,r=t.is_fb_content?e.content:e.value;n!=r&&this.setState({value:this.processValue(r)})}},processValue:function(e){return"string"!=typeof e||e?("raw_content"===this.props.name&&(e=e.split("\x3c!-- [et_pb_line_break_holder] --\x3e").join("\n")),"custom_message"!==this.props.name||h()(e)||(e=e.split("||et_pb_line_break_holder||").join("\r\n")),e):new String("")},render:function(){var e=this.props.additional_attrs?this.props.additional_attrs:{},t={"et-fb-settings-option-textarea":!0};return this.props.className?t[this.props.className]=!0:(t["et-fb-main-setting"]=!0,t["regular-text"]=!0),o.a.createElement("textarea",_({className:l()(t),value:this.state.value,name:this.props.name,id:"et-fb-"+this.props.name,onChange:p.a,onInput:this._onInput,onFocus:this._onFocus,onBlur:this._onBlur},e))},_onInput:function(e){var t=e.target.value;this.setState({value:this.processValue(t)}),this.saveValue.cancel(),this.saveValue()},_onFocus:function(){(this.props.module||this.props.isPageSetting)&&y.b.settingFieldFocused(this)},_onBlur:function(){(this.props.module||this.props.isPageSetting)&&y.b.settingFieldFocused(!1)},updateOptionValue:function(){var e=this.state.value;this.isEditing=!0,this.props._onChange(this.props.name,e,this.props.type)}});t.a=k},function(e,t,n){"use strict";(function(e){var r=n(1168),o=n(1),i=n.n(o),a=n(6),s=n.n(a),l=n(48),u=n.n(l),c=n(7),d=n.n(c),p=n(53),f=n.n(p),h=n(4),g=n.n(h),m=n(44),v=n.n(m),b=n(2),y=n.n(b),_=n(43),k=n.n(_),w=n(31),C=n.n(w),S=n(9),E=n.n(S),O=n(11),T=n.n(O),x=n(231),M=n.n(x),D=(n(1169),n(1071),n(1170),n(1173),n(1174),n(1175),n(1177),n(1089),n(1178),n(1179),n(1180),n(1070),n(1181),n(1091),n(1182),n(1183),n(1184),n(82)),P=n(1185),N=n(0),L=n(10),F=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},A=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function j(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var I={update:100,completion:500,lint:2e3},R={common:{keyMap:"sublime",autofocus:!1,cursorBlinkRate:0,viewportMargin:1/0,theme:"et",styleActiveLine:!0,matchBrackets:!0,autoCloseBrackets:!0,autoCloseTags:!0,lineWrapping:!0,lineNumbers:!0,indentUnit:2,tabSize:2},modes:{css:{mode:{name:"css",inline:!0},colorpicker:{mode:"edit"},lineBreakPlaceholder:/\|\||<!-- \[et_pb_line_break_holder\] -->/},html:{mode:{name:"htmlmixed"},colorpicker:{mode:"edit"},matchTags:{bothTags:!0},lineBreakPlaceholder:/<!-- \[et_pb_line_break_holder\] -->/}}},B={line:0,ch:0},H={ignoreKeys:[13,37,39],prefix:{css:/[A-z-]/,default:/[A-z]/},tokens:{xml:["attribute","tag"]}},W=function(e){return y()(e,e.is_fb_content?"content":"value")},V=function(e){e.hideCompletion(),e.hideColorPicker()},G=new(function(){function e(){j(this,e),this.instances=[],this.listener=!1,this.$window=N.default.$appWindow(),this.onScroll=this.onScroll.bind(this)}return A(e,[{key:"add",value:function(e){this.instances.push(e),this.check()}},{key:"remove",value:function(e){M()(this.instances,e),this.check()}},{key:"onScroll",value:function(){T()(this.instances,V)}},{key:"check",value:function(){this.instances.length>0?this.listener||(this.$window.on("wheel scroll",this.onScroll),this.listener=!0):this.listener&&(this.$window.off("wheel scroll",this.onScroll),this.listener=!1)}}]),e}()),U=Object(N.isIEOrEdge)()?e("body")[0]:{scrollTop:0};var z=function(t){function n(e){j(this,n);var t=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));t.editor=!1,t.dirty=!1,t.markers=[],t.mode=y()(e,"mode","css"),t.options=F({},R.common,y()(R.modes,t.mode,{}),{readOnly:y()(e,"readonly",!1)}),C()(t.options,"mode.inline")&&C()(e,"inline")&&(t.options.mode.inline=e.inline),t.completion=y()(H.prefix,t.mode,H.prefix.default),t.onChange=t.onChange.bind(t),t.onClick=t.onClick.bind(t),t.onKeyUp=t.onKeyUp.bind(t),t._onFocus=t._onFocus.bind(t),t._onBlur=t._onBlur.bind(t),t.onBeforeChange=t.onBeforeChange.bind(t),t.editorDidMount=t.editorDidMount.bind(t),t.debouncedShowCompletion=v()(t.showCompletion,I.completion),t.debouncedUpdateSettings=v()(t.updateSettings,I.update);var r=t.addLineBreaks(W(e));return t.state={value:r,enabled:!d()(r)},t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,i.a.Component),A(n,[{key:"componentDidMount",value:function(){G.add(this)}},{key:"componentWillReceiveProps",value:function(e){var t=this.addLineBreaks(W(e));this.state.enabled||d()(t)||this.enableEditor(),this.state.value!==t&&(this.dirty||this.setValue(t))}},{key:"componentDidUpdate",value:function(){if(this.editor){var e=this.editor;if(T()(this.markers,function(e){e.clear()}),this.markers=[],d()(y()(this,"props.search")))return;for(var t=e.getSearchCursor(this.props.search);t.findNext();)this.markers.push(e.doc.markText(t.from(),t.to(),{className:"cm-searching",clearOnEnter:!0}))}}},{key:"componentWillUnmount",value:function(){this.hideCompletion(),this.hideColorPicker(),G.remove(this),this.debouncedShowCompletion.cancel(),this.debouncedUpdateSettings.flush(),this.editor=!1,this.linter&&this.linter.destroy()}},{key:"onBeforeChange",value:function(e,t,n){this.dirty=!0,this.setValue(n)}},{key:"onChange",value:function(){I.update>0?this.debouncedUpdateSettings():this.updateSettings(),this.lint()}},{key:"onKeyUp",value:function(e,t){this.checkCompletion(e,t)}},{key:"onClick",value:function(){this.options.autofocus=!0,this.enableEditor()}},{key:"setValue",value:function(e){this.setState({value:e})}},{key:"addLineBreaks",value:function(e){if(g()(e)||!f()(e))return e;var t=this.options.lineBreakPlaceholder;return e.match(t)?e.split(t).join("\n"):e}},{key:"enableEditor",value:function(){this.setState({enabled:!0})}},{key:"lint",value:function(e){this.linter&&this.linter.lint(e)}},{key:"editorDidMount",value:function(t){this.editor=t;var n=t.state.colorpicker;n&&k()(n,"open_color_picker",function(t){var n=this,r=t.lineNo,o=t.ch,i=t.nameColor,a=t.color;if(this.colorpicker){var s=a,l=this.cm.charCoords({line:r,ch:o},"window");this.colorpicker.show({left:l.left,top:l.bottom+U.scrollTop,isShortCut:t.isShortCut||!1,hideDelay:this.opt.hideDelay||2e3},i||a,function(e){n.cm.replaceRange(e,{line:r,ch:o},{line:r,ch:o+s.length},"*colorpicker"),s=e}),e(this.colorpicker.$root.el).css({top:l.bottom+U.scrollTop,left:l.left})}}.bind(n)),this.linter=new P.a(this.options.mode,t,I.lint),this.lint(0)}},{key:"updateSettings",value:function(){var e=this.props;e._onChange(e.name,this.state.value,e.type),this.dirty=!1}},{key:"hideCompletion",value:function(){this.debouncedShowCompletion.cancel(),this.editor&&this.editor.state.completionActive&&this.editor.state.completionActive.close()}},{key:"hideColorPicker",value:function(){this.editor&&this.editor.state.colorpicker&&this.editor.state.colorpicker.close_color_picker()}},{key:"checkCompletion",value:function(e,t){if(E()(H.ignoreKeys,t.keyCode))this.hideCompletion();else{var n=e.doc,r=n.getCursor(),o=r.line,i=r.ch,a=y()(e.getModeAt(r),"name"),s=n.getLine(o),l=s.substr(Math.max(i-1,0),1),u=s.substr(i,1);if(this.completion.test(l)&&!this.completion.test(u)){var c=y()(H,"tokens."+a);if(c){var d=e.getTokenTypeAt(r);if(!E()(c,d))return void this.hideCompletion()}this.debouncedShowCompletion()}else this.hideCompletion()}}},{key:"showCompletion",value:function(){this.editor.state.completionActive||this.editor.showHint({completeSingle:!1})}},{key:"render",value:function(){var e=void 0;return e=this.state.enabled?i.a.createElement(r.Controlled,{value:this.state.value,options:this.options,cursor:this.options.autofocus?B:null,autoFocus:this.options.autofocus,name:this.props.name,id:"et-fb-"+this.props.name,onChange:this.onChange,onBeforeChange:this.onBeforeChange,onKeyUp:this.onKeyUp,editorDidMount:this.editorDidMount,onFocus:this._onFocus,onBlur:this._onBlur}):i.a.createElement("textarea",{className:"et-fb-settings-option-textarea",value:this.state.value,name:this.props.name,onChange:u.a,onClick:this.onClick,onFocus:this._onFocus,onBlur:this._onBlur}),i.a.createElement(D.a,{componentName:this.props.name},i.a.createElement("div",{className:"et-fb-codemirror"},e))}},{key:"_onFocus",value:function(){(this.props.module||this.props.isPageSetting)&&L.b.settingFieldFocused(this)}},{key:"_onBlur",value:function(){(this.props.module||this.props.isPageSetting)&&L.b.settingFieldFocused(!1)}}]),n}();z.propTypes={value:s.a.string,name:s.a.string.isRequired,search:s.a.string,inline:s.a.bool},z.defaultProps={value:"",search:"",inline:!0},t.a=z}).call(this,n(28))},function(e,t,n){ // CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE !function(e){var t=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),n=e.Pos,r={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"};function o(e,t,o){var a=e.getLineHandle(t.line),s=t.ch-1,l=o&&o.afterCursor;null==l&&(l=/(^| )cm-fat-cursor($| )/.test(e.getWrapperElement().className));var u=!l&&s>=0&&r[a.text.charAt(s)]||r[a.text.charAt(++s)];if(!u)return null;var c=">"==u.charAt(1)?1:-1;if(o&&o.strict&&c>0!=(s==t.ch))return null;var d=e.getTokenTypeAt(n(t.line,s+1)),p=i(e,n(t.line,s+(c>0?1:0)),c,d||null,o);return null==p?null:{from:n(t.line,s),to:p&&p.pos,match:p&&p.ch==u.charAt(0),forward:c>0}}function i(e,t,o,i,a){for(var s=a&&a.maxScanLineLength||1e4,l=a&&a.maxScanLines||1e3,u=[],c=a&&a.bracketRegex?a.bracketRegex:/[(){}[\]]/,d=o>0?Math.min(t.line+l,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-l),p=t.line;p!=d;p+=o){var f=e.getLine(p);if(f){var h=o>0?0:f.length-1,g=o>0?f.length:-1;if(!(f.length>s))for(p==t.line&&(h=t.ch-(o<0?1:0));h!=g;h+=o){var m=f.charAt(h);if(c.test(m)&&(void 0===i||e.getTokenTypeAt(n(p,h+1))==i)){var v=r[m];if(">"==v.charAt(1)==o>0)u.push(m);else{if(!u.length)return{pos:n(p,h),ch:m};u.pop()}}}}}return p-o!=(o>0?e.lastLine():e.firstLine())&&null}function a(e,r,i){for(var a=e.state.matchBrackets.maxHighlightLineLength||1e3,s=[],l=e.listSelections(),u=0;u<l.length;u++){var c=l[u].empty()&&o(e,l[u].head,i);if(c&&e.getLine(c.from.line).length<=a){var d=c.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";s.push(e.markText(c.from,n(c.from.line,c.from.ch+1),{className:d})),c.to&&e.getLine(c.to.line).length<=a&&s.push(e.markText(c.to,n(c.to.line,c.to.ch+1),{className:d}))}}if(s.length){t&&e.state.focused&&e.focus();var p=function(){e.operation(function(){for(var e=0;e<s.length;e++)s[e].clear()})};if(!r)return p;setTimeout(p,800)}}function s(e){e.operation(function(){e.state.matchBrackets.currentlyHighlighted&&(e.state.matchBrackets.currentlyHighlighted(),e.state.matchBrackets.currentlyHighlighted=null),e.state.matchBrackets.currentlyHighlighted=a(e,!1,e.state.matchBrackets)})}e.defineOption("matchBrackets",!1,function(t,n,r){r&&r!=e.Init&&(t.off("cursorActivity",s),t.state.matchBrackets&&t.state.matchBrackets.currentlyHighlighted&&(t.state.matchBrackets.currentlyHighlighted(),t.state.matchBrackets.currentlyHighlighted=null)),n&&(t.state.matchBrackets="object"==typeof n?n:{},t.on("cursorActivity",s))}),e.defineExtension("matchBrackets",function(){a(this,!0)}),e.defineExtension("findMatchingBracket",function(e,t,n){return(n||"boolean"==typeof t)&&(n?(n.strict=t,t=n):t=t?{strict:!0}:null),o(this,e,t)}),e.defineExtension("scanForBracket",function(e,t,n,r){return i(this,e,t,n,r)})}(n(1047))},function(e,t,n){ // CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE !function(e){"use strict";var t=e.Pos,n="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",r=new RegExp("<(/?)(["+n+"]["+n+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*)","g");function o(e,t,n,r){this.line=t,this.ch=n,this.cm=e,this.text=e.getLine(t),this.min=r?Math.max(r.from,e.firstLine()):e.firstLine(),this.max=r?Math.min(r.to-1,e.lastLine()):e.lastLine()}function i(e,n){var r=e.cm.getTokenTypeAt(t(e.line,n));return r&&/\btag\b/.test(r)}function a(e){if(!(e.line>=e.max))return e.ch=0,e.text=e.cm.getLine(++e.line),!0}function s(e){if(!(e.line<=e.min))return e.text=e.cm.getLine(--e.line),e.ch=e.text.length,!0}function l(e){for(;;){var t=e.text.indexOf(">",e.ch);if(-1==t){if(a(e))continue;return}if(i(e,t+1)){var n=e.text.lastIndexOf("/",t),r=n>-1&&!/\S/.test(e.text.slice(n+1,t));return e.ch=t+1,r?"selfClose":"regular"}e.ch=t+1}}function u(e){for(;;){var t=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(-1==t){if(s(e))continue;return}if(i(e,t+1)){r.lastIndex=t,e.ch=t;var n=r.exec(e.text);if(n&&n.index==t)return n}else e.ch=t}}function c(e){for(;;){r.lastIndex=e.ch;var t=r.exec(e.text);if(!t){if(a(e))continue;return}if(i(e,t.index+1))return e.ch=t.index+t[0].length,t;e.ch=t.index+1}}function d(e){for(;;){var t=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(-1==t){if(s(e))continue;return}if(i(e,t+1)){var n=e.text.lastIndexOf("/",t),r=n>-1&&!/\S/.test(e.text.slice(n+1,t));return e.ch=t+1,r?"selfClose":"regular"}e.ch=t}}function p(e,n){for(var r=[];;){var o,i=c(e),a=e.line,s=e.ch-(i?i[0].length:0);if(!i||!(o=l(e)))return;if("selfClose"!=o)if(i[1]){for(var u=r.length-1;u>=0;--u)if(r[u]==i[2]){r.length=u;break}if(u<0&&(!n||n==i[2]))return{tag:i[2],from:t(a,s),to:t(e.line,e.ch)}}else r.push(i[2])}}function f(e,n){for(var r=[];;){var o=d(e);if(!o)return;if("selfClose"!=o){var i=e.line,a=e.ch,s=u(e);if(!s)return;if(s[1])r.push(s[2]);else{for(var l=r.length-1;l>=0;--l)if(r[l]==s[2]){r.length=l;break}if(l<0&&(!n||n==s[2]))return{tag:s[2],from:t(e.line,e.ch),to:t(i,a)}}}else u(e)}}e.registerHelper("fold","xml",function(e,n){for(var r=new o(e,n.line,0);;){var i,a=c(r);if(!a||!(i=l(r))||r.line!=n.line)return;if(!a[1]&&"selfClose"!=i){var s=t(r.line,r.ch),u=p(r,a[2]);return u&&{from:s,to:u.from}}}}),e.findMatchingTag=function(e,n,r){var i=new o(e,n.line,n.ch,r);if(-1!=i.text.indexOf(">")||-1!=i.text.indexOf("<")){var a=l(i),s=a&&t(i.line,i.ch),c=a&&u(i);if(a&&c&&(h=n,!(((d=i).line-h.line||d.ch-h.ch)>0))){var d,h,g={from:t(i.line,i.ch),to:s,tag:c[2]};return"selfClose"==a?{open:g,close:null,at:"open"}:c[1]?{open:f(i,c[2]),close:g,at:"close"}:(i=new o(e,s.line,s.ch,r),{open:g,close:p(i,c[2]),at:"open"})}}},e.findEnclosingTag=function(e,t,n,r){for(var i=new o(e,t.line,t.ch,n);;){var a=f(i,r);if(!a)break;var s=new o(e,t.line,t.ch,n),l=p(s,a.tag);if(l)return{open:a,close:l}}},e.scanForClosingTag=function(e,t,n,r){var i=new o(e,t.line,t.ch,r?{from:0,to:r}:null);return p(i,n)}}(n(1047))},function(e,t,n){ // CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE !function(e){function t(e,t,n){var r,o=e.getWrapperElement();return(r=o.appendChild(document.createElement("div"))).className=n?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top","string"==typeof t?r.innerHTML=t:r.appendChild(t),r}function n(e,t){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=t}e.defineExtension("openDialog",function(r,o,i){i||(i={}),n(this,null);var a=t(this,r,i.bottom),s=!1,l=this;function u(e){if("string"==typeof e)d.value=e;else{if(s)return;s=!0,a.parentNode.removeChild(a),l.focus(),i.onClose&&i.onClose(a)}}var c,d=a.getElementsByTagName("input")[0];return d?(d.focus(),i.value&&(d.value=i.value,!1!==i.selectValueOnOpen&&d.select()),i.onInput&&e.on(d,"input",function(e){i.onInput(e,d.value,u)}),i.onKeyUp&&e.on(d,"keyup",function(e){i.onKeyUp(e,d.value,u)}),e.on(d,"keydown",function(t){i&&i.onKeyDown&&i.onKeyDown(t,d.value,u)||((27==t.keyCode||!1!==i.closeOnEnter&&13==t.keyCode)&&(d.blur(),e.e_stop(t),u()),13==t.keyCode&&o(d.value,t))}),!1!==i.closeOnBlur&&e.on(d,"blur",u)):(c=a.getElementsByTagName("button")[0])&&(e.on(c,"click",function(){u(),l.focus()}),!1!==i.closeOnBlur&&e.on(c,"blur",u),c.focus()),u}),e.defineExtension("openConfirm",function(r,o,i){n(this,null);var a=t(this,r,i&&i.bottom),s=a.getElementsByTagName("button"),l=!1,u=this,c=1;function d(){l||(l=!0,a.parentNode.removeChild(a),u.focus())}s[0].focus();for(var p=0;p<s.length;++p){var f=s[p];!function(t){e.on(f,"click",function(n){e.e_preventDefault(n),d(),t&&t(u)})}(o[p]),e.on(f,"blur",function(){--c,setTimeout(function(){c<=0&&d()},200)}),e.on(f,"focus",function(){++c})}}),e.defineExtension("openNotification",function(r,o){n(this,u);var i,a=t(this,r,o&&o.bottom),s=!1,l=o&&void 0!==o.duration?o.duration:5e3;function u(){s||(s=!0,clearTimeout(i),a.parentNode.removeChild(a))}return e.on(a,"click",function(t){e.e_preventDefault(t),u()}),l&&(i=setTimeout(u,l)),u})}(n(1047))},function(e,t,n){var r=n(167)("join",n(354));r.placeholder=n(155),e.exports=r},function(e,t,n){var r=n(167)("omit",n(83));r.placeholder=n(155),e.exports=r},function(e,t,n){var r=n(167)("filter",n(79));r.placeholder=n(155),e.exports=r},function(e,t,n){var r=n(167)("negate",n(248),n(384));r.placeholder=n(155),e.exports=r},function(e,t,n){"use strict";(function(e){n.d(t,"b",function(){return C});var r=n(30),o=n.n(r),i=n(111),a=n.n(i),s=n(1207),l=n.n(s),u=n(689),c=n.n(u),d=n(131),p=n.n(d),f=n(1208),h=n.n(f),g=n(1072),m=n.n(g),v=n(688),b=n.n(v),y=n(1058),_=n.n(y),k={},w=p()(function(t){var n=a()(t,o()(k));if(!_()(n)){var r=function(t){return new Promise(function(n){return e.ajax({type:"POST",url:ETBuilderBackend.ajaxUrl,dataType:"json",data:{action:"et_fb_fetch_attachments",et_fb_fetch_attachments:ETBuilderBackend.nonces.fetchAttachments,ids:t},success:n})})}(n);n.map(function(e){return k[e]=r.then(l()(function(t){var n=t.ID;return e===b()(n)}))})}return t.map(function(e){return k[e]})},m()(b.a)),C=p()(h.a,w);t.a=p()(c.a,w,function(e){return[e]})}).call(this,n(28))},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";(function(e){var r=n(1),o=n.n(r),i=n(6),a=n.n(i),s=n(2),l=n.n(s),u=n(9),c=n.n(u),d=n(12),p=n.n(d),f=n(48),h=n.n(f),g=n(39),m=n.n(g),v=(n(1098),n(0)),b=n(33),y=n(1050),_=n(58),k=n(54),w=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},C=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var S="#C9D2DD",E="#e7eef5",O="#0287e0",T=50,x=function(e){var t="";switch(e){case"ew":t=o.a.createElement("path",{fill:k.a.white,d:"M12.29 6.29L9.85 3.85a.5.5 0 0 0-.85.36V6H5V4.21a.5.5 0 0 0-.85-.35L1.71 6.29a1 1 0 0 0 0 1.41l2.44 2.44A.5.5 0 0 0 5 9.79V8h4v1.79a.5.5 0 0 0 .85.35l2.44-2.44a1 1 0 0 0 0-1.41z",fillRule:"evenodd"});break;case"nesw":t=o.a.createElement("path",{fill:k.a.white,d:"M10 3H6.51a.51.51 0 0 0-.36.86l1.27 1.3-2.28 2.29-1.28-1.28a.51.51 0 0 0-.86.36V10a1 1 0 0 0 1 1h3.49a.51.51 0 0 0 .36-.86l-1.3-1.3 2.29-2.26 1.3 1.3a.51.51 0 0 0 .86-.36V4a1 1 0 0 0-1-1z",fillRule:"evenodd"});break;case"nwse":t=o.a.createElement("path",{fill:k.a.white,d:"M10.85 6.17a.51.51 0 0 0-.71 0L8.86 7.45 6.58 5.16l1.27-1.27A.51.51 0 0 0 7.49 3H4a1 1 0 0 0-1 1v3.52a.51.51 0 0 0 .86.36l1.3-1.3 2.29 2.28-1.3 1.3a.51.51 0 0 0 .36.86H10a1 1 0 0 0 1-1V6.53a.5.5 0 0 0-.15-.36z",fillRule:"evenodd"});break;default:t=o.a.createElement("path",{fill:k.a.white,d:"M9.79 9H8V5h1.79a.5.5 0 0 0 .35-.85L7.71 1.73a1 1 0 0 0-1.41 0L3.85 4.17a.5.5 0 0 0 .36.83H6v4H4.21a.5.5 0 0 0-.35.85l2.44 2.44a1 1 0 0 0 1.41 0l2.44-2.44A.5.5 0 0 0 9.79 9z",fillRule:"evenodd"})}return o.a.createElement("svg",{viewBox:"0 0 14 14",preserveAspectRatio:"xMidYMid meet",shapeRendering:"geometricPrecision"},t)},M=function(e){var t=Object(v.hasValue)(e.angle)?parseFloat(e.angle)*Math.PI/180:0,n=void 0,r=void 0,i=void 0,a=void 0;switch(e.type){case"rotate_z":i="m "+(r={x:(n={x:40,y:40}).x+1.5+7,y:n.y+1.5+7}).x+","+r.y+" 0,0",a="m "+r.x+","+r.y+" 0,0";break;case"rotate_y":i="m "+(r={x:(n={x:42.4681,y:21.3538076}).x+1.5+7,y:n.y+1.5+7+n.y}).x+","+r.y+" 0,-"+2*n.y,a="m "+r.x+","+(r.y+n.y)+" 0,"+n.y;break;case"rotate_x":i="m "+(r={x:(n={x:21.3538076,y:42.4681}).x+1.5+7+n.x,y:n.y+1.5+7}).x+","+r.y+" -"+2*n.x+",0",a="m "+(r.x+n.x)+","+r.y+" "+n.x+",0"}var s={x:n.x*Math.cos(t)+r.x,y:n.y*Math.sin(t)+r.y};return o.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:2*r.x,height:2*r.y},o.a.createElement("circle",{fill:S,cx:r.x,cy:r.y,r:3.5}),o.a.createElement("path",{fill:"none",stroke:S,strokeWidth:2,strokeDasharray:"4,4",d:"m "+r.x+","+r.y+" "+(s.x-r.x)+","+(s.y-r.y)}),o.a.createElement("ellipse",{fill:"none",stroke:E,strokeWidth:3.5,cx:r.x,cy:r.y,rx:n.x,ry:n.y}),o.a.createElement("path",{fill:"none",stroke:S,strokeWidth:3,d:i}),o.a.createElement("path",{fill:"none",stroke:S,strokeWidth:3,d:a}),o.a.createElement("circle",{fill:O,cx:s.x,cy:s.y,r:7,"data-transform_type":e.type,onMouseDown:e.handleOnMouseDown,style:{cursor:"pointer"}}))};M.propTypes={type:a.a.string,angle:a.a.string,handleOnMouseDown:a.a.func},M.defaultProps={angle:"0",type:"rotate_x",handleOnMouseDown:h.a};var D=function(e){return o.a.createElement("div",{id:"et-fb-settings-transform-container",className:"et-fb-settings-transform-container",style:p()({},e.style)},e.hideRuler?null:o.a.createElement("div",{className:"et-fb-settings-transform-hr"}),e.hideRuler?null:o.a.createElement("div",{className:"et-fb-settings-transform-vr"}),e.hideDotSquare?null:o.a.createElement("div",{className:"et-fb-settings-transform-square-dotted"}),e.children)};D.propTypes={hideRuler:a.a.bool,hideDotSquare:a.a.bool,children:a.a.node,style:a.a.object,onMouseLeave:a.a.func},D.defaultProps={hideRuler:!1,hideDotSquare:!1,children:o.a.createElement("span",null),style:{},onMouseLeave:h.a};var P=function(e){var t=(""+e).split("_");return{type:t[0],axis:t[1],index:l()({x:0,y:1,z:2},t[1],0)}},N=function(t){function n(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var t=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return t.state={dragHandle:"",values:[],scaleLinked:!0,skewLinked:!0,translateLinked:!0,controllerCenter:{x:0,y:0},containerDimensions:{width:170,height:170}},t._handleMouseMove=t._handleMouseMove.bind(t),t._handleMouseUp=t._handleMouseUp.bind(t),t._handleOnMouseDown=t._handleOnMouseDown.bind(t),t._handleOriginClick=t._handleOriginClick.bind(t),t._setOption=t._setOption.bind(t),t._handleLinkedClick=t._handleLinkedClick.bind(t),t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,o.a.Component),C(n,[{key:"shouldComponentUpdate",value:function(e){return!m()(this.props,e)}},{key:"componentWillMount",value:function(){this.setState({values:this._getValues(),scaleLinked:this.props.scaleLinked,skewLinked:this.props.skewLinked,translateLinked:this.props.translateLinked})}},{key:"componentWillReceiveProps",value:function(e){Object(v.hasValue)(e.value)&&e.value!==e.default?this.state.values.join("|")!==e.value&&this.setState({values:(""+e.value).split("|")}):this.setState({values:(""+e.default).split("|")})}},{key:"componentDidMount",value:function(){Object(v.topWindow)().addEventListener("mousemove",this._handleMouseMove),Object(v.topWindow)().addEventListener("mouseup",this._handleMouseUp)}},{key:"componentWillUnmount",value:function(){Object(v.topWindow)().removeEventListener("mousemove",this._handleMouseMove),Object(v.topWindow)().removeEventListener("mouseup",this._handleMouseUp)}},{key:"_handleOnMouseDown",value:function(t){if(!Object(v.hasValue)(this.props.readonly)){var n=t.currentTarget.dataset.transform_type;if(this.setState({dragHandle:n}),"rotate"===P(n).type){var r=e(t.target.parentElement),o=r.position();this.setState({controllerCenter:{x:o.left+r.width()/2,y:o.top+r.height()/2}})}}}},{key:"_handleMouseMove",value:function(e){if(!Object(v.hasValue)(this.props.readonly)&&(Object(v.hasValue)(this.state.dragHandle)&&(0!==e.movementX||0!==e.movementY)))switch(P(this.state.dragHandle).type){case"scale":var t=this.props.scaleLinked,n=-1*e.movementY,r=e.movementX,o=100*n/T+parseFloat(this._getOption("scale_y"))+"%",i=100*r/T+parseFloat(this._getOption("scale_x"))+"%";if("scale_y"===this.state.dragHandle)0!==e.movementY&&this._setOption("scale_y",o);else if("scale_x"===this.state.dragHandle)0!==e.movementX&&this._setOption("scale_x",i);else if(t){var a=100*(r+n)/T+parseFloat(this._getOption("scale_x"))+"%";this._setOption("scale_x",a)}else this._setOption("scale_y",o),this._setOption("scale_x",i);break;case"skew":var s=180*(2*e.movementX+this.state.containerDimensions.width)/this.state.containerDimensions.width-180,l=180*(2*e.movementY*-1+this.state.containerDimensions.height)/this.state.containerDimensions.height-180,u=Math.round(l)+parseFloat(this._getOption("skew_y"))+"deg",c=Math.round(s)+parseFloat(this._getOption("skew_x"))+"deg";"skew_y"===this.state.dragHandle?0!==e.movementY&&this._setOption("skew_y",u):"skew_x"===this.state.dragHandle&&0!==e.movementX&&this._setOption("skew_x",c);break;case"translate":var d=Object(_.c)(this._getOption("translate_y")),p=Object(_.c)(this._getOption("translate_x")),f=300*(2*e.movementX+this.state.containerDimensions.width)/this.state.containerDimensions.width-300,h=300*(2*e.movementY+this.state.containerDimensions.height)/this.state.containerDimensions.height-300,g=""+(Math.round(h)+parseFloat(this._getOption("translate_y")))+d,m=""+(Math.round(f)+parseFloat(this._getOption("translate_x")))+p;0!==e.movementY&&this._setOption("translate_y",g),0!==e.movementX&&this._setOption("translate_x",m);break;case"origin":var b=Object(_.c)(this._getOption("origin_y")),y=Object(_.c)(this._getOption("origin_x")),k=e.movementY,w=e.movementX;"%"===b&&(k*=100/T),"%"===y&&(w*=100/T);var C=k+parseFloat(this._getOption("origin_y"))+b,S=w+parseFloat(this._getOption("origin_x"))+y;0!==e.movementY&&this._setOption("origin_y",C),0!==e.movementX&&this._setOption("origin_x",S);break;case"rotate":var E=this.state.controllerCenter,O=Math.atan2(e.pageY-E.y,e.pageX-E.x)*(180/Math.PI);O<0&&(O+=360),360===O&&(O=0);var x=O.toFixed(0)+"deg";this._setOption(this.state.dragHandle,x)}}},{key:"_handleMouseUp",value:function(e){this.setState({dragHandle:!1})}},{key:"_handleLinkedClick",value:function(e){var t=e.currentTarget.dataset.linked_type;c()(["scale","skew","translate"],t)&&this.props.onClickLink(t),e.preventDefault()}},{key:"_handleOriginClick",value:function(e){if(e.preventDefault(),e.stopPropagation(),!Object(v.hasValue)(this.props.readonly)){var t=e.currentTarget.dataset.origin_type,n={1:{x:0,y:0},2:{x:50,y:0},3:{x:100,y:0},4:{x:0,y:50},5:{x:50,y:50},6:{x:100,y:50},7:{x:0,y:100},8:{x:50,y:100},9:{x:100,y:100}};Object(v.hasValue)(l()(n,t,!1))&&(this._setOption("origin_x",n[t].x+"%"),this._setOption("origin_y",n[t].y+"%"))}}},{key:"_setOption",value:function(e,t,n){var r=P(e),o=this.state.values[r.index];if(o!==t){var i=this._sanitization(t,e),a=i.value-parseFloat(o),s=this.state.values;if(s[r.index]=i.value+i.unit,(Object(v.hasValue)(n)||c()(["skew","scale"],r.type))&&(this.props.scaleLinked&&"scale"===r.type||this.props.skewLinked&&"skew"===r.type||this.props.translateLinked&&"translate"===r.type)){var l="x"===r.axis?r.type+"_y":r.type+"_x",u=this._getOption(l),d=u;0!==a&&(d=parseFloat(u)+a+i.unit);var p=this._sanitization(d,l);s["x"===r.axis?1:0]=p.value+p.unit}var f=s.join("|"),h=f===this.props.default;this.setState({values:s}),this.props._onChange(this.props.name,f,n,null,h)}}},{key:"_getValues",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props,t=(""+e.default).split("|"),n=t;return Object(v.hasValue)(e.value)&&(n=(""+e.value).split("|")),t.forEach(function(e,t){Object(v.hasValue)(n[t])||(n[t]=e)}),n}},{key:"_getOption",value:function(e){return this.state.values[P(e).index]}},{key:"_getOptionDefault",value:function(e){return(""+this.props.default).split("|")[P(e).index]}},{key:"_sanitization",value:function(e,t){var n=this._getOptionDefault(t),r={value:parseFloat(n),unit:this.props.default_unit};if(!Object(v.hasValue)(e))return r;var o=isNaN(parseFloat(e))?parseFloat(n):parseFloat(e);switch(r.value=o,t){case"skew_x":case"skew_y":var i=this._getOption(t),a=isNaN(parseFloat(i))?o:parseFloat(i),s=0===Math.sign(a)?1:Math.sign(a),l=Math.abs(o);if(90===l){var u=Math.abs(a);u<90?r.value=91*s:u>=90&&(r.value=89*s)}l>180&&(r.value=180*s);break;case"rotate_x":case"rotate_y":case"rotate_z":r.value=o%360;break;default:r.unit=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"px",n=Object(_.c)(e,t);return c()(["em","rem","px","%","vw","vh"],n)?n:t}(e,this.props.default_unit)}return r}},{key:"_renderField",value:function(e){var t=P(e),n=!1;"origin"===t.type&&(n=t.axis);var o={name:e,type:"range",value:this._getOption(e),default:this._getOptionDefault(e),default_unit:this.props.default_unit,range_settings:this.props.range_settings,key:this.props.name+"-"+e,_onChange:this._setOption,visible:!0,previewMode:"desktop",readonly:this.props.readonly,isTransformOrigin:n};return Object(r.createElement)(y.a.getControl("range"),o)}},{key:"render",value:function(){var e=this,t=function(){return{minWidth:"25px",width:"25px",height:"25px",margin:"0",fill:!(arguments.length>0&&void 0!==arguments[0])||arguments[0]?k.a.info:k.a.default}},n=Object(v.hasValue)(this.props.transform_type)?this.props.transform_type:(""+e.props.name).replace(/(transform_|__hover|_tablet|_phone)/g,"");switch(n){case"scale":var r=this._getOption("scale_x"),i=this._getOption("scale_y"),a=this.props.scaleLinked?{display:"none"}:{},s={};return s=r?w({},s,{width:T*parseFloat(r)/100+"px"}):s,s=i?w({},s,{height:T*parseFloat(i)/100+"px"}):s,o.a.createElement("div",{className:"et-fb-settings-transform-wrapper"},o.a.createElement(D,{onMouseLeave:this._handleMouseUp},o.a.createElement("div",{className:"et-fb-settings-transform-square",style:s},o.a.createElement("div",{className:"et-fb-settings-transform-square-half"},o.a.createElement("div",{className:"et-fb-settings-transform-controller","data-transform_type":"scale_xy",onMouseDown:this._handleOnMouseDown,style:{margin:"-8px",cursor:"nesw-resize"}},x("nesw")),o.a.createElement("div",{className:"et-fb-settings-transform-controller","data-transform_type":"scale_y",onMouseDown:this._handleOnMouseDown,style:w({},a,{marginTop:"-9px",marginLeft:"-2px",cursor:"ns-resize"})},x("ns")),o.a.createElement("div",null)),o.a.createElement("div",{className:"et-fb-settings-transform-square-half"},o.a.createElement("div",{className:"et-fb-settings-transform-controller","data-transform_type":"scale_x",onMouseDown:this._handleOnMouseDown,style:w({},a,{marginTop:"-7px",marginRight:"-9px",cursor:"ew-resize"})},x("ew"))))),o.a.createElement("div",{className:"et-fb-settings-transform-vertical-range"},this._renderField("scale_y")),o.a.createElement("div",{className:"et-fb-settings-transform-horizontal-range"},this._renderField("scale_x")),o.a.createElement("button",{disabled:Object(v.hasValue)(this.props.readonly),"data-linked_type":"scale",onClick:this._handleLinkedClick,className:"et-fb-settings-transform-linked"},o.a.createElement(b.a,{icon:this.props.scaleLinked?"linked":"unlinked",style:t(this.props.scaleLinked)})));case"skew":var l=this._getOption("skew_x"),u=this._getOption("skew_y"),c="";c+=l?"skewX("+l+")":c;var d={transform:c+=u?" skewY("+u+")":c},p=(parseFloat(l)+180)*this.state.containerDimensions.width/360,f=(parseFloat(u)+180)*this.state.containerDimensions.height/360,h=p-this.state.containerDimensions.width/2,g=f-this.state.containerDimensions.height/2;return o.a.createElement("div",{className:"et-fb-settings-transform-wrapper"},o.a.createElement(D,{onMouseLeave:this._handleMouseUp},o.a.createElement("div",{className:"et-fb-settings-transform-square",style:d}),o.a.createElement("div",{className:"et-fb-settings-transform-square-transparent"},o.a.createElement("div",{className:"et-fb-settings-transform-square-half-skew"},o.a.createElement("div",{className:"et-fb-settings-transform-controller","data-transform_type":"skew_y",onMouseDown:this._handleOnMouseDown,style:{marginLeft:"-20px",marginBottom:"-6px",cursor:"ns-resize",transform:"translateY("+-1*g+"px)"}},x("ns")),o.a.createElement("div",null)),o.a.createElement("div",{className:"et-fb-settings-transform-square-half-skew",style:{justifyContent:"center",alignItems:"flex-end"}},o.a.createElement("div",{className:"et-fb-settings-transform-controller","data-transform_type":"skew_x",onMouseDown:this._handleOnMouseDown,style:{marginBottom:"-20px",cursor:"ew-resize",transform:"translateX("+h+"px)"}},x("ew"))))),o.a.createElement("div",{className:"et-fb-settings-transform-vertical-range"},this._renderField("skew_y")),o.a.createElement("div",{className:"et-fb-settings-transform-horizontal-range"},this._renderField("skew_x")),o.a.createElement("button",{disabled:Object(v.hasValue)(this.props.readonly),"data-linked_type":"skew",onClick:this._handleLinkedClick,className:"et-fb-settings-transform-linked"},o.a.createElement(b.a,{icon:this.props.skewLinked?"linked":"unlinked",style:t(this.props.skewLinked)})));case"translate":var m=parseFloat(this._getOption("translate_x")),y=parseFloat(this._getOption("translate_y")),C="";C+=m?"translateX("+(180*(m+300)/600-90)+"px)":"";var S={transform:C+=y?" translateY("+(180*(y+300)/600-90)+"px)":""};return o.a.createElement("div",{className:"et-fb-settings-transform-wrapper"},o.a.createElement(D,{onMouseLeave:this._handleMouseUp},o.a.createElement("option",{className:"et-fb-settings-transform-square-translate",style:S,"data-transform_type":"translate",onMouseDown:this._handleOnMouseDown})),o.a.createElement("div",{className:"et-fb-settings-transform-vertical-range et-fb-settings-transform-vertical-range-inverted"},this._renderField("translate_y")),o.a.createElement("div",{className:"et-fb-settings-transform-horizontal-range"},this._renderField("translate_x")),o.a.createElement("button",{disabled:Object(v.hasValue)(this.props.readonly),"data-linked_type":"translate",onClick:this._handleLinkedClick,className:"et-fb-settings-transform-linked"},o.a.createElement(b.a,{icon:this.props.translateLinked?"linked":"unlinked",style:t(this.props.translateLinked)})));case"origin":var E=this._getOption("origin_x"),O=this._getOption("origin_y"),P="";"%"===Object(_.c)(E,"%")&&(E=T/100*parseFloat(E)-25+"px"),"%"===Object(_.c)(O,"%")&&(O=T/100*parseFloat(O)-25+"px"),P+=E?"translateX("+E+")":P;var N={transform:P+=O?" translateY("+O+")":P};return o.a.createElement("div",{className:"et-fb-settings-transform-wrapper"},o.a.createElement(D,{hideDotSquare:!0,onMouseLeave:this._handleMouseUp},o.a.createElement("div",{className:"et-fb-settings-transform-square-origin"}),o.a.createElement("div",{className:"et-fb-settings-transform-square-transparent-origin",style:{width:"52.5px",height:"52.5px"}},o.a.createElement("div",{className:"et-fb-settings-transform-square-half",style:{flexDirection:"row",alignItems:"flex-start"}},o.a.createElement("div",{className:"et-fb-settings-transform-origin-controller","data-origin_type":"1",onMouseDown:this._handleOriginClick}),o.a.createElement("div",{className:"et-fb-settings-transform-origin-controller","data-origin_type":"2",onMouseDown:this._handleOriginClick}),o.a.createElement("div",{className:"et-fb-settings-transform-origin-controller","data-origin_type":"3",onMouseDown:this._handleOriginClick})),o.a.createElement("div",{className:"et-fb-settings-transform-square-half",style:{flexDirection:"row",alignItems:"center"}},o.a.createElement("div",{className:"et-fb-settings-transform-origin-controller","data-origin_type":"4",onMouseDown:this._handleOriginClick}),o.a.createElement("div",{className:"et-fb-settings-transform-origin-controller","data-origin_type":"5",onMouseDown:this._handleOriginClick}),o.a.createElement("div",{className:"et-fb-settings-transform-origin-controller","data-origin_type":"6",onMouseDown:this._handleOriginClick})),o.a.createElement("div",{className:"et-fb-settings-transform-square-half",style:{flexDirection:"row",alignItems:"flex-end"}},o.a.createElement("div",{className:"et-fb-settings-transform-origin-controller","data-origin_type":"7",onMouseDown:this._handleOriginClick}),o.a.createElement("div",{className:"et-fb-settings-transform-origin-controller","data-origin_type":"8",onMouseDown:this._handleOriginClick}),o.a.createElement("div",{className:"et-fb-settings-transform-origin-controller","data-origin_type":"9",onMouseDown:this._handleOriginClick}))),o.a.createElement("div",{className:"et-fb-settings-transform-origin-dot",style:N,"data-transform_type":"origin",onMouseDown:this._handleOnMouseDown})),o.a.createElement("div",{className:"et-fb-settings-transform-vertical-range et-fb-settings-transform-vertical-range-inverted"},this._renderField("origin_y")),o.a.createElement("div",{className:"et-fb-settings-transform-horizontal-range"},this._renderField("origin_x")));case"rotate":var L=this._getOption("rotate_x"),F=this._getOption("rotate_y"),A=this._getOption("rotate_z");return o.a.createElement("div",null,o.a.createElement(D,{style:{justifyContent:"space-around",width:"100%"},hideDotSquare:!0,hideRuler:!0,onMouseLeave:this._handleMouseUp},o.a.createElement(M,{type:"rotate_z",angle:A,handleOnMouseDown:this._handleOnMouseDown}),o.a.createElement(M,{type:"rotate_x",angle:L,handleOnMouseDown:this._handleOnMouseDown}),o.a.createElement(M,{type:"rotate_y",angle:F,handleOnMouseDown:this._handleOnMouseDown})),o.a.createElement("div",{className:"et-fb-settings-transform-rotate"},o.a.createElement("div",{className:"et-fb-settings-transform-rotate-range"},this._renderField("rotate_z")),o.a.createElement("div",{className:"et-fb-settings-transform-rotate-range"},this._renderField("rotate_x")),o.a.createElement("div",{className:"et-fb-settings-transform-rotate-range"},this._renderField("rotate_y"))));default:return o.a.createElement("div",null,n+" is not a registered Transform type")}}}]),n}();N.propTypes={name:a.a.string,default:a.a.string,default_unit:a.a.string,transform_type:a.a.string,range_settings:a.a.object,value:a.a.string,uniqueKey:a.a.string,_onChange:a.a.func,onClickLink:a.a.func,scaleLinked:a.a.bool,skewLinked:a.a.bool,translateLinked:a.a.bool,readonly:a.a.bool},N.defaultProps={name:"transform_scale",default:"100%|100%",default_unit:"%",transform_type:"scale",range_settings:{min:-100,max:300,step:1},value:"100%|100%",uniqueKey:"",_onChange:h.a,onClickLink:h.a,scaleLinked:!0,skewLinked:!0,translateLinked:!0,readonly:!1},t.a=N}).call(this,n(28))},function(e,t,n){"use strict";n.r(t),function(e){var r=n(1),o=n.n(r),i=n(6),a=n.n(i),s=n(18),l=n.n(s),u=n(17),c=n.n(u),d=n(16),p=n(105),f=n.n(p),h=n(36),g=n.n(h),m=n(4),v=n.n(m),b=n(79),y=n.n(b),_=n(11),k=n.n(_),w=n(7),C=n.n(w),S=n(39),E=n.n(S),O=n(87),T=n.n(O),x=n(44),M=n.n(x),D=(n(57),n(9)),P=n.n(D),N=n(12),L=n.n(N),F=n(48),A=n.n(F),j=n(2),I=n.n(j),R=(n(195),n(1247)),B=n(1254),H=n(8),W=n(10),V=n(33),G=n(1255),U=n(1256),z=n(3),q=n(1257),K=n(0),$=(n(1259),n(687)),X=n(35),Y=n(1051),J=n(218),Q=n(217),Z=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ee=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function te(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ne=ETBuilderBackend.i18n.tooltips,re=ETBuilderBackend.i18n,oe=K.default.isBFB(),ie={active:a.a.bool,actionType:a.a.string,active_tab:a.a.string,tooltipTitle:a.a.string,specialtyModal:a.a.bool,preloadingItems:a.a.bool,_closeFunction:a.a.func,modalPosition:a.a.object,classNames:a.a.object,children:a.a.node,modalHeight:a.a.number,modalWidth:a.a.oneOfType([a.a.number,a.a.string]),ignorePosition:a.a.bool,forceFixedPosition:a.a.bool},ae={active:!1,_closeFunction:A.a,classNames:{},ignorePosition:!1,forceFixedPosition:!1,enableContextMenu:!1},se=function(t){function n(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,t));return i.tabClassName=function(e){var t={"et-fb-settings-options-tab":!0,"et-fb-all-modules":!0,"et-fb-modules-list":!0,"et-fb-settings-options":!0};return t["et-fb-settings-options-tab-"+e]=!0,e===i.state.active_tab&&(t["et-fb-settings-options-tab--active"]=!0),l()(t)},i._onLibraryDoneLoading=function(){z.a.setProductTourElementReady("selectLayoutPack"),i.setState({library_loading:!1})},i._onClickLibraryBackButton=function(){i.setState({libraryBackToLayouts:!0})},i._onLibraryPageChanged=function(t){var n={libraryBackToLayouts:!1};(i.state.hasBackButton&&!t||t&&!i.state.hasBackButton)&&(n.hasBackButton=t),i.setState(n),t&&z.a.isProductTourActive()&&(z.a.setProductTourElementReady("loadLayoutItem"),e("body").trigger("et_fb_product_tour_element_clicked"))},i._renderTabs=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=g()(t,function(e){return o.a.createElement("li",{key:e.name,className:i.tabNavClassName(e.className)},o.a.createElement("a",{href:"#",className:e.className,onClick:i.handle_tab_click},I()(re,e.name,e.name)))});return o.a.createElement("ul",{className:"et-fb-settings-tabs-nav",ref:"settingsTabsNav"},r)},i.state={active_tab:t.activeTab||"modules_all",library_category:"all",filterByTitle:"",helpModalMoved:!1,library_modules_updated:z.a.getLastRetrievedLayoutType(),selectedItemIndex:0,selectedItemUpdated:!1,currentTourElement:"",move:!1,library_loading:!0,hasBackButton:!1,libraryBackToLayouts:!1,applyTransitionAnimation:!1,appWindowScrollTopOnload:K.default.$appWindow().scrollTop()},i.maxItemIndex={modules_all:0,modules_library:0},i.isLibrary=i.isLibrary.bind(i),i._onClose=i._onClose.bind(i),i._preventRightClick=i._preventRightClick.bind(i),i.getModuleType=i.getModuleType.bind(i),i.tabNavClassName=i.tabNavClassName.bind(i),i.setMaxItemIndex=i.setMaxItemIndex.bind(i),i._onModuleItemMouseLeave=i._onModuleItemMouseLeave.bind(i),i._onModuleItemMouseEnter=i._onModuleItemMouseEnter.bind(i),i._onKeyDownEvent=i._onKeyDownEvent.bind(i),i.centerizeSelectedItem=i.centerizeSelectedItem.bind(i),i.isAddingIntoGlobal=i.isAddingIntoGlobal.bind(i),i.insertLayout=i.insertLayout.bind(i),i.getSavedModulesList=i.getSavedModulesList.bind(i),i.handle_tab_click=i.handle_tab_click.bind(i),i.generateAddModuleContent=i.generateAddModuleContent.bind(i),i._onInput=i._onInput.bind(i),i.setModalPosition=i.setModalPosition.bind(i),i._onLibraryLoaded=i._onLibraryLoaded.bind(i),i.getSavedModulesArray=i.getSavedModulesArray.bind(i),i.loadLibraryModules=i.loadLibraryModules.bind(i),i.isPreloadingItems=i.isPreloadingItems.bind(i),i._handleStartMovement=i._handleStartMovement.bind(i),i._handleEndMovement=i._handleEndMovement.bind(i),i._handleMove=i._handleMove.bind(i),i._onProductTourElementChange=i._onProductTourElementChange.bind(i),i.modal=Object(r.createRef)(),i.debouncedSetInputFocus=M()(i.setInputFocus,1e3),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,o.a.Component),ee(n,[{key:"isLibrary",value:function(){return"load_layout"===this.props.actionType}},{key:"componentDidMount",value:function(){var e=this,t=P()(["phone","tablet"],I()(this,"props.previewMode")),n=this.isLibrary();this.windowScrolled=!1,this.is_mounted=!0,this.shortThrottleReset=T()(function(){return e.is_mounted&&e.setState({helpModalMoved:e.props.helpModalActive,resetModalStyles:f()(),modalPositionData:e.setModalPosition()})},100,{leading:!1}),this.mediumThrottleReset=T()(function(){return e.is_mounted&&e.setState({helpModalMoved:e.props.helpModalActive,resetModalStyles:f()(),modalPositionData:e.setModalPosition(),applyTransitionAnimation:"fast"})},100,{leading:!1}),this.longThrottleReset=T()(function(){e.is_mounted&&(e.windowScrolled=!0,e.setState({helpModalMoved:e.props.helpModalActive,resetModalStyles:f()(),modalPositionData:e.setModalPosition()}))},1e3,{leading:!1}),z.a.addModuleLibraryLoadedListener(this._onLibraryLoaded),z.a.addProductTourChangeElementListener(this._onProductTourElementChange),z.a.getDroploaderPayloadPortability()&&this.setState({active_tab:"modules_library"});var r=K.default.condition("is_bfb")||t?K.default.topWindow():K.default.appWindow();this.props.movable&&(r.addEventListener("mousemove",this._handleStartMovement,{capture:!0}),r.addEventListener("mouseup",this._handleEndMovement,{capture:!0})),"custom_content"!==this.props.actionType&&(r.addEventListener("scroll",this.mediumThrottleReset),n?r.addEventListener("resize",this.shortThrottleReset):r.addEventListener("resize",this.longThrottleReset),this.setInputFocus()),this.timer=setTimeout(function(){var t=e.getModalContentHeight();e.setState({modalPositionData:e.setModalPosition(t),autoHeight:t})},80)}},{key:"componentWillUnmount",value:function(){this.is_mounted=!1,clearTimeout(this.timer),this.shortThrottleReset.cancel(),this.mediumThrottleReset.cancel(),this.longThrottleReset.cancel();var e=this.isLibrary(),t=P()(["phone","tablet"],I()(this,"props.previewMode"));z.a.removeModuleLibraryLoadedListener(this._onLibraryLoaded),z.a.removeProductTourChangeElementListener(this._onProductTourElementChange);var n=K.default.condition("is_bfb")||t?K.default.topWindow():K.default.appWindow();"custom_content"!==this.props.actionType&&(n.removeEventListener("scroll",this.mediumThrottleReset),e?n.removeEventListener("resize",this.shortThrottleReset):n.removeEventListener("resize",this.longThrottleReset)),this.props.movable&&(n.removeEventListener("mousemove",this._handleStartMovement),n.removeEventListener("mouseup",this._handleEndMovement))}},{key:"componentWillUpdate",value:function(e){e.active&&this.props.currentTourElement===e.currentTourElement||this.setState({modalPositionData:{}});var t=this.props.modalMoving!==e.modalMoving;"load_layout"===this.props.actionType&&!this.state.helpModalMoved&&this.props.helpModalActive&&t&&this.setState({helpModalMoved:!0,resetModalStyles:f()(),modalPositionData:this.setModalPosition()}),this.props.helpModalActive===e.helpModalActive||e.helpModalActive||this.setState({helpModalMoved:!1})}},{key:"componentDidUpdate",value:function(t,n){"add_module"!==this.props.actionType||z.a.isProductTourActive()||this.loadLibraryModules();e(c.a.findDOMNode(this));if(t.active!==this.props.active||n.active_tab!==this.state.active_tab||t.actionType!==this.props.actionType||t.specialtyModal!==this.props.specialtyModal||!E()(t.modalPosition,this.props.modalPosition)||t.preloadingItems!==this.props.preloadingItems){this.props.active?t.actionType!==this.props.actionType&&this.setState({active_tab:"modules_all"}):(this.setState({resetModalStyles:!1,active_tab:"modules_all",filterByTitle:"",library_category:"all",importBackUp:"off",importFile:"",importError:"",applyTransitionAnimation:"no"}),this.windowScrolled=!1),this.debouncedSetInputFocus();var r=e(c.a.findDOMNode(this.refs.settingsTabsNav)),o=r.children().size(),i=100/o,a=z.a.getModuleAddAfter();2===o&&r.children().css({maxWidth:i+"%"});var s=this.getModalContentHeight(),l=this.setModalPosition(s),u=I()(l,"style.position"),d=I()(n.modalPositionData,"style.position");this.setState({selectedItemIndex:K.default.hasValue(this.state.filterByTitle)?1:0,modalPositionData:l,autoHeight:s,applyTransitionAnimation:"add_module"===this.props.actionType&&I()(a,"autoAddModule")||u!==d?"no":"normal"})}this.state.selectedItemUpdated&&(this.centerizeSelectedItem(),this.setState({selectedItemUpdated:!1}));var p=this.props.helpModalActive!==t.helpModalActive;"load_layout"===this.props.actionType&&p&&this.setState({resetModalStyles:f()(),modalPositionData:this.setModalPosition()});var h=this.props.modalMoving!==t.modalMoving;"load_layout"===this.props.actionType&&this.props.helpModalActive&&h&&this.setState({resetModalStyles:f()(),modalPositionData:this.setModalPosition()})}},{key:"shouldComponentUpdate",value:function(e,t){return!E()(this.state,t)||!E()(this.props,e)}},{key:"getModalContentHeight",value:function(){var t=e(c.a.findDOMNode(this)),n="modules_library"===this.state.active_tab&&"add_module"===this.props.actionType&&""===t.find(".et-fb-settings-options .et-fb-settings-options-tab-modules_library ul").text()?300:0,r=t.find(".et-fb-save-library-button").length>0?40:0,o=t.find(".et-fb-settings-tabs-nav").length>0?100:60,i=0;return t.find(".et-fb-settings-options").length>0&&(!v()(this.props.modalWidth)&&this.props.modalWidth&&t.find(".et-fb-settings-options").width(this.props.modalWidth),i=0===n?t.find(".et-fb-settings-options").innerHeight():n,!v()(this.props.modalWidth)&&this.props.modalWidth&&t.find(".et-fb-settings-options").width("auto")),oe||"portability"!==this.props.actionType||(i+=25),i+r+o}},{key:"setInputFocus",value:function(){var e=K.default.$appWindow(this.modal.current),t=I()(e.find(".et-fb-settings-options-wrap").offset(),"top",0),n=I()(e.find(".et-fb-settings-options-tab--active").offset(),"top",0)-t;if(e.focus().find('input[type="text"]:visible:first').focus(),n<0&&e.find(".et-fb-settings-options-tab").length){var r=parseInt(e.find(".et-fb-settings-options").css("paddingTop")),o=Math.abs(n)+r;e.find(".et-fb-settings-options-wrap").scrollTop(o),setTimeout(function(){e.find(".et-fb-settings-options-wrap").scrollTop(o)},0)}}},{key:"_handleStartMovement",value:function(e){if(!this.state.move)return!1;var t=this.state.modalPositionData,n="absolute"===t.style.position?e.pageX:e.pageX-K.default.$topWindow().scrollLeft(),r="absolute"===t.style.position?e.pageY:e.pageY-K.default.$topWindow().scrollTop();return n-=this.state.reactive.x,r-=this.state.reactive.y,t.style.top=r,t.style.left=n,this.setState({resetModalStyles:f()(),modalPositionData:t})}},{key:"_handleMove",value:function(t){if(this.props.movable){var n="absolute"===this.state.modalPositionData.style.position?e(Object(u.findDOMNode)(this)).position():e(Object(u.findDOMNode)(this)).offset();this.setState({reactive:{x:t.pageX-n.left,y:t.pageY-n.top},move:!this.state.move})}}},{key:"_handleEndMovement",value:function(t){if(this.state.move){var n=e("#et-fb-app").offset(),r=K.default.$topWindow().width(),o=K.default.$topWindow().height(),i=this.state.modalPositionData;if("absolute"!==i.style.position&&(i.style.top+400>o||i.style.top<0)||"absolute"===i.style.position&&i.style.top<0&&Math.abs(i.style.top)>n.top){var a=50;"absolute"===i.style.position&&i.style.top<0&&Math.abs(i.style.top)>n.top&&(a+=i.style.top+(Math.abs(i.style.top)-n.top)),i.style.top=i.style.top<0?a:o-400}if("absolute"!==i.style.position&&i.style.left<0||i.style.left+400>r||"absolute"===i.style.position&&i.style.left<0&&Math.abs(i.style.left)>n.left){var s=50;"absolute"===i.style.position&&i.style.left<0&&Math.abs(i.style.left)>n.left&&(s+=i.style.left+(Math.abs(i.style.left)-n.left)),i.style.left=i.style.left<0?s:r-400}return this.setState({move:!1,modalPositionData:i})}}},{key:"_onProductTourElementChange",value:function(){this.setState({currentTourElement:z.a.getActiveProductTourElement()})}},{key:"_onModuleItemMouseEnter",value:function(e){this.setState({selectedItemIndex:e})}},{key:"_onModuleItemMouseLeave",value:function(){this.setState({selectedItemIndex:0})}},{key:"setMaxItemIndex",value:function(e,t){this.maxItemIndex[t]=e}},{key:"tabNavClassName",value:function(e){var t={};return t["et-fb-settings-options_tab_"+e]=!0,t["et-fb-settings-tabs-nav-item"]=!0,e===this.state.active_tab&&(t["et-fb-settings-tabs-nav-item--active"]=!0),l()(t)}},{key:"centerizeSelectedItem",value:function(){var t=e(c.a.findDOMNode(this)),n=t.find(".et-fb-settings-options-wrap"),r=t.find(".et-fb-settings-options-tab:visible .et-fb-selected-item");if(r.length){var o=r.offset(),i=r.parent().offset();n.stop().animate({scrollTop:o.top-i.top})}}},{key:"_onKeyDownEvent",value:function(t){if(!z.a.isProductTourActive()){var n=this,r=e(c.a.findDOMNode(this)),o=this.state.selectedItemIndex,i=t.keyCode;if(13===i&&(r.find(".et-fb-selected-item:visible").trigger("click"),"change_structure"===this.props.actionType&&W.b.cancelTooltip()),P()([38,39,40,37],i)){P()([38,40],i)&&t.preventDefault();var a=void 0,s=void 0;if("change_structure"===this.props.actionType?(r.find(".et-fb-module-settings"),s=(a=r.find(".et-fb-columns-layout")).find(".et-fb-selected-item")):(r.find(".et-fb-settings-options-wrap"),s=(a=r.find(".et-fb-settings-options-tab:visible")).find(".et-fb-selected-item")),s.length){var l=a.width(),u=s.width(),d=Math.floor(l/u),p=0;switch(i){case 38:p=o-d;break;case 39:p=o+1;break;case 40:p=o+d;break;case 37:p=o-1}p>0&&p<=this.maxItemIndex[this.state.active_tab]&&this.setState({selectedItemIndex:p,selectedItemUpdated:!0})}else this.setState({selectedItemIndex:1,selectedItemUpdated:!0})}if(27===i&&W.b.cancelTooltip(),9===i&&!r.closest(".et-fb-modal-settings--library")&&!e(t.target).is("input:focus, button:focus")){var f="modules_all"===this.state.active_tab?"modules_library":"modules_all",h=r.find(".et-fb-columns-layout");if(this.setState({active_tab:f}),h.length&&"change_structure"===this.props.actionType){var g=h.find(".et-fb-column-layout--selected"),m=g;(m=t.shiftKey?g.prev().length?g.prev():h.find("li").last():g.next().length?g.next():h.find("li").first()).trigger("click"),setTimeout(function(){n.setState({selectedItemIndex:m.index()+1})},0)}return t.preventDefault(),!1}}}},{key:"getModuleType",value:function(){if(this.isLibrary())return"layout";var e=z.a.getModuleAddAfter(),t=e.type;if(e.is_parent)switch(t){case"et_pb_section":t="yes"===e.fullwidth?"et_pb_module":"et_pb_row";break;case"et_pb_column":t=e.is_inner_row?"et_pb_row_inner":"et_pb_module"}return P()(["et_pb_section","et_pb_row","et_pb_row_inner"],t)||(t="et_pb_module"),t}},{key:"isAddingIntoGlobal",value:function(){return z.a.getModuleAddAfter().is_global}},{key:"_preventRightClick",value:function(t){this.props.enableContextMenu||e(t.target).is("input:focus")||t.preventDefault()}},{key:"getLibraryCategoriesList",value:function(){var e=ETBuilderBackend.saveModuleLibraryCategories,t={};return t.all=ETBuilderBackend.i18n.saveModuleLibraryAttrs.allCategoriesText,C()(e)||k()(e,function(e){t[e.slug]=e.name}),t}},{key:"generateAddModuleContent",value:function(){var e=y()(ETBuilderBackend.modules,{is_parent:"on"}),t="",n=this,r=z.a.getModuleAddAfter(),i=r.type,a=this.props.specialtyModal,s={allModulesList:{},mainTabTitle:"",modalTitle:"",moduleType:"",settingsModalClass:[]};if(this.maxItemIndex.modules_all=0,s.mainTabTitle=ne.newModule,s.modalTitle=ne.insertModule,!0===a){var l=0;s.modalTitle=ne.insertColumn,this.maxItemIndex.modules_all=0,t=g()([["1_2,1_2","1,0"],["1_2,1_2","0,1"],["1_4,3_4","0,1"],["3_4,1_4","1,0"],["1_4,1_2,1_4","0,1,0"],["1_2,1_4,1_4","1,0,0"],["1_4,1_4,1_2","0,0,1"],["1_3,2_3","0,1"],["2_3,1_3","1,0"]],function(e,t){var r=e[0].split(","),i={layoutType:e[1],layoutFormat:e[0],columns:r,specialtyColumns:3};return l++,n.maxItemIndex.modules_all++,o.a.createElement(G.a,{label:e[0],title:e[0],key:l,specialtyLayout:i,itemIndex:n.maxItemIndex.modules_all,selectedItemIndex:n.state.selectedItemIndex,onMouseEnter:n._onModuleItemMouseEnter})}),s.allModulesList=o.a.createElement("ul",{onMouseLeave:this._onModuleItemMouseLeave},t)}else if("et_pb_section"!==i&&"et_pb_row"!==i&&"et_pb_row_inner"!==i&&!r.is_inner_row||"et_pb_section"===i&&"yes"===r.fullwidth&&r.is_parent)t=g()(e,function(e){if(!P()(["et_pb_section","et_pb_row","et_pb_row_inner","et_pb_column","et_pb_column_inner"],e.label)){var t=void 0!==e.fullwidth_only&&"on"===e.fullwidth_only,r=z.a.getModuleAddAfter(),i=z.a.getProductTourModuleName(),a=r.fullwidth,s={};if(!("yes"===a&&!t||"no"===a&&t||""!==n.state.filterByTitle&&-1===e.title.toLowerCase().indexOf(n.state.filterByTitle.toLowerCase())))return"selectModule"===n.state.currentTourElement&&i===e.label&&(s["et-fb-product-tour-element"]=!0),n.maxItemIndex.modules_all++,o.a.createElement(G.a,{label:e.label,title:e.title,fbSupport:e.vb_support,key:e.label,itemIndex:n.maxItemIndex.modules_all,selectedItemIndex:n.state.selectedItemIndex,icon:I()(e,"icon",""),iconSvg:I()(e,"icon_svg",""),onMouseEnter:n._onModuleItemMouseEnter,classnames:s})}}),s.allModulesList=o.a.createElement("ul",{onMouseLeave:this._onModuleItemMouseLeave},t),s.moduleType="module";else if("et_pb_section"!==i||r.is_parent){if(("et_pb_row"===i||"et_pb_row_inner"===i)&&!r.is_parent||r.is_inner_row||"et_pb_section"===i&&r.is_parent){z.a.getLastAddedModuleData();var u={},c="regular",d="et_pb_column"===i?"et_pb_row_inner":i;s.settingsModalClass.et_fb_add_row_modal=!0,u.props={},"et_pb_row_inner"===d&&(c="specialty"),"on"===r.fullwidth&&(c="fullwidth"),u.props.section_parent=c,u.props.specialty_layout=r.specialty_layout,s.modalTitle=ne.insertRow,s.mainTabTitle=ne.newRow,s.allModulesList=o.a.createElement(q.a,Z({active:"true",_onClick:this.addRow,row:u,selectedItemIndex:n.state.selectedItemIndex,setMaxItemIndex:n.setMaxItemIndex,currentTourElement:n.state.currentTourElement},this.props))}}else{var p={et_fb_regular:ne.regular,et_fb_fullwidth:ne.fullwidth,et_fb_specialty:ne.specialty};this.maxItemIndex.modules_all=0,s.modalTitle=ne.insertSection,s.mainTabTitle=ne.newSection,s.settingsModalClass.et_fb_add_section_modal=!0,t=g()(["et_fb_regular","et_fb_specialty","et_fb_fullwidth"],function(e){var t={};return n.maxItemIndex.modules_all++,"selectSectionType"===n.state.currentTourElement&&"et_fb_regular"===e&&(t["et-fb-product-tour-element"]=!0),o.a.createElement(G.a,{label:e,title:p[e],key:e,itemIndex:n.maxItemIndex.modules_all,selectedItemIndex:n.state.selectedItemIndex,onMouseEnter:n._onModuleItemMouseEnter,classnames:t})}),s.allModulesList=o.a.createElement("ul",{onMouseLeave:this._onModuleItemMouseLeave},t)}return s}},{key:"handle_tab_click",value:function(e){e.preventDefault(),this.isLibrary()&&this.state.library_loading||this.setState({active_tab:e.target.className,libraryBackToLayouts:!0})}},{key:"getSavedModulesList",value:function(){var e=this.getModuleType(),t=this.getSavedModulesArray(),n="";if(this.maxItemIndex.modules_library=0,!C()(t))if("string"==typeof t)n=t;else{var r=this,i="",a=[];if("et_pb_row_inner"===e){var s=z.a.getModuleAddAfter();i=s.saved_specialty_column_type,a=3===("3_4"===i?3:2)?["4_4","1_2,1_2","1_3,1_3,1_3"]:["4_4","1_2,1_2"]}n=g()(t,function(t,n){if((""===i||P()(a,t.row_layout))&&("all"===r.state.library_category||P()(t.categories,r.state.library_category))){if(!I()(t,"shortcode.0.type"))return!1;var s="global"===t.is_global?t.ID:"",l={};return l.et_fb_global="global"===t.is_global,""!==r.state.filterByTitle&&-1===t.title.toLowerCase().indexOf(r.state.filterByTitle.toLowerCase())?!1:(r.maxItemIndex.modules_library++,o.a.createElement(G.a,{label:""!==t.module_type?t.module_type:e,title:t.title,key:n,savedShortcode:t.shortcode,globalID:s,onClickAction:"",itemIndex:r.maxItemIndex.modules_library,selectedItemIndex:r.state.selectedItemIndex,icon:I()(t,"icon",""),iconSvg:I()(t,"icon_svg",""),onMouseEnter:r._onModuleItemMouseEnter,classnames:l,isAddingIntoGlobal:r.isAddingIntoGlobal()}))}})}return n}},{key:"insertLayout",value:function(e){var t="on"===this.state.replace_layout;W.b.insertSavedModule(e,!0,t),W.b.cancelTooltip()}},{key:"loadLibraryModules",value:function(){var e=this.getModuleType(),t="et_pb_row_inner"===e?"et_pb_row":e,n="yes"===z.a.getModuleAddAfter().fullwidth&&"et_pb_module"===e?"fullwidth":"regular";!1===z.a.getLibraryModules(t,n)&&W.b.getLibraryModules(t,n)}},{key:"getSavedModulesArray",value:function(){var e=this.getModuleType();"et_pb_row_inner"===e&&(e="et_pb_row");var t="yes"===z.a.getModuleAddAfter().fullwidth&&"et_pb_module"===e?"fullwidth":"regular";return z.a.getLibraryModules(e,t)}},{key:"_onLibraryLoaded",value:function(){var e=this.getModuleType();"et_pb_row_inner"===e&&(e="et_pb_row");var t="yes"===z.a.getModuleAddAfter().fullwidth&&"et_pb_module"===e?"fullwidth":"regular";this.setState({library_modules_updated:t+e,currentTourElement:z.a.getActiveProductTourElement()})}},{key:"setModalPosition",value:function(t){if(this.props.ignorePosition)return{};var n=z.a.getModuleAddAfter(),r=n.type,o=this.props.specialtyModal,i=this.props.modalPosition,a=!v()(i)&&i,s=e(i.element).closest(".et-fb-skeleton"),l=oe?K.default.$topWindow("#et_pb_layout"):"",u=oe?l.offset().top:0,c=oe?l.offset().left:0,d=I()(this,"props.previewMode"),p=!v()(i)&&e(I()(i,"element","")),f=K.default.$topWindow("#wpadminbar").length>0?K.default.$topWindow("#wpadminbar").innerHeight():0,h={},g=!1,m=!1;a&&!1!==i.element&&"rightClickMenu"!==i.element&&(0===(g=p&&p.length>0?p:K.default.$topWindow(".et-fb-page-settings-bar .et-fb-button--toggle-portability")).length&&(g=K.default.$topWindow(".et-fb-page-settings-bar .et-fb-button--toggle-add")),m=g.hasClass("et-fb-page-settings--tools"),(g.hasClass("et-fb-button-group")||m)&&(g=K.default.$topWindow(g.context)));var b=g&&g.closest(".et-fb-page-settings-bar").length>0,y=g?g.innerHeight()/2:0,_=g?g.innerWidth()/2:0,k=K.default.$topWindow().width(),w=K.default.$topWindow().height(),C=g?g.offset():i,S=oe||P()(["zoom","tablet","phone"],d)?K.default.$topWindow().scrollTop():K.default.$appWindow().scrollTop(),E="rightClickMenu"===i.element;if("save_to_library"===this.props.actionType&&E&&(C.top=this.props.rightClickPosition.top,"zoom"===d&&(C.top=C.top/2),"app"===K.default.getWindowScrollLocation(d)&&(C.left=this.props.rightClickPosition.left)),oe&&(S-=u),h.class={},k<=502&&this.isLibrary())return h.style={top:0,left:0,right:!1,width:k,height:w,position:"fixed"},h;0===C.top&&0===C.left&&(C.top=i.top,C.left=i.left);var O=k<493?k-20:400,T=t||this.state.autoHeight,x=oe?-1*K.default.$topWindow("#adminmenuwrap").innerWidth():0,M=v()(this.props.modalHeight)||""===this.props.modalHeight?274:this.props.modalHeight,D=M,N=v()(this.props.modalWidth)||""===this.props.modalWidth?O:this.props.modalWidth,L="zoom"!==d||b||"rightClickMenu"===i.element?C.left:C.left/2,F=!1,A=0;if((L=L-N/2+_)>0){var j=C.left+N/2+_;L=j>k?L-(j-k)-10:L}else F=Math.abs(x)<=Math.abs(L),A=Math.abs(L)-Math.abs(x),L=F?x:L;"et_pb_section"!==r||n.is_parent||o?"et_pb_row_inner"===r||n.is_inner_row?M=188:"modules_library"!==this.state.active_tab&&"portability"!==this.props.actionType&&("et_pb_row"===r||"et_pb_section"===r&&n.is_parent&&!o&&"yes"!==n.fullwidth)?M=284:"et_pb_section"===r&&o?M=320:"add_module"===this.props.actionType&&(M=385):M=198,m&&(M=290),"change_structure"===this.props.actionType&&p&&p.length>0&&p.closest(".et_pb_row_inner").length>0&&(M=148),"clear_layout"===this.props.actionType&&(M=200),D=v()(T)||""===T?M:Math.max(M,Math.min(936,T));var R=!E||"save_to_library"===this.props.actionType||oe||P()(["zoom","tablet","phone"],d)?S:0,B=R+w,H=R+w/2,V=(!oe||!b)&&C.top>=H,G=V?C.top-R:B-C.top,U=oe?5:f+30,q=V?U:oe?117:100;C.top;if(oe&&b&&P()(["save_to_library","portability"],this.props.actionType)&&(G=w+S),D+q>G&&(D=Math.max(M,G-q)),b){var $=g.closest(".et-fb-page-settings-bar"),X=$.hasClass("et-fb-page-settings-bar--vertical"),Y=$.hasClass("et-fb-page-settings-bar--corner"),J=Y&&$.hasClass("et-fb-page-settings-bar--right-corner"),Q=Y&&$.hasClass("et-fb-page-settings-bar--left-corner"),Z=$.hasClass("et-fb-page-settings-bar--right"),ee=Y&&$.hasClass("et-fb-page-settings-bar--top-corner"),te=$.position().top,ne=oe?$.offset().top+parseInt($.height())+13:122,re=95,ie=Q?re:L<(X?80:10)?X?80:10:X?L-70:L,ae=this.isLibrary();if(Z&&(ie-=K.default.maybeGetScrollbarWidth()),("modules_library"===this.state.active_tab||P()(["save_to_library","portability","load_layout"],this.props.actionType))&&k<493&&(N=k<493?k-100-30:400),ae){var se=X||oe?30:parseInt($.height()),le=oe?0:60-f,ue=oe||!X&&!Y?50:re;D=w-f-se-le,N=Math.min(k-2*ue,1179),oe&&(re=0),X||Y||oe?(ne=ee?ne:f+le,(L=(k-N)/2)<15&&(L=15)):L=(k-N-K.default.getScrollbarWidth())/2}if((X||Y||this.props.helpModalActive&&!this.state.helpModalMoved||oe)&&(h.class["et-fb-tooltip--no-arrow"]=!0),32===te||oe)h.class={"et-fb-modal-settings--inversed":!oe||oe&&!ae,"et-fb-tooltip--no-arrow":X||Y||this.props.helpModalActive&&!this.state.helpModalMoved||oe&&ae,"et-fb-tooltip--vertical-center":X},ae&&!oe&&(D-=25);else{var ce=oe?0:U;if((ne=te-D)<ce){var de=ce-ne;ne+=de,D=Math.max(M,D-de)}oe||"save_to_library"!==this.props.actionType&&"clear_layout"!==this.props.actionType&&("portability"!==this.props.actionType||this.props.preloadingItems)||(h.class["et-fb-modal-settings--blue-bottom"]=!0)}"load_layout"===this.props.actionType&&this.props.helpModalActive&&"library"===this.props.helpModalTrigger&&!this.state.helpModalMoved&&(K.default.topWindow().innerWidth<1639&&K.default.topWindow().innerWidth>960?N-=this.props.helpModal.width:window.innerWidth>960&&(L-=this.props.helpModal.width/2));var pe=ae?L:!J&&ie;return h.style={top:ne,left:pe,right:!!J&&re,width:N,height:D,position:oe&&!ae?"absolute":"fixed"},h}var fe=(oe?K.default.$topWindow("#et-bfb-app-frame"):K.default.$topWindow("#et-fb-app-frame")).offset(),he=fe.top;if(s.length>0){var ge="save_to_library"===this.props.actionType&&s.hasClass("et-fb-skeleton--row")?38:10;s.offset().left+ge}"app"===K.default.getWindowScrollLocation(d)&&0===S&&0===he&&C.top>w&&setTimeout(function(){W.b.cancelTooltip()},300),he=oe||P()(["zoom","tablet","phone"],d)||E&&"save_to_library"!==this.props.actionType||this.props.renderInsideApp?he:he-S;var me="zoom"===d&&"rightClickMenu"!==i.element?C.top/2:C.top;me=me-D+he,this.props.forceFixedPosition||(L+=E?c:fe.left),L+N>k&&(L=k-N);var ve=0>L&&(this.props.forceFixedPosition||Math.abs(L)>fe.left)?10:L;if(ve=30>ve?30:ve,h.style={top:me,left:ve,width:N,height:D,position:this.props.forceFixedPosition?"fixed":"absolute"},this.props.forceFixedPosition&&"custom_content"===this.props.actionType)return(h.style.top<0||h.style.top+D>w)&&(h.style.top=h.style.top<0?50:w-D-100),(h.style.left<0||h.style.left+N>k)&&(h.style.left=h.style.left<0?50:k-N-100),h;"save_to_library"===this.props.actionType&&(h.class["et-fb-modal-settings--blue-bottom"]=!0);var be="app"===K.default.getWindowScrollLocation(d),ye=E&&be?K.default.$appWindow().scrollTop()-this.state.appWindowScrollTopOnload:0;if(h.style.top=h.style.top-ye,!V){var _e=D+y+15;h.style.top=h.style.top+_e,_e,_e,!oe&&h.style.height+q+y+15>G&&(h.style.height=h.style.height-y-15),h.class={"et-fb-modal-settings--inversed":!0},"save_to_library"===this.props.actionType&&(h.class["et-fb-modal-settings--blue-bottom"]=!1)}var ke=V&&oe?D:D+q;if(!this.windowScrolled&&D===M&&ke>G){var we=ke-G,Ce="desktop"!==d||oe?K.default.$topWindow().scrollTop():K.default.$appWindow().scrollTop(),Se=V?Ce-we:Ce+we;("desktop"!==d||oe?K.default.$topWindow("html, body"):K.default.$appWindow("html, body")).animate({scrollTop:Se},500,"swing")}if(F){var Ee=K.default.$topWindow("head"),Oe="et-fb-modal-edge-style",Te=".et-db #et-boc .et-fb-modal-add-module-container.et-fb-modal-settings--left-side:after {left: "+(200-A-30)+"px;}";Ee.remove("#"+Oe),Ee.append('<style id="'+Oe+'">'+Te+"</style>"),h.class["et-fb-modal-settings--left-side"]=!0}return this.windowScrolled=!0,h}},{key:"addRow",value:function(e,t){t=v()(t)?"et_pb_row":t,W.b.insertNewModule(t,e)}},{key:"_onClearLayout",value:function(e){e.preventDefault(),z.a.abIsMode("off")&&(W.b.performLayoutClearing(),W.b.cancelTooltip())}},{key:"_onClose",value:function(){A.a!==this.props._closeFunction?this.props._closeFunction():W.b.cancelTooltip()}},{key:"_onInput",value:function(e,t){var n=te({},e,t);"filterByTitle"===e&&K.default.hasValue(this.state.filterByTitle)&&(n.selectedItemIndex=1,n.selectedItemUpdated=!0),this.setState(n)}},{key:"isPreloadingItems",value:function(e){return!!this.props.preloadingItems&&z.a.isPreloadingItem(e)}},{key:"render",value:function(){var e,t=this;if(!this.props.active)return!1;var n=z.a.getAppPreference("builder_animation"),i=L()((te(e={"et-fb-settings":!0,"et-fb-tooltip-modal":!0},"et-fb-tooltip-modal--"+this.props.actionType,!0),te(e,"et-fb-modal-settings--container",!0),te(e,"et-fb-modal-settings--"+this.state.active_tab,!0),te(e,"et-fb-modal-add-module-container",!0),te(e,"et-fb-moving",this.state.move),te(e,"et-fb-movable-modal",this.props.movable),te(e,"et-fb-tooltip-modal-animated","normal"===this.state.applyTransitionAnimation),te(e,"et-fb-tooltip-modal-animated-fast","fast"===this.state.applyTransitionAnimation),e),this.props.classNames),a=!v()(this.state.modalPositionData),s=a&&!C()(this.state.modalPositionData)?this.state.modalPositionData:this.setModalPosition(),u=s.style,p="",f="";v()(s.class)||L()(i,s.class);var h="";switch(this.props.actionType){case"add_module":var g=this.generateAddModuleContent(),m=g.allModulesList,b=g.mainTabTitle,y=z.a.isProductTourActive()?z.a.getActiveProductTourElement():"",_={maxHeight:I()(u,"height",100)-100};"selectSectionType"===y&&(_.overflow="visible"),p=g.modalTitle,L()(i,g.settingsModalClass);var k="module"===g.moduleType?o.a.createElement("div",{className:"et-fb-modules-filters et-fb-module-single-filter"},o.a.createElement(Q.a,{type:"text",value:this.state.filterByTitle,name:"filterByTitle",_onChange:this._onInput,onKeyDown:this._onKeyDownEvent,additional_attrs:{placeholder:ne.search}})):"",w=z.a.isAllowedAction("add_library")&&z.a.isAllowedAction("divi_library")?o.a.createElement("li",{className:this.tabNavClassName("modules_library")},o.a.createElement("a",{href:"#",className:"modules_library",onClick:this.handle_tab_click},ne.addFromLibrary)):"",S=z.a.isAllowedAction("add_library")&&z.a.isAllowedAction("divi_library")?o.a.createElement("div",{className:this.tabClassName("modules_library")},o.a.createElement("div",{className:"et-fb-modules-filters"},o.a.createElement(Y.a,{options:this.getLibraryCategoriesList(),value:this.state.library_category,name:"library_category",_onChange:this._onInput}),o.a.createElement(Q.a,{type:"text",value:this.state.filterByTitle,name:"filterByTitle",_onChange:this._onInput,additional_attrs:{placeholder:ne.search}})),o.a.createElement("ul",{onMouseLeave:this._onModuleItemMouseLeave},this.getSavedModulesList()),o.a.createElement(J.a,{isLoading:this.isPreloadingItems("module")},o.a.createElement($.a,{videoListId:"et_pb_save_to_library",trigger:"tooltip"}))):"";h=o.a.createElement("div",{className:"et-fb-main-settings et-fb-main-settings--add_new_module"},o.a.createElement("ul",{className:"et-fb-settings-tabs-nav",ref:"settingsTabsNav"},o.a.createElement("li",{className:this.tabNavClassName("modules_all")},o.a.createElement("a",{href:"#",className:"modules_all",onClick:this.handle_tab_click},b)),w),o.a.createElement("div",{className:"et-fb-settings-options-wrap",style:_},o.a.createElement("div",{className:"et-fb-settings-options"},o.a.createElement("div",{className:this.tabClassName("modules_all")},k,m),S)));break;case"load_layout":var E="et-fb-modal-settings--library";if(i[E]=!0,this.state.hasBackButton){i[E+"__layout"]=!0;var O={position:Object(d.spring)(-12,{stiffness:100,damping:10}),opacity:Object(d.spring)(1,{stiffness:100,damping:10})};p=o.a.createElement(d.Motion,{defaultStyle:{position:-40,opacity:0},style:O},function(e){return o.a.createElement("div",null,o.a.createElement(X.a,{className:"et-fb-settings-button--back",buttonName:H.a.LIBRARY_MODAL_BACK_BUTTON,_onClick:t._onClickLibraryBackButton,primary:!0,style:{opacity:e.opacity,transform:"translateX( "+e.position+"% )"}},o.a.createElement(V.a,{size:"14",icon:"back",color:"#FFFFFF"})),ne.layoutDetails)})}else p=ne.loadLayout;h=o.a.createElement(R.a,{isLoading:this.state.library_loading,_renderTabs:this._renderTabs,doneLoading:this._onLibraryDoneLoading,pageChanged:this._onLibraryPageChanged,backToLayouts:this.state.libraryBackToLayouts,tabClassName:this.tabClassName,active_tab:this.state.active_tab,layoutFilters:this.props.layoutFilters,type:"layout",isProductTour:z.a.isProductTourActive(),productTourElement:this.state.currentTourElement,modalMoving:this.props.modalMoving,width:u.width,height:u.height});break;case"save_to_library":i.et_fb_save_module_modal=!0,p=ne.addToLibrary,h=o.a.createElement(U.a,{maxHeight:I()(u,"height",70)-70});break;case"change_structure":var T=z.a.getStructurallyChangedRow();p=ne.changeRow,h=o.a.createElement("div",{className:"et-fb-settings-options-wrap",style:{maxHeight:I()(u,"height",100)-60}},o.a.createElement("div",{className:"et-fb-settings-options"},o.a.createElement(q.a,{row:T,selectedItemIndex:this.state.selectedItemIndex,setMaxItemIndex:this.setMaxItemIndex})));break;case"clear_layout":p=ne.clearLayout,h=o.a.createElement("div",{className:"et_fb_save_module_modal et_fb_clear_layout"},o.a.createElement("div",{className:"et-fb-settings-options"},ne.clearLayoutText),o.a.createElement("a",{href:"#",className:"et-fb-save-library-button",onClick:this._onClearLayout},ne.yes));break;case"portability":p=ne.portability,h=o.a.createElement(B.a,{_renderTabs:this._renderTabs,preloadingItems:this.props.preloadingItems,tabClassName:this.tabClassName,active_tab:this.state.active_tab,maxHeight:I()(u,"height",140)-140});break;case"custom_content":p=this.props.tooltipTitle,f=v()(this.props.buttons)?"":this.props.buttons,h=o.a.createElement("div",{className:"et-fb-main-settings et-fb-settings-options"},this.props.children)}var x=a?1:0,M="custom_content"!==this.props.actionType?"et-fb-tooltip-helper-container":"et-fb-tooltip-helper-container-custom",D=I()(u,"position",""),P=o.a.createElement(r.Fragment,null,o.a.createElement(d.Motion,{key:D,defaultStyle:{size:.5},style:{size:n?Object(d.spring)(1,{stiffness:300,damping:20}):1}},function(e){return o.a.createElement("div",{key:"modal",id:"et-fb-settings-column",ref:t.modal,className:l()(i),onContextMenu:t._preventRightClick,onKeyDown:t._onKeyDownEvent,tabIndex:"0",style:Z({},u,{opacity:x,transform:"scale( "+e.size+" )"})},o.a.createElement("div",{className:M},o.a.createElement("div",{className:"et-fb-module-settings"},o.a.createElement("h3",{className:"et-fb-settings-heading",onMouseDown:t._handleMove},p,o.a.createElement(X.a,{className:"et-fb-settings-button--close",buttonName:H.a.MODAL_SETTINGS_BUTTON_CLOSE,_onClick:t._onClose,primary:!0},o.a.createElement(V.a,{size:"14",icon:"close",color:"#FFFFFF"}))),h,f)))}),this.isLibrary()&&K.default.isBFB()&&o.a.createElement("div",{className:"et-core-modal-overlay et-core-active et-core-modal-overlay--library"}));return this.props.renderInsideApp?P:c.a.createPortal(P,K.default.$topWindow("#et-boc #et-fb-app")[0])}}]),n}();se.propTypes=ie,se.defaultProps=ae,t.default=se}.call(this,n(28))},function(e,t,n){"use strict";(function(e){var r=n(1),o=n.n(r),i=n(16);t.a=function(t){var n=t.progress,r=t.time_remaining;if(0===n)return!1;var a={width:Object(i.spring)(n,{stiffness:300,damping:30})};return n<100?o.a.createElement("div",{className:"et-fb-tooltip-modal--progress"},o.a.createElement("div",{className:"et-fb-tooltip-modal--progress-bar"},o.a.createElement(i.Motion,{defaultStyle:{width:0,opacity:100},style:a},function(e){return o.a.createElement("div",{className:"et-fb-tooltip-modal--progress-chart",style:{width:e.width+"%"}},o.a.createElement("div",{className:"et-fb-tooltip-modal--progress-label"},parseInt(e.width),"%"))})),o.a.createElement("div",{className:"et-fb-tooltip-modal--time-estimation"},r>0&&e.appWindow().etCore.portability.text.importing.replace("<span>1</span>",r))):o.a.createElement("span",{className:"et-fb-tooltip-modal--loader et-core-loader et-core-loader-success"})}}).call(this,n(0))},function(e,t,n){"use strict";var r=n(1),o=n.n(r),i=n(6),a=n.n(i),s=n(18),l=n.n(s),u=n(48),c=n.n(u),d=n(757),p=n.n(d),f=(n(1216),function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}());function h(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var g=function(e){function t(){var e,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var i=arguments.length,a=Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=r=h(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a))),r.defaultStyle={width:"200%",height:"200%",top:"-50%",left:"-50%"},r._onClick=function(e){e.preventDefault(),r.props.stopPropagation&&e.stopPropagation(),r.props._onClick(r)},r._renderRipple=function(){return o.a.createElement(p.a,{radius:150,duration:1200,background:!1,options:{background:!1},style:r.defaultStyle})},h(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r["PureComponent"]),f(t,[{key:"componentDidMount",value:function(){this.props.componentDidMount(this)}},{key:"componentDidUpdate",value:function(){this.props.componentDidUpdate(this)}},{key:"render",value:function(){var e=l()({"et-fb-button":!0,"et-fb-button--block":this.props.block,"et-fb-button--danger":this.props.danger,"et-fb-button--danger-alt":this.props.danger&&this.props.alt,"et-fb-button--elevate":this.props.elevate,"et-fb-button--globalitem":this.props.globalitem,"et-fb-button--info":this.props.info,"et-fb-button--info-alt":this.props.info&&this.props.alt,"et-fb-button--inverse":this.props.inverse,"et-fb-button--large":this.props.large,"et-fb-button--primary":this.props.primary,"et-fb-button--primary-alt":this.props.primary&&this.props.alt,"et-fb-button--round":this.props.round,"et-fb-button--small":this.props.small,"et-fb-button--success":this.props.success,"et-fb-button--active":this.props.activeButton,"et-fb-button--warning":this.props.warning,"et-fb-button--tooltip":this.props.isTooltipButton},this.props.className);return"button"===this.props.tagName?o.a.createElement("button",{type:this.props.type,"data-tip":this.props.tooltip,className:e,style:this.props.style,onClick:this._onClick,onMouseDown:this.props.onMouseDown,onMouseUp:this.props.onMouseUp,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave,disabled:this.props.disabled},this.props.children,this.props.ink?this._renderRipple():null):o.a.createElement(this.props.tagName,{className:e,"data-tip":this.props.tooltip,style:this.props.style,onClick:this._onClick,onMouseDown:this.props.onMouseDown,onMouseUp:this.props.onMouseUp},this.props.children,this.props.ink?this._renderRipple():null)}}]),t}();g.defaultProps={type:"button",tagName:"button",block:!1,elevate:!1,ink:!0,inverse:!1,large:!1,primary:!1,success:!1,small:!1,disabled:!1,disableClick:!1,additionalAttrs:{},onMouseDown:c.a,onMouseUp:c.a,onMouseEnter:c.a,onMouseLeave:c.a,componentDidMount:c.a,componentDidUpdate:c.a,_onClick:c.a,stopPropagation:!1},g.propTypes={block:a.a.bool,children:a.a.node,tagName:a.a.string,elevate:a.a.bool,danger:a.a.bool,ink:a.a.bool,inverse:a.a.bool,large:a.a.bool,primary:a.a.bool,round:a.a.bool,success:a.a.bool,info:a.a.bool,alt:a.a.bool,warning:a.a.bool,small:a.a.bool,disabled:a.a.bool,disableClick:a.a.bool,additionalAttrs:a.a.object,type:a.a.string,onMouseDown:a.a.func,onMouseUp:a.a.func,_onClick:a.a.func,componentDidMount:a.a.func,componentDidUpdate:a.a.func,className:a.a.oneOfType([a.a.string,a.a.object]),style:a.a.object};var m=g,v=n(70),b=n(4),y=n.n(b),_=n(87),k=n.n(_),w=n(2),C=n.n(w),S=n(27),E=n.n(S),O=n(128),T=n.n(O),x=n(287),M=(n(1217),Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}),D=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var P=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));N.call(n);var r=E()(n.props.value),o=E()(n.props.default);return n.state={value:r===o?"":r},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r["PureComponent"]),D(t,[{key:"componentDidUpdate",value:function(e){var t=this.props.value;e.value===t||this.userUpdate||this.setState({value:t}),this.userUpdate=!1}},{key:"getDefaultValue",value:function(){return E()(this.props.default)}},{key:"_emitChange",value:function(){this.userUpdate=!0,this.props._onChange(this.props.name,this.state.value)}},{key:"render",value:function(){var e=C()(this.props,"additional_attrs",{}),t={"et-core-control-input":!0};this.props.className&&(t[this.props.className]=!0),this.props.readonly&&(e.readOnly=!0);var n=this.props,r=n.id,i=n.type;return r||(r="et-fb-"+this.props.name),i||(i="text"),o.a.createElement("input",M({className:l()(t),type:i,value:this.state.value,name:this.props.name,id:r,onChange:c.a,onInput:this._onInput,onBlur:this._onBlur,placeholder:this.getDefaultValue()},e))}}]),t}();P.propTypes={name:a.a.string.isRequired};var N=function(){var e=this;this.emitChange=k()(this._emitChange,0,{leading:!1}),this.userUpdate=!1,this._onInput=function(t){var n=t.target.value;e.setState({value:n}),e.emitChange.cancel(),e.emitChange()},this._onBlur=function(t){var n=x.a.decodeHtmlEntities(t.target.value);!y()(e.props.valueMin)&&T()(n)<e.props.valueMin&&(n=e.props.valueMin),!y()(e.props.valueMax)&&T()(n)>e.props.valueMax&&(n=e.props.valueMax),e.props._onChange(e.props.name,n),e.setState({value:n})}},L=P,F=n(1051),A=(n(1063),n(1064),n(16)),j=n(36),I=n.n(j),R=n(11),B=n.n(R),H=n(12),W=n.n(H),V=n(95),G=n.n(V),U=n(7),z=n.n(U),q=n(28),K=n.n(q),$=n(43),X=n.n($),Y=n(31),J=n.n(Y),Q=n(277),Z=n.n(Q),ee=n(57),te=n.n(ee),ne=n(78),re=n.n(ne),oe=n(33),ie=n(17),ae=n.n(ie),se=n(1054),le=n(147),ue=n.n(le),ce=n(74),de=n.n(ce),pe="module_item",fe=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},he=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function ge(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var me={hover:function(e,t,n){var r=t.getItem().index,o=e.index;if(r!==o){var i=ae.a.findDOMNode(n).getBoundingClientRect(),a=(i.bottom-i.top)/2,s=t.getClientOffset().y-i.top;r<o&&s<a||r>o&&s>a||(e.moveItem(r,o),t.getItem().index=o)}}},ve=function(e){function t(){var e,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var i=arguments.length,a=Array(i),s=0;s<i;s++)a[s]=arguments[s];return n=r=ge(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a))),r.preventModalKeyPress=function(e){r.props.useInput&&"Enter"===e.key&&e.preventDefault()},r.handleOnKeyUp=function(e){r.props.useInput&&"Enter"===e.key&&(e.preventDefault(),r.props.onAdd())},r._renderCheckbox=function(){return o.a.createElement("a",{href:"#",className:r.props.checkClasses,onClick:r.props.onCheck})},ge(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r["PureComponent"]),he(t,[{key:"_renderInput",value:function(){var e={};return this.props.readonly&&(e.readOnly=!0),o.a.createElement("input",fe({type:"text",value:this.props.value,onChange:this.props.onChange,onKeyPress:this.preventModalKeyPress,onKeyUp:this.handleOnKeyUp},e))}},{key:"_renderActions",value:function(e){var t=this;return I()(e,function(e){if("link"===e&&!t.props.isCheckbox&&!t.props.isRadio)return!1;var n="on"+ue()(e),r="link"===e?"text-link":e;return o.a.createElement("a",{href:"#",key:e,className:"et-core-control-sortable-list__"+e,onClick:t.props[n]},o.a.createElement(oe.a,{icon:r,color:"rgb(163, 176, 194)"}))})}},{key:"_renderLeftSideActions",value:function(){var e=de()(this.props.left_actions.split("|"));return o.a.createElement("div",{className:"et-core-control-sortable-list__actions--left"},this._renderActions(e))}},{key:"_renderRightSideActions",value:function(){var e=de()(this.props.right_actions.split("|"));return o.a.createElement("div",{className:"et-core-control-sortable-list__actions--right"},this._renderActions(e))}},{key:"render",value:function(){var e=this.props,t=e.isDragging,n=e.connectDragSource,r=e.connectDropTarget,i={opacity:this.props.isDragging?0:1},a=l()({"et-core-control-sortable-list__row--dragged":t,"et-core-control-sortable-list__row--no-input":!this.props.useInput},this.props.classes);return n(r(o.a.createElement("div",{className:a,style:i},(this.props.isRadio||this.props.isCheckbox)&&this._renderCheckbox(),this._renderLeftSideActions(),this.props.useInput&&this._renderInput(),this.props.useInput||o.a.createElement("span",null,this.props.value),this._renderRightSideActions())))}}]),t}();ve.defaultProps={left_actions:"",right_actions:"move|copy|delete"},ve.propTypes={id:a.a.any.isRequired,classes:a.a.string.isRequired,checkClasses:a.a.string.isRequired,isDragging:a.a.bool.isRequired,isCheckbox:a.a.bool.isRequired,isRadio:a.a.bool.isRequired,moveItem:a.a.func.isRequired,onCheck:a.a.func.isRequired,onChange:a.a.func.isRequired,onAdd:a.a.func.isRequired,onSettings:a.a.func,onCopy:a.a.func.isRequired,onDelete:a.a.func.isRequired,connectDragSource:a.a.func.isRequired};var be=Object(se.DragSource)(pe,{beginDrag:function(e){return{id:e.id,index:e.index}}},function(e,t){return{connectDragSource:e.dragSource(),isDragging:t.isDragging()}}),ye=Object(se.DropTarget)(pe,me,function(e){return{connectDropTarget:e.dropTarget()}})(be(ve)),_e=n(1068),ke=n(411),we=n.n(ke)()({SORTABLE_LIST_LINK_SETTINGS_CLOSE:null,SORTABLE_LIST_LINK_SETTINGS_SAVE:null}),Ce=(n(1218),Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}),Se=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var Ee=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));Oe.call(n);var r=JSON.parse(n.props.value||"[]");if(0!==r.length||n.props.allowEmpty)B()(r,function(e){return e.dragID=n._nextDragID()});else{var o=C()(n.props,"module.props.module.props.attrs.field_type",!1),i=C()(n.props,"module.props.module.props.attrs.checkbox_checked","off"),a="";"checkbox"===o&&(a=C()(n.props,"module.props.module.props.attrs.field_title","")),r=[{value:a,checked:"on"===i?1:0,dragID:n._nextDragID()}],n.focusItemInput()}return n.state={items:JSON.stringify(r),editing_link:!1},n.emitChange(),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r["PureComponent"]),Se(t,[{key:"componentDidUpdate",value:function(e){var t=this.props.value;e.value===t||this.userUpdate||this.setState({items:t}),this.userUpdate=!1,re.a.rebuild()}},{key:"addItem",value:function(e,t,n){t&&t.preventDefault();var r=this.state.items||[],o=JSON.parse(r),i=o.length&&!1!==e&&!n?o[e]:{},a=this._nextDragID();!1!==e?o.splice(e+1,0,Ce({},i,{dragID:a})):o.push({value:"",checked:0,dragID:a}),this.userUpdate=!0,this.setState({items:JSON.stringify(o)}),this.emitChange(),G()(e)?(this.focusItemInput(e+1),this.props._onAddItem(e+1)):(this.focusItemInput(),this.props._onAddItem(o.length-1))}},{key:"editItem",value:function(e,t){t.preventDefault(),this.props._onAddItem(e)}},{key:"removeItem",value:function(e,t){t.preventDefault();var n=this.state.items||"[]",r=JSON.parse(n);r.splice(e,1),0!==r.length||this.props.allowEmpty||(r=[{value:"",checked:0,dragID:0}]),this.userUpdate=!0,this.setState({items:JSON.stringify(r)}),this.emitChange()}},{key:"showLinkSettings",value:function(e,t){if(t.target){t.preventDefault();var n=this.state.items||"[]",r=JSON.parse(n);this.link_settings_backup=te()(r[e]),Z()(this.link_settings_backup,{link_url:"",link_text:""})}else if(e=!1,we.SORTABLE_LIST_LINK_SETTINGS_CLOSE===t.props.buttonName){var o=this.state.items||"[]",i=JSON.parse(o);i[this.state.editing_link]=this.link_settings_backup,this.setState({items:JSON.stringify(i)}),this.emitChange()}(window.top?window.top.jQuery("body"):K()("body")).toggleClass("et-core-control-sortable-list-editing-link",!1!==e),this.setState({editing_link:e}),this.props.onEditingLink(!1!==e)}},{key:"updateItems",value:function(e,t,n,r){r.preventDefault();var o="click"===r.type,i=this.state.items||[],a=JSON.parse(i),s=o?t.value:r.target.value,l=!y()(this.props.checkbox)&&!0===this.props.checkbox;z()(a)&&a.push(t),o&&!l&&B()(a,function(e){return e.checked=0}),W()(a[e],{value:s,checked:n?1:0}),this.userUpdate=!0,this.setState({items:JSON.stringify(a)}),this.emitChange()}},{key:"_renderAddNewItemButton",value:function(){var e=this,t=this.addItem.bind(this,!1,!1),n={size:Object(A.spring)(1,{stiffness:300,damping:20}),opacity:Object(A.spring)(1,{stiffness:300,damping:20})};return o.a.createElement("span",{className:"et-fb-item-button-wrap--add"},o.a.createElement(A.Motion,{defaultStyle:{size:0,opacity:0},style:n},function(n){var r={opacity:n.opacity,transform:"scale( "+n.size+" )"};return o.a.createElement(m,{round:!0,style:r,tooltip:e.props.tooltip,_onClick:t},o.a.createElement(oe.a,{size:"14",icon:"add",color:"#FFFFFF"}))}),o.a.createElement("label",{className:"et-fb-form__label"},this.props.buttonLabel))}},{key:"_renderItems",value:function(){var e=this,t=this.state.items||"[]",n=JSON.parse(t),r=!y()(this.props.radio)&&!0===this.props.radio,i=!y()(this.props.checkbox)&&!0===this.props.checkbox,a=this.props.right_actions;return this.props.readonly&&J()(this,"props.right_actions_readonly")?a=this.props.right_actions_readonly:this.props.readonly&&!a?a="move":a||(a="move|copy|delete"),I()(n,function(t,n){var s=1===t.checked,u=l()({"et-core-control-sortable-list__row":!0,"et-core-control-sortable-list__row--radio":r,"et-core-control-sortable-list__row--checkbox":i}),c=l()({"et-core-control-sortable-list__check":!0,"et-core-control-sortable-list--checked":s}),d=e.updateItems.bind(e,n,t,!s),p=e.updateItems.bind(e,n,t,s),f=e.addItem.bind(e,n),h=e.addItem.bind(e,n,!1,!0),g=e.removeItem.bind(e,n),m=e.editItem.bind(e,n),v=e.showLinkSettings.bind(e,n),b=C()(t,"value",""),y=C()(t,"field_id",""),_=""===C()(t,"field_title","")?y:C()(t,"field_title",""),k=""===b?_:b;return o.a.createElement(ye,{classes:u,key:t.dragID,id:t.dragID,index:n,moveItem:e.moveItem,isCheckbox:i,isRadio:r,checkClasses:c,onCheck:d,onChange:p,onAdd:h,onCopy:f,onDelete:g,onSetting:m,onLink:v,value:k,useInput:e.props.useInput||!e.props.readonly,readonly:e.props.readonly,left_actions:e.props.left_actions,right_actions:a})})}},{key:"_renderLinkSettings",value:function(){var e=this,t=this.state.items||"[]",n=JSON.parse(t);if(!n[this.state.editing_link])return!1;var r=n[this.state.editing_link],i=this.showLinkSettings.bind(this,this.state.editing_link),a={size:this.props.animation?Object(A.spring)(1,{stiffness:300,damping:20}):1,opacity:this.props.animation?Object(A.spring)(1,{stiffness:300,damping:20}):1};return o.a.createElement(A.Motion,{defaultStyle:{size:.5,opacity:0},style:a},function(t){return o.a.createElement("div",{className:"et-core-control-sortable-list__link-settings",style:{opacity:t.opacity,transform:"scale( "+t.size+" )"}},o.a.createElement("h4",null,e.props.labels.link_settings),o.a.createElement("div",null,o.a.createElement("p",{className:"et-fb-form__label"},e.props.labels.link_url),o.a.createElement(L,{className:"et-fb-settings-option-input et-fb-settings-option-input--block",type:"text",name:e.state.editing_link+".link_url",value:r.link_url,_onChange:e.onChangeLinkSettings})),o.a.createElement("div",null,o.a.createElement("p",{className:"et-fb-form__label"},e.props.labels.link_text),o.a.createElement(L,{className:"et-fb-settings-option-input et-fb-settings-option-input--block",type:"text",name:e.state.editing_link+".link_text",value:r.link_text,_onChange:e.onChangeLinkSettings})),o.a.createElement(v.a,{block:!0},o.a.createElement(m,{block:!0,danger:!0,buttonName:we.SORTABLE_LIST_LINK_SETTINGS_CLOSE,tooltip:e.props.labels.link_cancel,_onClick:i},e.props.linkSettingsShowIcon?o.a.createElement(oe.a,{icon:"exit",color:"#FFFFFF"}):null,e.props.linkSettingsShowIcon?null:e.props.labels.link_cancel),o.a.createElement(m,{block:!0,success:!0,buttonName:we.SORTABLE_LIST_LINK_SETTINGS_SAVE,tooltip:e.props.labels.link_save,_onClick:i},e.props.linkSettingsShowIcon?o.a.createElement(oe.a,{icon:"check",color:"#FFFFFF"}):null,e.props.linkSettingsShowIcon?null:e.props.labels.link_save)))})}},{key:"render",value:function(){var e=this,t=this.props.additional_attrs?this.props.additional_attrs:{},n=this.props.id;n||(n="et-fb-"+this.props.name);var r=!1!==this.state.editing_link;return o.a.createElement(_e.a,null,o.a.createElement("div",{className:"et-core-control-sortable-list",ref:function(t){return e.itemsList=t}},this._renderItems(),r&&this._renderLinkSettings(),o.a.createElement("textarea",Ce({value:this.state.items,name:this.props.name,id:n,onChange:c.a},t)),this.props.useAddNewButton&&this._renderAddNewItemButton()))}}]),t}();Ee.defaultProps={onEditingLink:c.a,_onAddItem:c.a,animation:!0,linkSettingsShowIcon:!0};var Oe=function(){var e=this;this.nextDragID=-1,this._nextDragID=function(){return e.nextDragID++},this.emitChange=function(){return setTimeout(function(){return e.props._onChange(e.props.name,e.state.items)},0)},this.focusItemInput=function(t){setTimeout(function(){var n=e.itemsList.querySelectorAll(".et-core-control-sortable-list__row input");0!==n.length&&((!1===t||y()(t))&&(t=n.length-1),n[t].focus())})},this.moveItem=function(t,n){var r=JSON.parse(e.state.items),o=r[t];r[t]=r[n],r[n]=o,e.userUpdate=!0,e.setState({items:JSON.stringify(r)}),e.emitChange()},this.onChangeLinkSettings=function(t,n){var r=JSON.parse(e.state.items);X()(r,t,n),e.userUpdate=!0,e.setState({items:JSON.stringify(r)}),e.emitChange()}},Te=Ee,xe=n(1049),Me=n(44),De=n.n(Me),Pe=(n(1219),function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}());var Ne=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));Le.call(n);var r=C()(n,"props.range_settings",{min:0,max:100,step:1}),o=E()(n.props.value);return n.state={rangeMin:r.min,rangeMax:r.max,rangeStep:r.step,value:n.emptyIfDefault(o)},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r["PureComponent"]),Pe(t,[{key:"componentDidMount",value:function(){var e=this.props.value;this.deferredUpdate=De()(this.updateOptionAndState,700),parseFloat(this.state.rangeStep)>.1&&parseFloat(e)%1>0&&this.setState({rangeStep:"0.1"}),this.checkRangeBoundaries(this.state.value)}},{key:"componentDidUpdate",value:function(e){var t=this.emptyIfDefault(this.props.value);e.value===t||this.userUpdate||this.setState({value:t}),this.userUpdate=!1}},{key:"componentWillUnmount",value:function(){this.deferredUpdate.cancel()}},{key:"getDefaultValue",value:function(){return E()(this.props.default)}},{key:"emptyIfDefault",value:function(e){return e===this.getDefaultValue()?"":e}},{key:"checkRangeBoundaries",value:function(e){if(E()(e)){var t=parseFloat(e);t>this.state.rangeMax&&this.setState({rangeMax:t}),t<this.state.rangeMin&&this.setState({rangeMin:t}),parseFloat(this.state.rangeStep)>.1&&t%1>0&&this.setState({rangeStep:"0.1"})}}},{key:"_renderInput",value:function(){var e=this.props.id||"et-fb-"+this.props.name,t=this.props.name,n=this.emptyIfDefault(this.state.value),r=this.getDefaultValue(),i=""===n?r:n;return o.a.createElement("div",{className:"et-fb-settings-option-inputs-wrap"},o.a.createElement("input",{id:e,name:t,type:"range",min:this.state.rangeMin,max:this.state.rangeMax,step:this.state.rangeStep,className:"et-fb-range",value:parseFloat(i),"data-shortcuts-allowed":!0,onChange:this._updateFromRange}),o.a.createElement("div",{className:"et-fb-range-number et-fb-settings-option-input"},o.a.createElement("input",{type:"number",value:n,placeholder:r,onChange:this._onChange})))}},{key:"render",value:function(){var e=this.getDefaultValue(),t=this.props.value,n="";return t&&t!==e&&(n=o.a.createElement("button",{className:"et-fb-settings-option-button--reset",onClick:this.reset})),o.a.createElement("div",{className:l()({"et-fb-settings-option-inner":!0,"et-fb-settings-option-inner-range":!0})},this._renderInput(),n)}}]),t}();Ne.defaultProps={default_unit:""},Ne.propTypes={name:a.a.string.isRequired,default_unit:a.a.string,precision:a.a.number};var Le=function(){var e=this;this.isChangingRange=!1,this.updateOptionAndState=function(t){t=y()(t)?e.state.value:t,e.userUpdate=!0,e.setState({value:e.emptyIfDefault(t)}),e.props._onChange(e.props.name,t)},this._updateFromRange=function(t){e.isChangingRange=!0,e.updateOptionAndState(C()(t,"target.value")),e.isChangingRange=!1},this._onChange=function(t){var n=C()(t,"target.value");e.updateOptionAndState(n),e.checkRangeBoundaries(n)}},Fe=Ne;n.d(t,"a",function(){return m}),n.d(t,"b",function(){return v.a}),n.d(t,"c",function(){return L}),n.d(t,"d",function(){return Te});F.a,xe.a,xe.a},function(e,t,n){"use strict";var r=n(1),o=n.n(r),i=n(4),a=n.n(i),s=n(12),l=n.n(s),u=n(6),c=n.n(u),d=n(2),p=n.n(d),f=n(43),h=n.n(f),g=n(11),m=n.n(g),v=n(147),b=n.n(v),y=(n(1229),n(18)),_=n.n(y),k=n(9),w=n.n(k),C=n(36),S=n.n(C),E=n(39),O=n.n(E),T=n(30),x=n.n(T),M=n(31),D=n.n(M),P=n(68),N=n.n(P),L=n(3),F=n(0),A=n(15),j=n(690),I=n(691),R=n(696),B=n(32),H=n.n(B),W=(n(1097),n(33)),V=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var G=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={activeTab:e.activeTab},n.shouldComponentUpdate=H.a.shouldComponentUpdate.bind(n),n._onClickTab=n._onClickTab.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.a.Component),V(t,[{key:"componentWillReceiveProps",value:function(e){this.setState({activeTab:e.activeTab})}},{key:"_onClickTab",value:function(e,t){t.preventDefault(),this.setState({activeTab:e}),this.props._onTabChange&&this.props._onTabChange(e)}},{key:"_renderTitles",value:function(){var e=this;return o.a.createElement("ul",{className:"et-fb-settings-tab-titles"},S()(this.props.children,function(t,n){return o.a.createElement("li",{key:n},o.a.createElement("button",{className:_()({"et-fb-settings-tab-title":!0,"et-fb-settings-tab-title-active":e.state.activeTab===n,"et-fb-settings-tab-title-modified":t.props.isModified}),onClick:function(t){return e._onClickTab(n,t)}},t.props.label,o.a.createElement(W.a,{icon:t.props.icon,color:e.props["iconColor"+_()({Active:e.state.activeTab===n||t.props.isModified})]})))}))}},{key:"_renderContent",value:function(){return o.a.createElement("div",{className:"et-fb-settings-tab-content"},this.props.children[this.state.activeTab])}},{key:"render",value:function(){return o.a.createElement("div",null,this._renderTitles(),this._renderContent())}}]),t}();G.defaultProps={activeTab:0,iconColor:"#bec9d6",iconColorActive:"#2b87da",_onTabChange:!1},G.propTypes={activeTab:c.a.number,iconColor:c.a.string,iconColorActive:c.a.string,_onTabChange:c.a.oneOfType([c.a.bool,c.a.func]),children:c.a.oneOfType([c.a.array,c.a.element]).isRequired};var U=G,z=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var q=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.shouldComponentUpdate=H.a.shouldComponentUpdate.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.a.Component),z(t,[{key:"render",value:function(){return o.a.createElement("div",null,this.props.children)}}]),t}();q.defaultProps={icon:"",isModified:!1},q.propTypes={icon:c.a.string,isModified:c.a.bool};var K=q,$=n(1050),X=n(82),Y=n(1065),J=n(695),Q=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Z=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var ee=function(e){return N()(e.split("."))},te=function(e){return F.default.get(p()(e,"default_on_front"),F.default.get(p()(e,"defaultValue"),F.default.get(p()(e,"default"),"")))},ne=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.getTabs=function(){return p()(n,"props.composite_structure",{})},n.getTabSettings=function(e){return p()(n.getTabs(),e+".controls",{})},n.getSettings=function(){return x()(n.getTabs()).reduce(function(e,t){return Q({},e,n.getTabSettings(t))},{})},n.getSetting=function(e){return p()(n.getSettings(),e)},n.getValue=function(e){return A.a.getHoverOrNormalOnHover(e,n.getAttrs())},n.isTabModified=function(e){return x()(n.getTabSettings(e)).reduce(function(e,t){return e||n.isSettingModified(t)},!1)},n.isModified=function(){return x()(n.getTabs()).reduce(function(e,t){return e||n.isTabModified(t)},!1)},n.state={activeTabIndex:0},n._onChange=n._onChange.bind(n),n._onClickReset=n._onClickReset.bind(n),n._onTabChange=n._onTabChange.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.a.Component),Z(t,[{key:"getModule",value:function(){return p()(this,"props.module.props.module")}},{key:"getAttrs",value:function(){return p()(this.getModule(),"props.attrs")}},{key:"getFieldDefault",value:function(e){var t=A.a.getFieldBaseName(e),n=this.getSetting(t),r=D()(n,"default_from")?te(p()(this.getSettings(),ee(p()(n,"default_from")))):void 0;return F.default.get(r,te(n))}},{key:"getDefault",value:function(e){var t=A.a.getFieldBaseName(e),n=this.getSetting(t),r=this.getFieldDefault(t),o=D()(n,"default_from")?ee(p()(n,"default_from")):void 0,i=o?p()(this.getAttrs(),o):void 0,a=A.a.isHoverMode()&&A.a.isEnabled(t,this.getAttrs()),s=F.default.get(i,F.default.get(r,""));return a?p()(this.getAttrs(),t,s):s}},{key:"isSettingModified",value:function(e){return F.default.get(this.getValue(e),this.getDefault(e))!==this.getDefault(e)}},{key:"_onChange",value:function(e,t,n,r){var o=F.default.get(t,this.getDefault(e))===this.getDefault(e);this.props._onChange(e,t,n,r,o)}},{key:"_onClickReset",value:function(){var e=this;x()(this.getSettings()).map(function(t){e._onChange(A.a.getHoverFieldOnHover(t,e.getAttrs()),"")}),this.setState({activeTabIndex:0})}},{key:"_onTabChange",value:function(e){this.setState({activeTabIndex:e})}},{key:"_renderTabPreviewArea",value:function(e){return!1}},{key:"_renderOutsidePreviewArea",value:function(){return!1}},{key:"_renderTabs",value:function(){var e=this,t=p()(this.getModule(),"props.attrs",{}),n=this.props.module._getOptionsFields("advanced"),i=[],s=this.props,u=s.name,c=s.label;return o.a.createElement(U,{_onTabChange:this._onTabChange,activeTab:this.state.activeTabIndex},S()(this.props.composite_structure,function(s,d){return o.a.createElement(K,{icon:s.icon,key:d,isModified:e.isTabModified(d),label:s.label},e._renderTabPreviewArea(s),S()(s.controls,function(s,d){var f=A.a.getHoverFieldOnHover(d,t);s.name=f;var h={};if(a()(s.type)||!$.a.getControl(s.type))return!1;if("top_divider_style"===f&&(h.dividerFlip=t.top_divider_flip),"bottom_divider_style"===f&&(h.dividerFlip=t.bottom_divider_flip),!a()(s.depends_on)&&!e.props.module._isVisible(f,n))return i.push(f),!1;if(!(a()(s.show_if)&&a()(s.show_if_not)||Object(J.a)(s,e.props.setting_resolver)))return i.push(f),!1;if(!a()(s.depends_on)&&O()(s.depends_on,intersection(s.depends_on,i)))return!1;if(!e.props.module._isOptionMatchesFilter(s.label,s.description,e.props.label))return!1;var g=e.props.isResponsiveEnabled(A.a.getFieldBaseName(d),t),m=!a()(s.description)&&""!==s.description,v=a()(s.label)||""===s.label?"":o.a.createElement(j.a,{name:f,key:"general-form-label-"+e.props.uniqueKey+"-"+A.a.getFieldBaseName(f),onClickHelp:!!m&&e.props.onClickHelp,activeHelp:e.props.isDescriptionVisible(f),hoveredGroup:e.props.isHoveredGroup(f),hasHoverOptions:A.a.doesSupport(s),onClickResponsive:e.props.onClickResponsive,hasResponsiveOptions:s.mobile_options,activeHover:A.a.isEnabled(f,t),onClickHover:!!A.a.hasTabs(s)&&e.props.onClickHover,onClickReset:e.props.onClickReset,isResetActive:e.props.isResetActive(s),isResponsiveEnabled:g},s.label),b=A.a.hasTabs(s)&&A.a.isEnabled(f,t)?o.a.createElement(X.a,null,o.a.createElement(Y.a,{module:e.getModule(),isHover:L.a.getHoverMode(),isResponsiveEnabled:g,fieldName:s.name})):"",y=m?o.a.createElement(I.a,{active:e.props.isDescriptionVisible(f),key:"general-form-description-"+e.props.uniqueKey+"-"+f},s.description):"",k=_()("et-fb-settings-options","et-fb-option--"+s.type.replace("_","-")),C="",S=void 0;if(s.mobile_options&&w()(["range","custom_margin","custom_padding","text","number"],s.type)){var E=p()(t,f+"_last_edited",""),T=a()(E)?["off","desktop"]:E.split("|");S={desktop:F.default.hasValue(t[f])?t[f]:"",tablet:p()(t,f+"_tablet",""),phone:p()(t,f+"_phone",""),isResponsive:g,activeTab:T[1]},C=L.a.getPreviewMode()}else S=p()(t,f,e.getDefault(d));return o.a.createElement(R.a,{name:f,key:"advanced-form-group-"+e.props.uniqueKey+"-"+A.a.getFieldBaseName(f),onMouseEnterGroup:function(){e.props.onMouseEnterGroup(f,s.label,s.type,e.props.toggle_slug,e.props.tab_slug)},onMouseLeaveGroup:function(){e.props.onMouseLeaveGroup(f,s.label),e.props.onMouseEnterGroup(u,c,s.type,e.props.toggle_slug,e.props.tab_slug)},isSelectiveSyncAvailable:e.props.isSelectiveSyncAvailable(),isGlobalOptionSynced:e.props.isGlobalOptionSynced(f),_unsyncGlobalSetting:e.props._unsyncGlobalSetting,className:e.props.productTourClass},v,b,y,o.a.createElement("div",{className:k,key:"et-fb-option-advanced_"+e.props.uniqueKey+"-"+f},o.a.createElement("div",{className:"et-fb-option-container",key:"et-fb-option-container-"+e.props.uniqueKey+"-"+f},Object(r.createElement)($.a.getControl(s.type),l()({key:e.props.uniqueKey+"-"+f,value:S,module:e.props.module,name:f,resetValue:!1,_onChange:e._onChange,visible:!0,previewMode:C,animate:e.props.animate,additionalProps:h},s,{default:e.getDefault(d)})))))}))}))}},{key:"render",value:function(){var e=this,t=this.props,n=t.name,r=t.label,i=!1;if(m()(this.props.composite_structure,function(t){m()(t.controls,function(t){if(!a()(t.type)&&$.a.getControl(t.type))return e.props.module._isOptionMatchesFilter(t.label,t.description,e.props.label)?(i=!0,!1):void 0})}),!i)return!1;var s=A.a.getFieldBaseName(n),l=this.props.isHoveredGroup(s),u=a()(r)||""===r?"":o.a.createElement(j.a,{name:n,key:"advanced-form-label-"+this.props.uniqueKey,onClickHelp:!1,isResetActive:this.isModified(),onClickReset:this._onClickReset,onClickHover:this.props.onClickHover,activeHover:this.props.activeHover,hoveredGroup:l},r),c=!1===this.props.activeHover?"":o.a.createElement(X.a,null,o.a.createElement(Y.a,{fieldName:this.props.name,module:p()("module.props.module",this.props)})),d=this.props.name;return o.a.createElement(R.a,{name:d,key:"advanced-form-group-"+this.props.uniqueKey+"-"+d,onMouseEnterGroup:function(){return e.props.onMouseEnterGroup(s,r)},onMouseLeaveGroup:function(){return e.props.onMouseLeaveGroup(s,r)}},u,c,this._renderOutsidePreviewArea(),this._renderTabs())}}]),t}(),re=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var oe={attr_suffix:c.a.string},ie=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.suffix=p()(e,"attr_suffix",""),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,ne),re(t,[{key:"_processProperty",value:function(e,t){return"width"===e?this._processWidth(t):t}},{key:"_processWidth",value:function(e){var t=parseInt(e);return t>50&&(t=50),F.default.processRangeValue(t)}},{key:"_renderTabPreviewArea",value:function(e){var t=this,n=["width","style","color"],r={};return m()(["top","right","bottom","left"],function(e){var o="";m()(n,function(n){var r="border_"+n+"_"+e+t.suffix,i="border_"+n+"_all"+t.suffix,a=t.getDefault(i),s=F.default.get(t.getDefault(r),a),l=t._processProperty(n,t.getValue(i)),u=t._processProperty(n,F.default.get(t.getValue(r),F.default.get(l,s)));o+=u+" "}),h()(r,"border"+b()(e),o)}),o.a.createElement("div",{className:"et-fb-settings-border-styles-wrap"},o.a.createElement("div",{className:"et-fb-settings-border-styles-wrap-column"},o.a.createElement("div",{className:"et-fb-settings-border-styles-preview",style:r})))}}]),t}();ie.propTypes=oe;var ae=ie,se=n(78),le=n.n(se),ue=(n(1098),n(1099)),ce=n(133),de=n(10),pe=n(54),fe=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var he=function(){if(L.a.getHoverMode())return"hover";var e=L.a.getPreviewMode();if("zoom"===e)return"desktop";var t=ce.a.instance();return"wireframe"===e?F.default.hasValue(t.previous_mode)&&"wireframe"!==t.previous_mode?t.previous_mode:"desktop":t.getViewModeByWidth(F.default.$appWindow().width())},ge=function(e){var t="";switch(e){case"hover":t="__"+e;break;case"phone":case"tablet":t="_"+e}return t},me=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={viewTab:he(),transformTab:"scale",scaleLinked:n.getLinked("scale"),translateLinked:n.getLinked("translate"),skewLinked:n.getLinked("skew")},n.isResetActive=n.isResetActive.bind(n),n.onClickReset=n.onClickReset.bind(n),n.isResponsiveEnabled=n.isResponsiveEnabled.bind(n),n.onClickResponsive=n.onClickResponsive.bind(n),n.onClickHover=n.onClickHover.bind(n),n.onClickTransformTab=n.onClickTransformTab.bind(n),n.onClickResponsiveTab=n.onClickResponsiveTab.bind(n),n.setLinked=n.setLinked.bind(n),n.onEnterGroup=n.onEnterGroup.bind(n),n.onLeaveGroup=n.onLeaveGroup.bind(n),n.onMouseOverTransformTab=n.onMouseOverTransformTab.bind(n),n.onMouseLeaveTransformTab=n.onMouseLeaveTransformTab.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,ne),fe(t,[{key:"shouldComponentUpdate",value:function(e,t){return F.default.shouldComponentUpdate(this,e,t)}},{key:"setLinked",value:function(e,t){if(w()(["scale","translate","skew"],e)){var n={},r=a()(t)?!p()(this.state,e+"Linked"):F.default.isOn(t),o=r?"on":"off",i=this.getSettingDefault("transform_"+e+"_linked")===o;n[e+"Linked"]=r,this.setState(n),this.props._onChange("transform_"+e+"_linked"+this.getViewTabSuffix(),o,"skip",null,i)}}},{key:"getLinked",value:function(e){var t=p()(this.getAttrs(),"transform_"+e+"_linked"+this.getViewTabSuffix(),"");return F.default.hasValue(t)||(t=this.getSettingDefault("transform_"+e+"_linked")),F.default.isOn(t)}},{key:"getSettingDefault",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.state.viewTab,n=this.getSetting(e),r=p()(n,"default"),o=r,i=!1,a=t;return this.state.viewTab===t?(i=this.props.activeHover&&Object(A.c)(),w()(["tablet","phone"],t)&&!this.isResponsiveEnabled()&&(a="desktop")):"hover"===t&&(i=!0),i?o=p()(this.getAttrs(),e,o):"tablet"===a?o=p()(this.getAttrs(),e,o):"phone"===a&&!1===(o=p()(this.getAttrs(),e+"_tablet",!1))&&(o=p()(this.getAttrs(),e,o)),F.default.hasValue(o)||(o=r),o}},{key:"getViewTabSuffix",value:function(){var e="";return this.props.activeHover&&Object(A.c)()?e="__hover":"hover"!==this.state.viewTab&&this.isResponsiveEnabled()&&(e=ge(this.state.viewTab)),e}},{key:"isActiveViewTab",value:function(e){return this.state.viewTab===e?"desktop"===e&&Object(A.c)()?"":"active":this.isResponsiveTabModified(e)?"modified":""}},{key:"isResponsiveTabModified",value:function(e){var t=ge(e),n=p()(this.getAttrs(),"transform_"+this.state.transformTab+t,"");return!!F.default.hasValue(n)&&this.getSettingDefault("transform_"+this.state.transformTab,e)!==n}},{key:"responsiveTabs",value:function(){var e=ETBuilderBackend.i18n.controls,t=["et-fb-settings-option-responsive-tab-nav","et-fb-settings-transform-responsive-tab-nav"];return this.props.activeHover&&t.push("et-fb-settings-option-responsive-tab-nav-hover-active"),o.a.createElement(X.a,null,o.a.createElement("ul",{className:t.join(" ")},o.a.createElement("li",{className:this.isActiveViewTab("desktop"),"data-tab":"desktop",onClick:this.onClickResponsiveTab},e.responsiveTabs.desktop),this.props.activeHover?o.a.createElement("li",{"data-tab":"hover",className:this.isActiveViewTab("hover"),onClick:this.onClickResponsiveTab},e.tabs.hover):null,o.a.createElement("li",{"data-tab":"tablet",className:this.isActiveViewTab("tablet"),onClick:this.onClickResponsiveTab},e.responsiveTabs.tablet),o.a.createElement("li",{"data-tab":"phone",className:this.isActiveViewTab("phone"),onClick:this.onClickResponsiveTab},e.responsiveTabs.phone)))}},{key:"onMouseOverTransformTab",value:function(e){var t=e.target.dataset,n=t.tab,r=t.transform_type,o=t.tip;n!==this.state.transformTab&&this.props.onMouseEnterGroup("transform_"+n,o,r,this.props.toggle_slug,this.props.tab_slug)}},{key:"onMouseLeaveTransformTab",value:function(e){var t=this.getSetting("transform_"+this.state.transformTab);e.target.dataset.tab!==this.state.transformTab&&this.props.onMouseEnterGroup("transform_"+this.state.transformTab,p()(t,"label"),p()(t,"type"),this.props.toggle_slug,this.props.tab_slug)}},{key:"transformTabs",value:function(){var e=this;return o.a.createElement("ul",{className:"et-fb-settings-tab-titles"},S()(this.getTabs(),function(t,n){var r=p()(t.controls,"transform_"+n);return o.a.createElement("li",{key:n+"-tab"},o.a.createElement("button",{className:_()({"et-fb-settings-tab-title":!0,"et-fb-settings-tab-title-active":e.state.transformTab===n,"et-fb-settings-tab-title-modified":e.isResetActive(n)}),"data-tab":n,"data-transform_type":p()(r,"type"),onClick:e.onClickTransformTab,onMouseOver:e.onMouseOverTransformTab,onMouseLeave:e.onMouseLeaveTransformTab,"data-tip":p()(r,"label"),"data-index":t,"data-for":"transform-tab-tooltip-"+t},o.a.createElement(W.a,{icon:t.icon,color:e.state.transformTab===n||e.isResetActive(n)?pe.a.info:pe.a.inactiveGrey}),o.a.createElement(le.a,{id:"transform-tab-tooltip-"+t})))}))}},{key:"renderTransformField",value:function(){var e="transform_"+this.state.transformTab,t=this.getSettingDefault(e),n=""+e+this.getViewTabSuffix(),r=p()(this.getAttrs(),n,t),i=this.getSetting(e);return o.a.createElement(ue.a,{key:this.props.uniqueKey+"-"+n,name:n,transform_type:this.state.transformTab,default:t,default_unit:p()(i,"default_unit"),range_settings:p()(i,"range_settings"),value:r,uniqueKey:this.props.uniqueKey,_onChange:this.props._onChange,onClickLink:this.setLinked,scaleLinked:this.getLinked("scale"),skewLinked:this.getLinked("skew"),translateLinked:this.getLinked("translate"),readonly:F.default.hasValue(this.props.readonly)})}},{key:"onClickTransformTab",value:function(e){e.preventDefault();var t=e.target.dataset.tab;this.setState({transformTab:t})}},{key:"onClickResponsiveTab",value:function(e){var t=e.target.dataset.tab,n=L.a.getActiveModule(),r="hover"===t,o=r?"desktop":t,i=function(e){return(e?"on":"off")+"|"+(e?t:"desktop")};de.b.toggleModuleHover(r),de.b.moduleSettingsChange(n,"hover_enabled",r?1:0),this.setState({viewTab:t}),"wireframe"!==L.a.getPreviewMode()&&de.b.switchResponsiveMode(o),r||(this.props._onChange(this.props.name+"_last_edited",i(this.isResponsiveEnabled())),this.props._onChange("transform_"+this.state.transformTab+"_last_edited",i(this.isResponsiveEnabled())))}},{key:"isResponsiveEnabled",value:function(){return this.props.isResponsiveEnabled(this.props.name,this.getAttrs())}},{key:"onClickResponsive",value:function(){var e=this;this.props.onClickResponsive(this.props.name),x()(this.getTabs()).forEach(function(t){return e.props.onClickResponsive("transform_"+t)}),Object(A.c)()&&this.setState({viewTab:"hover"})}},{key:"isResetActive",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state.transformTab,t="transform_"+e,n=""+t+this.getViewTabSuffix(),r=this.getSettingDefault(t),o=p()(this.getAttrs(),n,r),i="",a="";return w()(["scale","translate","skew"],e)&&(i=this.getSettingDefault(t+"_linked"),a=p()(this.getAttrs(),t+"_linked"+this.getViewTabSuffix(),i)),F.default.hasValue(a)&&a!==i||o!==r&&F.default.hasValue(o)}},{key:"onClickReset",value:function(){var e="transform_"+this.state.transformTab;this.props._onChange(""+e+this.getViewTabSuffix(),"","range",null,!0),w()(["scale","translate","skew"],this.state.transformTab)&&this.setLinked(this.state.transformTab,this.getSettingDefault(e+"_linked"))}},{key:"onClickHover",value:function(){var e=this;this.props.onClickHover(this.props.name),x()(this.getTabs()).forEach(function(t){return e.props.onClickHover("transform_"+t)}),Object(A.c)()||"hover"===this.state.viewTab&&this.setState({viewTab:"desktop"})}},{key:"buttonsVisible",value:function(){var e=this,t=!1;return x()(this.getTabs()).forEach(function(n){t||(t=e.props.isHoveredGroup("transform_"+n))}),t}},{key:"onEnterGroup",value:function(e){var t=this.getSetting(e);this.props.onMouseEnterGroup(e,p()(t,"label"),p()(t,"type"),this.props.toggle_slug,this.props.tab_slug)}},{key:"onLeaveGroup",value:function(){this.props.onMouseEnterGroup(this.props.name,this.props.label,this.props.type,this.props.toggle_slug,this.props.tab_slug)}},{key:"render",value:function(){if(!this.props._isOptionMatchesFilter(this.props.label,this.props.description+" scale rotate translate skew origin",this.props.label))return!1;var e=this.props,t=e.name,n=e.label,r=e.description,i=e.hasHoverOptions,s=e.mobile_options,l=!a()(r)&&""!==r,u=o.a.createElement(j.a,{name:t,key:"general-form-label-"+this.props.uniqueKey,onClickHelp:this.props.onClickHelp,activeHelp:this.props.isDescriptionVisible(t),hasHoverOptions:F.default.hasValue(i),activeHover:this.props.activeHover,onClickHover:this.onClickHover,hasResponsiveOptions:F.default.hasValue(s),isResponsiveEnabled:this.isResponsiveEnabled(),onClickResponsive:this.onClickResponsive,onClickReset:this.onClickReset,isResetActive:this.isResetActive(),hoveredGroup:this.buttonsVisible()},n),c=this.props.activeHover?o.a.createElement(X.a,null,o.a.createElement(Y.a,{module:this.getModule(),isHover:L.a.getHoverMode(),isResponsiveEnabled:this.isResponsiveEnabled(),fieldName:t})):"",d=this.isResponsiveEnabled()?this.responsiveTabs():"",p=l?o.a.createElement(I.a,{active:this.props.isDescriptionVisible(t),key:"general-form-description-"+this.props.uniqueKey},r):"",f="transform_"+this.state.transformTab;return o.a.createElement(R.a,{name:f,key:"advanced-form-group-"+this.props.uniqueKey,onMouseEnterGroup:this.onEnterGroup,onMouseLeaveGroup:this.onLeaveGroup,className:this.props.productTourClass},u,p,c,d,this.transformTabs(),this.renderTransformField())}}]),t}(),ve=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},be=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var ye=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return be(e,null,[{key:"createControl",value:function(t,n){return!a()(t.composite_type)&&Object(r.createElement)(e._controlTypesMap[t.composite_type],l()(ve({label:t.label,key:n.uniqueKey},n),t))}}]),e}();ye._controlTypesMap={default:ne,tabbed:ae,transforms:me};t.a=ye},function(e,t,n){"use strict";var r=n(1),o=n.n(r),i=n(6),a=n.n(i),s=(n(1160),n(1161),n(48)),l=n.n(s),u=function(e,t){var n=setTimeout(function r(o){e(),n=setTimeout(r,t())},t());return{clear:function(e){return clearTimeout(n)}}},c=function(){var e=500;return{next:function(){return e<=50?e:e-=50}}},d=n(0),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var f=function(e,t){return function(){return t.apply(void 0,arguments)?e.apply(void 0,arguments):l()()}},h=function(e){return 0===e.button},g=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r["PureComponent"]),p(t,[{key:"componentWillMount",value:function(){this.startIncrementor=this.startIncrementor.bind(this),this.startDecrementor=this.startDecrementor.bind(this),this.onIncreaseDown=f(this.startIncrementor,h),this.stopIncrementor=this.stopIncrementor.bind(this),this.onDecreaseDown=f(this.startDecrementor,h),this.stopDecrementor=this.stopDecrementor.bind(this)}},{key:"componentWillUnmount",value:function(){this.stopIncrementor(),this.stopDecrementor()}},{key:"startIncrementor",value:function(){this.props.onIncrease(),this.incrementorInterval=u(this.props.onIncrease,c().next),d.default.$appDocument().on("mouseup",this.stopIncrementor),d.default.$topWindow().on("mouseup",this.stopIncrementor)}},{key:"stopIncrementor",value:function(){this.incrementorInterval&&this.incrementorInterval.clear()}},{key:"startDecrementor",value:function(){this.props.onDecrease(),this.decrementorInterval=u(this.props.onDecrease,c().next),d.default.$appDocument().on("mouseup",this.stopDecrementor),d.default.$topWindow().on("mouseup",this.stopDecrementor)}},{key:"stopDecrementor",value:function(){this.decrementorInterval&&this.decrementorInterval.clear()}},{key:"render",value:function(){return o.a.createElement("div",{className:"et-fb-incrementor"},o.a.createElement("div",{onMouseDown:this.onIncreaseDown,className:"increase"}),o.a.createElement("div",{onMouseDown:this.onDecreaseDown,className:"decrease"}))}}]),t}();g.propTypes={onIncrease:a.a.func,onDecrease:a.a.func},g.defaultProps={onIncrease:l.a,onDecrease:l.a};var m=g,v=n(44),b=n.n(v),y=n(175),_=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},k=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var w=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r["PureComponent"]),k(t,[{key:"componentWillMount",value:function(){this.onChange=b()(this.onChange.bind(this),700),this.reUpdateInput=this.reUpdateInput.bind(this),this.getValue=this.getValue.bind(this),this.onBlur=this.onBlur.bind(this),this.onKeyPress=this.onKeyPress.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.onKeyUp=this.onKeyUp.bind(this)}},{key:"componentWillUpdate",value:function(e){e.value!==this.props.value&&(this.textInput.value=e.value)}},{key:"componentDidMount",value:function(){this.textInput.value=this.props.value}},{key:"componentWillUnmount",value:function(){this.onChange.cancel()}},{key:"onBlur",value:function(e){var t=e.target.value;t!==this.props.value&&this.props.onChange(t),this.props.onBlur(e),setTimeout(this.reUpdateInput,0)}},{key:"onChange",value:function(e){var t=this.textInput.value;t!==this.props.value&&this.props.onChange(t)}},{key:"onKeyPress",value:function(e){var t=e.target.value;13===e.charCode&&t!==this.props.value&&this.props.onChange(t),this.props.onBlur(e)}},{key:"onKeyDown",value:function(e){switch(e.keyCode){case 38:e.preventDefault(),this.stopDecrementor(),this.startIncrementor();break;case 40:e.preventDefault(),this.stopIncrementor(),this.startDecrementor()}}},{key:"onKeyUp",value:function(e){switch(e.keyCode){case 38:case 40:e.preventDefault(),this.stopIncrementor(),this.stopDecrementor()}}},{key:"getValue",value:function(){return Object(y.d)(this.props.value||this.props.placeholder,0)}},{key:"reUpdateInput",value:function(){this.props.value!==this.textInput.value&&(this.textInput.value=this.props.value)}},{key:"startIncrementor",value:function(){this.incrementorInterval||(this.props.onIncrease(),this.incrementorInterval=u(this.props.onIncrease,c().next))}},{key:"stopIncrementor",value:function(){this.incrementorInterval&&(this.incrementorInterval.clear(),this.incrementorInterval=void 0)}},{key:"startDecrementor",value:function(){this.decrementorInterval||(this.props.onDecrease(),this.decrementorInterval=u(this.props.onDecrease,c().next))}},{key:"stopDecrementor",value:function(){this.decrementorInterval&&(this.decrementorInterval.clear(),this.decrementorInterval=void 0)}},{key:"render",value:function(){var e=this,t=this.props,n=(t.value,t.onChange,t.onBlur,t.onIncrease,t.onDecrease,t.readonly),r=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(t,["value","onChange","onBlur","onIncrease","onDecrease","readonly"]);return o.a.createElement("div",{className:"et-fb-settings-option--numeric-control"},o.a.createElement("input",_({},r,{readOnly:n||!1,className:"et-fb-settings-option-input",type:"text",ref:function(t){e.textInput=t},onBlur:this.onBlur,onKeyPress:this.onKeyPress,onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp,onChange:this.onChange})),o.a.createElement(m,{onIncrease:this.props.onIncrease,onDecrease:this.props.onDecrease}))}}]),t}();w.propTypes={onChange:a.a.func.isRequired,onIncrease:a.a.func.isRequired,onDecrease:a.a.func.isRequired,onKeyPress:a.a.func,onBlur:a.a.func,step:a.a.number,value:a.a.string},w.defaultProps={onKeyPress:l.a,onBlur:l.a,step:1};t.a=w},function(e,t,n){"use strict";var r=n(1),o=n.n(r),i=n(12),a=n.n(i),s=n(2),l=n.n(s),u=n(39),c=n.n(u),d=n(96),p=n.n(d),f=n(41),h=n.n(f),g=n(10),m=n(3),v=n(0),b=n(1101),y=(n(1249),Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}),_=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function k(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var w=ETBuilderBackend.i18n.tooltips;var C=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"upload";return n=t=function(t){function n(){var e,t,i;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);for(var a=arguments.length,s=Array(a),u=0;u<a;u++)s[u]=arguments[u];return t=i=k(this,(e=n.__proto__||Object.getPrototypeOf(n)).call.apply(e,[this].concat(s))),i.state={exportFileName:"Divi Builder Layout",importOptions:{replaceLayout:"on",importBackUp:"off",addToLibrary:"off"},importFile:"",importLayoutName:"",importError:"",importProgress:0,importEstimation:1,importCategories:"",importNewCategory:""},i._onChange=function(e,t){var n=Object(v.intentionallyCloneDeep)(i.state);h()(e)?n=p()(n,e):n[e]=t,i.setState(n)},i.exportLayout=function(){i._onChange("exportError",""),g.b.exportLayout(i.state.exportFileName)},i.importFileName=function(){return l()(i.state,"importFile.name",w.noFile)},i.importLayout=function(){i._onChange("importError",""),g.b.importLayout(i.state)},i.onExportError=function(e){return i._onChange({exportError:e})},i.onImportError=function(e){return i._onChange({importError:e})},i.onImportProgress=function(e,t){"download"===r&&(e=e/2+50),i._onChange({importProgress:e,importEstimation:t})},i._renderProgressBar=function(){return o.a.createElement(b.a,{progress:i.state.importProgress,time_remaining:i.state.importEstimation})},k(i,t)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,o.a.Component),_(n,[{key:"componentDidMount",value:function(){m.a.addImportProgressListener(this.onImportProgress),m.a.addImportErrorListener(this.onImportError),m.a.addExportErrorListener(this.onExportError);var e=m.a.getDroploaderPayloadPortability();e&&this.setState({active_tab:"modules_library",importOptions:a()(this.state.importOptions,e.details.importOptions),importFile:e.details.importFile})}},{key:"componentWillUnmount",value:function(){m.a.removeImportProgressListener(this.onImportProgress),m.a.removeImportErrorListener(this.onImportError),m.a.removeExportErrorListener(this.onExportError)}},{key:"shouldComponentUpdate",value:function(e,t){return!c()(this.props,e)||!c()(this.state,t)}},{key:"render",value:function(){var t=this.state.importProgress>0;return o.a.createElement("div",{className:"et-fb-with-portability"},o.a.createElement(e,y({isLoadingLayout:t,_renderProgressBar:this._renderProgressBar,_onChange:this._onChange,exportLayout:this.exportLayout,importFileName:this.importFileName,importLayout:this.importLayout},this.state,this.props)))}}]),n}(),t.displayName="withPortability("+e.displayName+")",n},S=n(53),E=n.n(S),O=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},T=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var x=function(e){var t,n,r=E()(e)?e:e.displayName;return n=t=function(t){function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,o.a.Component),T(n,[{key:"shouldComponentUpdate",value:function(){return!1}},{key:"render",value:function(){var t=this.props,n=t._ref,r=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(t,["_ref"]);return o.a.createElement(e,O({ref:n},r))}}]),n}(),t.displayName="withOneRender("+r+")",n};n.d(t,"a",function(){return x}),n.d(t,"b",function(){return C})},function(e,t,n){"use strict";var r=n(1),o=n.n(r),i=n(6),a=n.n(i),s=n(27),l=n.n(s),u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};var c=function(e){var t=e.pos,n=e.style,r=e.className,i=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["pos","style","className"]);return o.a.createElement("div",u({},i,{style:n,className:"et-fb-spinner-control__spinner "+l()(r)}),o.a.createElement("div",{className:"et-fb-spinner-control__spinner-item",style:{transform:"translateX("+t+"px)"}}))},d=n(780),p=(n(1157),n(48)),f=n.n(p),h=n(131),g=n.n(h),m=n(175),v=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var b=-5e3,y=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.state={spinner:b,isDragging:!1},e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r["Component"]),v(t,[{key:"componentWillMount",value:function(){this.handleDrag=g()(parseInt,this.handleDrag.bind(this)),this.handleDragStart=this.handleDragStart.bind(this),this.handleDragEnd=this.handleDragEnd.bind(this),this.normalize=(new m.a)(1.8)}},{key:"handleDrag",value:function(e,t){this.props.onChange(e,t),this.setState({spinner:this.normalize(e)+this.state.spinner})}},{key:"handleDragStart",value:function(){this.setState({isDragging:!0})}},{key:"handleDragEnd",value:function(){this.setState({isDragging:!1,spinner:b})}},{key:"render",value:function(){var e=this.state.isDragging?"dragging":"";return o.a.createElement(d.a,{className:"et-fb-settings-option--spinner-control "+e,onDragX:this.handleDrag,onDragStart:this.handleDragStart,onDragEnd:this.handleDragEnd},o.a.createElement(c,{pos:this.state.spinner}))}}]),t}();y.propTypes={onChange:a.a.func.isRequired},y.defaultProps={onChange:f.a};var _=y,k=(n(1158),n(1058)),w=n.n(k),C=n(689),S=n.n(C),E=n(1059),O=n.n(E),T=n(1159),x=n.n(T),M=n(2),D=n.n(M),P=n(112),N=n(58),L=n(1104),F=n(1085),A=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var j=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.state={active:!1},e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r["Component"]),A(t,[{key:"componentWillMount",value:function(){var e=this;this.sanitize=this.sanitize.bind(this),this.onChange=this.onChange.bind(this),this.onIncrease=this.onIncrease.bind(this),this.onDecrease=this.onDecrease.bind(this),this.handleSpinnerChange=this.handleSpinnerChange.bind(this),this.makeActive=this.makeActive.bind(this),this.makeInactive=this.makeInactive.bind(this),this.sanitizeIncrease=g()(this.sanitize,function(t){return t+e.getStep()*(Object(P.e)()?10:1)}),this.sanitizeDecrease=g()(this.sanitize,function(t){return t-e.getStep()*(Object(P.e)()?10:1)}),this.getNumericValue=g()(parseFloat,this.sanitize,this.getValue)}},{key:"normalize",value:function(e){return(this.normalizer||(this.normalizer=(new m.a)(this.getSpeed())))(e)*(this.getStep()>1?1:this.getStep())}},{key:"onChange",value:function(e){this.props.readonly||(this.setUpdateSource(1),this.props.onChange(Object(F.a)(this.getDefaultUnit(),e,this.sanitize)))}},{key:"onIncrease",value:function(){this.props.readonly||(this.setUpdateSource(2),this.props.onChange(Object(F.a)(this.getDefaultUnit(),this.getValue(),this.sanitizeIncrease)))}},{key:"onDecrease",value:function(){this.props.readonly||(this.setUpdateSource(2),this.props.onChange(Object(F.a)(this.getDefaultUnit(),this.getValue(),this.sanitizeDecrease)))}},{key:"handleSpinnerChange",value:function(e,t){var n=t.shiftKey;this.setUpdateSource(3);var r=this.normalize(Object(m.e)(e,0))*(n?10:1);0!==r&&this.props.onChange(Object(F.a)(this.getDefaultUnit(),this.getValue(),g()(this.sanitize,x()(r))))}},{key:"renderLabel",value:function(){return!w()(this.props.label)&&o.a.createElement("span",{className:"et-fb-settings-option-input-label"},this.props.label)}},{key:"getValue",value:function(){return this.props.value||this.props.defaultValue||0}},{key:"getSpeed",value:function(){return Math.abs(this.props.speed)*(this.getStep()>=1?1:.1)}},{key:"getStep",value:function(){return this._step||this.props.step}},{key:"getDefaultUnit",value:function(){return Object(N.c)(this.props.defaultValue,this.props.defaultUnit)}},{key:"makeActive",value:function(){this.setState({active:!0})}},{key:"makeInactive",value:function(){this.setState({active:!1})}},{key:"sanitize",value:function(e){return Object(m.f)(this.props.min,this.props.max,Object(m.g)(Object(m.b)(this.props.precision),e))}},{key:"setUpdateSource",value:function(e){this._updateSource=[e,S()(this._updateSource||[void 0])];var t=this.getStep(),n=this.props.step,r=Object(m.b)(this.getNumericValue()),o=r>Object(m.b)(n)?Object(m.h)(r,n):this.isSameSource()?t:n;this._step=o}},{key:"isSameSource",value:function(){var e=this._updateSource||[void 0,void 0];return S()(e)===O()(e)}},{key:"render",value:function(){var e=this.state.active?"active":"";return o.a.createElement("div",{className:"et-fb-settings-option--numeric-spinner-control "+e},o.a.createElement(L.a,{id:this.props.id,onChange:this.onChange,onIncrease:this.onIncrease,onDecrease:this.onDecrease,value:this.props.value,step:this.getStep(),onFocus:this.makeActive,onBlur:this.makeInactive,placeholder:this.props.defaultValue,readonly:D()(this.props,"readonly",!1)}),o.a.createElement("div",{className:"numeric-spinner-control-label-wrapper"},!this.props.readonly&&o.a.createElement(_,{onChange:this.handleSpinnerChange}),this.renderLabel()))}}]),t}();j.propTypes={onChange:a.a.func.isRequired,step:a.a.number,precision:a.a.number,min:a.a.number,max:a.a.number,value:a.a.string,placeholder:a.a.string,defaultValue:a.a.string,defaultUnit:a.a.string,speed:a.a.number},j.defaultProps={step:1,min:-9999999999,max:9999999999,defaultValue:"",speed:.5,precision:.01};t.a=j},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";(function(e){var r=n(1),o=n.n(r),i=n(6),a=n.n(i),s=n(18),l=n.n(s),u=n(2),c=n.n(u),d=n(35),p=n(218),f=n(0),h=(n(1111),function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}());var g=function(t){function n(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this));return e.state={loading:!1},e._onClickChangeApiKey=e._onClickChangeApiKey.bind(e),e._onClickGenerateImageUrlFromVideo=e._onClickGenerateImageUrlFromVideo.bind(e),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,r["Component"]),h(n,[{key:"_onClickChangeApiKey",value:function(){f.default.topWindow().open(ETBuilderBackend.urls.themeOptionsUrl,"_blank").focus()}},{key:"_onClickGenerateImageUrlFromVideo",value:function(){var t=this,n=t.props.module,r=c()(t,"props.module.props.attrs.__oembed_thumbnail");f.default.hasValue(r)?t.props._onChange(t.props.name,r):(this.setState({loading:!0}),e.ajax({type:"POST",url:ETBuilderBackend.ajaxUrl,data:{action:"et_pb_video_get_oembed_thumbnail",et_admin_load_nonce:ETBuilderBackend.nonces.et_admin_load,et_video_url:n.props.attrs[t.props.attrs.video_source]},success:function(e){t.props._onChange(t.props.name,e),t.setState({loading:!1})}}))}},{key:"render",value:function(){var e="";switch(this.props.type){case"change_google_api_key":e=o.a.createElement(d.a,{_onClick:this._onClickChangeApiKey,className:l()(["et-fb-settings-button--additional-button","et-fb-settings-button--change-api-key"]),inverse:!0},ETBuilderBackend.i18n.controls.additionalButton.changeApiKey);break;case"generate_image_url_from_video":e=o.a.createElement(d.a,{_onClick:this._onClickGenerateImageUrlFromVideo,className:l()(["et-fb-settings-button--additional-button","et-fb-settings-button--generate-image-url-from-video"]),inverse:!0},ETBuilderBackend.i18n.controls.additionalButton.generateImageUrlFromVideo)}return o.a.createElement(p.a,{useWrapper:!1,isLoading:this.state.loading},e)}}]),n}();g.propTypes={attrs:a.a.object,module:a.a.object,name:a.a.string,type:a.a.string,_onChange:a.a.func},t.a=g}).call(this,n(28))},function(e,t,n){},function(e,t,n){"use strict";(function(e){var r=n(1),o=n.n(r),i=n(6),a=n.n(i),s=n(4),l=n.n(s),u=n(36),c=n.n(u),d=n(73),p=n.n(d),f=n(74),h=n.n(f),g=n(2),m=n.n(g),v=n(52),b=n.n(v),y=n(1263),_=n(10),k=n(1068),w=n(21),C=n(3),S=n(29),E=n(140),O=n(1155),T=(n(24),n(82)),x=n(0),M=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},D=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var P=void 0,N=!1,L=function(e){if(C.a.getModuleItemDragEndWaiting()){var t=void 0;"function"!=typeof Event?(t=document.createEvent("Event")).initEvent("dragend",!0,!0):t=new Event("dragend"),x.default.appWindow().dispatchEvent(t)}},F=function(e){N=!0},A=function(e){clearTimeout(P),P=setTimeout(function(){if(!N&&b()(Event)){var e=void 0;"function"!=typeof Event?(e=document.createEvent("Event")).initEvent("dragend",!0,!0):e=new Event("dragend"),x.default.appWindow().dispatchEvent(e)}N=!1},150)},j={module:a.a.object,_v:S.a._v,setHoveredElement:a.a.oneOfType([a.a.func,a.a.bool])},I=function(t){function n(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var t=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return t.moveItem=function(e,n){var r=t.props.module.props.content,o=r.filter(function(t){return t._i===e})[0],i=r.filter(function(e){return e._i===n})[0],a=o._order;o._order=i._order,i._order=a,r.sort(t.compareItems),r=c()(h()(r),function(e,t){var n=e.address.split(".");return(n=p()(n)).push(t),e.address=n.join("."),e}),_.b.moduleContentChange(t.props.module,r,!0,!0)},t._onMouseEnterItem=function(e){var n=t.props.setHoveredElement;n&&n("child_item",e.type,E.a.getHelper("child_item").preparePayload(e))},t._onMouseLeaveItem=function(e){var n=t.props.setHoveredElement;n&&n(!1,e.type)},t._getItemTitleAttribute=function(e){if("content"===e.child_title_var&&m()(e,"content"))return{value:m()(e,"content"),attribute:"content"};for(var t=[[m()(e.attrs,e.child_title_var),e.child_title_var],[m()(e.attrs,e.child_title_fallback_var),e.child_title_fallback_var],[m()(e,"advanced_setting_title_text",ETBuilderBackend.i18n.modules.items.newItemDefaultText),"advanced_setting_title_text"],[m()(e.attrs,"title"),"title"]],n=0;n<t.length;n++)if(t[n][0])return{value:t[n][0].trim(),attribute:t[n][1]};return{value:"",attribute:"title"}},t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,r["Component"]),D(n,[{key:"componentDidMount",value:function(){x.default.appWindow().addEventListener("dragstart",L),x.default.appWindow().addEventListener("dragend",F),x.default.appWindow().addEventListener("drop",A)}},{key:"componentWillUnmount",value:function(){x.default.appWindow().removeEventListener("dragstart",L),x.default.appWindow().removeEventListener("dragend",F),x.default.appWindow().removeEventListener("drop",A)}},{key:"compareItems",value:function(e,t){return e._order-t._order}},{key:"render",value:function(){var t=this;return o.a.createElement(k.a,null,o.a.createElement("ul",{className:"et-fb-settings-module-items"},c()(this.props.module.props.content,function(n,r){if(!l()(n)){n.attrs=w.a.setAttrs(n.attrs,n.type);var i=t._getItemTitleAttribute(n),a=o.a.createElement(T.a,null,o.a.createElement(O.a,{attributes:n.attrs,attribute:i.attribute,value:i.value},function(t,n){return n?e(e.parseHTML(t)).text():t}));return o.a.createElement(y.a,M({key:n._i,index:r,id:n._i,title:a,moveItem:t.moveItem,_onMouseEnterItem:t._onMouseEnterItem,_onMouseLeaveItem:t._onMouseLeaveItem},n))}})))}}]),n}();I.propTypes=j,I.defaultProps={module:{},_v:0,setHoveredElement:!1},t.a=I}).call(this,n(28))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=l(n(1114)),i=l(n(1118)),a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(1055)),s=l(n(1122));function l(e){return e&&e.__esModule?e:{default:e}}var u=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var r=(0,o.default)(i.default);this.context=n,this.store=r,this.monitor=new s.default(r),this.registry=this.monitor.registry,this.backend=t(this),r.subscribe(this.handleRefCountChange.bind(this))}return r(e,[{key:"handleRefCountChange",value:function(){var e=this.store.getState().refCount>0;e&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!e&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1)}},{key:"getContext",value:function(){return this.context}},{key:"getMonitor",value:function(){return this.monitor}},{key:"getBackend",value:function(){return this.backend}},{key:"getRegistry",value:function(){return this.registry}},{key:"getActions",value:function(){var e=this,t=this.store.dispatch;return Object.keys(a).filter(function(e){return"function"==typeof a[e]}).reduce(function(n,r){var o,i=a[r];return n[r]=(o=i,function(){for(var n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];var a=o.apply(e,r);void 0!==a&&t(a)}),n},{})}}]),e}();t.default=u},function(e,t,n){"use strict";t.__esModule=!0,t.ActionTypes=void 0,t.default=function e(t,n,i){var s;"function"==typeof n&&void 0===i&&(i=n,n=void 0);if(void 0!==i){if("function"!=typeof i)throw new Error("Expected the enhancer to be a function.");return i(e)(t,n)}if("function"!=typeof t)throw new Error("Expected the reducer to be a function.");var l=t;var u=n;var c=[];var d=c;var p=!1;function f(){d===c&&(d=c.slice())}function h(){return u}function g(e){if("function"!=typeof e)throw new Error("Expected listener to be a function.");var t=!0;return f(),d.push(e),function(){if(t){t=!1,f();var n=d.indexOf(e);d.splice(n,1)}}}function m(e){if(!(0,r.default)(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(p)throw new Error("Reducers may not dispatch actions.");try{p=!0,u=l(u,e)}finally{p=!1}for(var t=c=d,n=0;n<t.length;n++){var o=t[n];o()}return e}m({type:a.INIT});return s={dispatch:m,subscribe:g,getState:h,replaceReducer:function(e){if("function"!=typeof e)throw new Error("Expected the nextReducer to be a function.");l=e,m({type:a.INIT})}},s[o.default]=function(){var e,t=g;return(e={subscribe:function(e){if("object"!=typeof e)throw new TypeError("Expected the observer to be an object.");function n(){e.next&&e.next(h())}n();var r=t(n);return{unsubscribe:r}}})[o.default]=function(){return this},e},s};var r=i(n(176)),o=i(n(1115));function i(e){return e&&e.__esModule?e:{default:e}}var a=t.ActionTypes={INIT:"@@redux/INIT"}},function(e,t,n){e.exports=n(1116)},function(e,t,n){"use strict";(function(e,r){Object.defineProperty(t,"__esModule",{value:!0});var o,i,a=n(1117),s=(o=a)&&o.__esModule?o:{default:o};i="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:r;var l=(0,s.default)(i);t.default=l}).call(this,n(156),n(168)(e))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n=e.Symbol;"function"==typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable";return t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];return{dirtyHandlerIds:(0,a.default)(e.dirtyHandlerIds,t,e.dragOperation),dragOffset:(0,r.default)(e.dragOffset,t),refCount:(0,i.default)(e.refCount,t),dragOperation:(0,o.default)(e.dragOperation,t),stateId:(0,s.default)(e.stateId)}};var r=l(n(1076)),o=l(n(1119)),i=l(n(1120)),a=l(n(1078)),s=l(n(1121));function l(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,t=arguments[1];switch(t.type){case s.BEGIN_DRAG:return r({},e,{itemType:t.itemType,item:t.item,sourceId:t.sourceId,isSourcePublic:t.isSourcePublic,dropResult:null,didDrop:!1});case s.PUBLISH_DRAG_SOURCE:return r({},e,{isSourcePublic:!0});case s.HOVER:return r({},e,{targetIds:t.targetIds});case l.REMOVE_TARGET:return-1===e.targetIds.indexOf(t.targetId)?e:r({},e,{targetIds:(0,a.default)(e.targetIds,t.targetId)});case s.DROP:return r({},e,{dropResult:t.dropResult,didDrop:!0,targetIds:[]});case s.END_DRAG:return r({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}};var o,i=n(451),a=(o=i)&&o.__esModule?o:{default:o},s=n(1055),l=n(1056);var u={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;switch(arguments[1].type){case r.ADD_SOURCE:case r.ADD_TARGET:return e+1;case r.REMOVE_SOURCE:case r.REMOVE_TARGET:return e-1;default:return e}};var r=n(1056)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0)+1}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=c(n(1048)),i=c(n(19)),a=c(n(1077)),s=c(n(1123)),l=n(1076),u=n(1078);function c(e){return e&&e.__esModule?e:{default:e}}var d=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.store=t,this.registry=new s.default(t)}return r(e,[{key:"subscribeToStateChange",value:function(e){var t=this,n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).handlerIds;(0,o.default)("function"==typeof e,"listener must be a function."),(0,o.default)(void 0===n||(0,i.default)(n),"handlerIds, when specified, must be an array of strings.");var r=this.store.getState().stateId;return this.store.subscribe(function(){var o=t.store.getState(),i=o.stateId;try{i===r||i===r+1&&!(0,u.areDirty)(o.dirtyHandlerIds,n)||e()}finally{r=i}})}},{key:"subscribeToOffsetChange",value:function(e){var t=this;(0,o.default)("function"==typeof e,"listener must be a function.");var n=this.store.getState().dragOffset;return this.store.subscribe(function(){var r=t.store.getState().dragOffset;r!==n&&(n=r,e())})}},{key:"canDragSource",value:function(e){var t=this.registry.getSource(e);return(0,o.default)(t,"Expected to find a valid source."),!this.isDragging()&&t.canDrag(this,e)}},{key:"canDropOnTarget",value:function(e){var t=this.registry.getTarget(e);if((0,o.default)(t,"Expected to find a valid target."),!this.isDragging()||this.didDrop())return!1;var n=this.registry.getTargetType(e),r=this.getItemType();return(0,a.default)(n,r)&&t.canDrop(this,e)}},{key:"isDragging",value:function(){return Boolean(this.getItemType())}},{key:"isDraggingSource",value:function(e){var t=this.registry.getSource(e,!0);return(0,o.default)(t,"Expected to find a valid source."),!(!this.isDragging()||!this.isSourcePublic())&&(this.registry.getSourceType(e)===this.getItemType()&&t.isDragging(this,e))}},{key:"isOverTarget",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{shallow:!1}).shallow;if(!this.isDragging())return!1;var n=this.registry.getTargetType(e),r=this.getItemType();if(!(0,a.default)(n,r))return!1;var o=this.getTargetIds();if(!o.length)return!1;var i=o.indexOf(e);return t?i===o.length-1:i>-1}},{key:"getItemType",value:function(){return this.store.getState().dragOperation.itemType}},{key:"getItem",value:function(){return this.store.getState().dragOperation.item}},{key:"getSourceId",value:function(){return this.store.getState().dragOperation.sourceId}},{key:"getTargetIds",value:function(){return this.store.getState().dragOperation.targetIds}},{key:"getDropResult",value:function(){return this.store.getState().dragOperation.dropResult}},{key:"didDrop",value:function(){return this.store.getState().dragOperation.didDrop}},{key:"isSourcePublic",value:function(){return this.store.getState().dragOperation.isSourcePublic}},{key:"getInitialClientOffset",value:function(){return this.store.getState().dragOffset.initialClientOffset}},{key:"getInitialSourceClientOffset",value:function(){return this.store.getState().dragOffset.initialSourceClientOffset}},{key:"getClientOffset",value:function(){return this.store.getState().dragOffset.clientOffset}},{key:"getSourceClientOffset",value:function(){return(0,l.getSourceClientOffset)(this.store.getState().dragOffset)}},{key:"getDifferenceFromInitialOffset",value:function(){return(0,l.getDifferenceFromInitialOffset)(this.store.getState().dragOffset)}}]),e}();t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=c(n(1048)),a=c(n(19)),s=c(n(1124)),l=n(1056),u=c(n(1126));function c(e){return e&&e.__esModule?e:{default:e}}var d={SOURCE:"SOURCE",TARGET:"TARGET"};function p(e,t){t&&(0,a.default)(e)?e.forEach(function(e){return p(e,!1)}):(0,i.default)("string"==typeof e||"symbol"===(void 0===e?"undefined":o(e)),t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}function f(e){switch(e[0]){case"S":return d.SOURCE;case"T":return d.TARGET;default:(0,i.default)(!1,"Cannot parse handler ID: "+e)}}var h=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.store=t,this.types={},this.handlers={},this.pinnedSourceId=null,this.pinnedSource=null}return r(e,[{key:"addSource",value:function(e,t){p(e),function(e){(0,i.default)("function"==typeof e.canDrag,"Expected canDrag to be a function."),(0,i.default)("function"==typeof e.beginDrag,"Expected beginDrag to be a function."),(0,i.default)("function"==typeof e.endDrag,"Expected endDrag to be a function.")}(t);var n=this.addHandler(d.SOURCE,e,t);return this.store.dispatch((0,l.addSource)(n)),n}},{key:"addTarget",value:function(e,t){p(e,!0),function(e){(0,i.default)("function"==typeof e.canDrop,"Expected canDrop to be a function."),(0,i.default)("function"==typeof e.hover,"Expected hover to be a function."),(0,i.default)("function"==typeof e.drop,"Expected beginDrag to be a function.")}(t);var n=this.addHandler(d.TARGET,e,t);return this.store.dispatch((0,l.addTarget)(n)),n}},{key:"addHandler",value:function(e,t,n){var r=function(e){var t=(0,u.default)().toString();switch(e){case d.SOURCE:return"S"+t;case d.TARGET:return"T"+t;default:(0,i.default)(!1,"Unknown role: "+e)}}(e);return this.types[r]=t,this.handlers[r]=n,r}},{key:"containsHandler",value:function(e){var t=this;return Object.keys(this.handlers).some(function(n){return t.handlers[n]===e})}},{key:"getSource",value:function(e,t){return(0,i.default)(this.isSourceId(e),"Expected a valid source ID."),t&&e===this.pinnedSourceId?this.pinnedSource:this.handlers[e]}},{key:"getTarget",value:function(e){return(0,i.default)(this.isTargetId(e),"Expected a valid target ID."),this.handlers[e]}},{key:"getSourceType",value:function(e){return(0,i.default)(this.isSourceId(e),"Expected a valid source ID."),this.types[e]}},{key:"getTargetType",value:function(e){return(0,i.default)(this.isTargetId(e),"Expected a valid target ID."),this.types[e]}},{key:"isSourceId",value:function(e){return f(e)===d.SOURCE}},{key:"isTargetId",value:function(e){return f(e)===d.TARGET}},{key:"removeSource",value:function(e){var t=this;(0,i.default)(this.getSource(e),"Expected an existing source."),this.store.dispatch((0,l.removeSource)(e)),(0,s.default)(function(){delete t.handlers[e],delete t.types[e]})}},{key:"removeTarget",value:function(e){var t=this;(0,i.default)(this.getTarget(e),"Expected an existing target."),this.store.dispatch((0,l.removeTarget)(e)),(0,s.default)(function(){delete t.handlers[e],delete t.types[e]})}},{key:"pinSource",value:function(e){var t=this.getSource(e);(0,i.default)(t,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=t}},{key:"unpinSource",value:function(){(0,i.default)(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}}]),e}();t.default=h},function(e,t,n){"use strict";var r=n(1125),o=[],i=[],a=r.makeRequestCallFromTimer(function(){if(i.length)throw i.shift()});function s(e){var t;(t=o.length?o.pop():new l).task=e,r(t)}function l(){this.task=null}e.exports=s,l.prototype.call=function(){try{this.task.call()}catch(e){s.onerror?s.onerror(e):(i.push(e),a())}finally{this.task=null,o[o.length]=this}}},function(e,t,n){"use strict";(function(t){function n(e){o.length||(r(),!0),o[o.length]=e}e.exports=n;var r,o=[],i=0,a=1024;function s(){for(;i<o.length;){var e=i;if(i+=1,o[e].call(),i>a){for(var t=0,n=o.length-i;t<n;t++)o[t]=o[t+i];o.length-=i,i=0}}o.length=0,i=0,!1}var l,u,c,d=void 0!==t?t:self,p=d.MutationObserver||d.WebKitMutationObserver;function f(e){return function(){var t=setTimeout(r,0),n=setInterval(r,50);function r(){clearTimeout(t),clearInterval(n),e()}}}"function"==typeof p?(l=1,u=new p(s),c=document.createTextNode(""),u.observe(c,{characterData:!0}),r=function(){l=-l,c.data=l}):r=f(s),n.requestFlush=r,n.makeRequestCallFromTimer=f}).call(this,n(156))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return r++};var r=0},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,[{key:"canDrag",value:function(){return!0}},{key:"isDragging",value:function(e,t){return t===e.getSourceId()}},{key:"endDrag",value:function(){}}]),e}();t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,[{key:"canDrop",value:function(){return!0}},{key:"hover",value:function(){}},{key:"drop",value:function(){}}]),e}();t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t.default=function(e){return new s(e)};var o,i=n(48),a=(o=i)&&o.__esModule?o:{default:o};var s=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.actions=t.getActions()}return r(e,[{key:"setup",value:function(){this.didCallSetup=!0}},{key:"teardown",value:function(){this.didCallTeardown=!0}},{key:"connectDragSource",value:function(){return a.default}},{key:"connectDragPreview",value:function(){return a.default}},{key:"connectDropTarget",value:function(){return a.default}},{key:"simulateBeginDrag",value:function(e,t){this.actions.beginDrag(e,t)}},{key:"simulatePublishDragSource",value:function(){this.actions.publishDragSource()}},{key:"simulateHover",value:function(e,t){this.actions.hover(e,t)}},{key:"simulateDrop",value:function(){this.actions.drop()}},{key:"simulateEndDrag",value:function(){this.actions.endDrag()}}]),e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o,i,a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(1),l=n(6),u=(i=l)&&i.__esModule?i:{default:i},c=n(1074);var d=(o=r=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r.backend=(0,c.unpackBackendForEs5Users)(e.backend),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,s.Component),a(t,[{key:"getChildContext",value:function(){var e=this;return(0,c.createChildContext)(this.backend,{window:e.props&&e.props.window?e.props.window:e.context&&e.context.window?e.context.window:"undefined"!=typeof window?window:void 0})}},{key:"render",value:function(){return s.Children.only(this.props.children)}}]),t}(),r.propTypes={backend:u.default.oneOfType([u.default.func,u.default.object]).isRequired,children:u.default.element.isRequired,window:u.default.object},r.defaultProps={window:void 0},r.childContextTypes=c.CHILD_CONTEXT_TYPES,r.displayName="DragDropContextProvider",r.contextTypes={window:u.default.object},o);t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return h.default.apply(void 0,["DragLayer","collect[, options]"].concat(Array.prototype.slice.call(arguments))),(0,d.default)("function"==typeof e,'Expected "collect" provided as the first argument to DragLayer to be a function that collects props to inject into the component. ',"Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs-drag-layer.html",e),(0,d.default)((0,c.default)(t),'Expected "options" provided as the second argument to DragLayer to be a plain object when specified. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs-drag-layer.html',t),function(n){var c,h,g=t.arePropsEqual,m=void 0===g?f.default:g,v=n.displayName||n.name||"Component",b=(h=c=function(t){function l(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,e));return n.handleChange=n.handleChange.bind(n),n.manager=t.dragDropManager,(0,d.default)("object"===o(n.manager),"Could not find the drag and drop manager in the context of %s. Make sure to wrap the top-level component of your app with DragDropContext. Read more: http://react-dnd.github.io/react-dnd/docs-troubleshooting.html#could-not-find-the-drag-and-drop-manager-in-the-context",v,v),n.state=n.getCurrentState(),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(l,a.Component),i(l,[{key:"getDecoratedComponentInstance",value:function(){return(0,d.default)(this.child,"In order to access an instance of the decorated component it can not be a stateless component."),this.child}},{key:"shouldComponentUpdate",value:function(e,t){return!m(e,this.props)||!(0,p.default)(t,this.state)}}]),i(l,[{key:"componentDidMount",value:function(){this.isCurrentlyMounted=!0;var e=this.manager.getMonitor();this.unsubscribeFromOffsetChange=e.subscribeToOffsetChange(this.handleChange),this.unsubscribeFromStateChange=e.subscribeToStateChange(this.handleChange),this.handleChange()}},{key:"componentWillUnmount",value:function(){this.isCurrentlyMounted=!1,this.unsubscribeFromOffsetChange(),this.unsubscribeFromStateChange()}},{key:"handleChange",value:function(){if(this.isCurrentlyMounted){var e=this.getCurrentState();(0,p.default)(e,this.state)||this.setState(e)}}},{key:"getCurrentState",value:function(){var t=this.manager.getMonitor();return e(t)}},{key:"render",value:function(){var e=this;return s.default.createElement(n,r({},this.props,this.state,{ref:function(t){e.child=t}}))}}]),l}(),c.DecoratedComponent=n,c.displayName="DragLayer("+v+")",c.contextTypes={dragDropManager:l.default.object.isRequired},h);return(0,u.default)(b,n)}};var a=n(1),s=g(a),l=g(n(6)),u=g(n(697)),c=g(n(176)),d=g(n(1048)),p=g(n(1066)),f=g(n(1079)),h=g(n(1057));function g(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){var p=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};i.default.apply(void 0,["DragSource","type, spec, collect[, options]"].concat(Array.prototype.slice.call(arguments)));var f=e;"function"!=typeof e&&((0,r.default)((0,d.default)(e),'Expected "type" provided as the first argument to DragSource to be a string, or a function that returns a string given the current props. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html',e),f=function(){return e});(0,r.default)((0,o.default)(t),'Expected "spec" provided as the second argument to DragSource to be a plain object. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html',t);var h=(0,l.default)(t);return(0,r.default)("function"==typeof n,'Expected "collect" provided as the third argument to DragSource to be a function that returns a plain object of props to inject. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html',n),(0,r.default)((0,o.default)(p),'Expected "options" provided as the fourth argument to DragSource to be a plain object when specified. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html',n),function(e){return(0,a.default)({connectBackend:function(e,t){return e.connectDragSource(t)},containerDisplayName:"DragSource",createHandler:h,registerHandler:s.default,createMonitor:u.default,createConnector:c.default,DecoratedComponent:e,getType:f,collect:n,options:p})}};var r=p(n(1048)),o=p(n(176)),i=p(n(1057)),a=p(n(1080)),s=p(n(1137)),l=p(n(1138)),u=p(n(1139)),c=p(n(1140)),d=p(n(1083));function p(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0;var o=r(n(1067));t.isDisposable=o.default;var i=r(n(1134));t.Disposable=i.default;var a=r(n(1135));t.CompositeDisposable=a.default;var s=r(n(1136));t.SerialDisposable=s.default},function(e,t,n){"use strict";var r=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t.__esModule=!0;var i=function(){},a=function(){function e(t){r(this,e),this.isDisposed=!1,this.action=t||i}return e.prototype.dispose=function(){this.isDisposed||(this.action.call(null),this.isDisposed=!0)},o(e,null,[{key:"empty",enumerable:!0,value:{dispose:i}}]),e}();t.default=a,e.exports=t.default},function(e,t,n){"use strict";var r=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")};t.__esModule=!0;var o,i=n(1067),a=(o=i)&&o.__esModule?o:{default:o},s=function(){function e(){for(var t=arguments.length,n=Array(t),o=0;o<t;o++)n[o]=arguments[o];r(this,e),Array.isArray(n[0])&&1===n.length&&(n=n[0]);for(var i=0;i<n.length;i++)if(!a.default(n[i]))throw new Error("Expected a disposable");this.disposables=n,this.isDisposed=!1}return e.prototype.add=function(e){this.isDisposed?e.dispose():this.disposables.push(e)},e.prototype.remove=function(e){if(this.isDisposed)return!1;var t=this.disposables.indexOf(e);return-1!==t&&(this.disposables.splice(t,1),e.dispose(),!0)},e.prototype.dispose=function(){if(!this.isDisposed){for(var e=this.disposables.length,t=new Array(e),n=0;n<e;n++)t[n]=this.disposables[n];this.isDisposed=!0,this.disposables=[],this.length=0;for(n=0;n<e;n++)t[n].dispose()}},e}();t.default=s,e.exports=t.default},function(e,t,n){"use strict";var r=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")};t.__esModule=!0;var o,i=n(1067),a=(o=i)&&o.__esModule?o:{default:o},s=function(){function e(){r(this,e),this.isDisposed=!1,this.current=null}return e.prototype.getDisposable=function(){return this.current},e.prototype.setDisposable=function(){var e=void 0===arguments[0]?null:arguments[0];if(null!=e&&!a.default(e))throw new Error("Expected either an empty value or a valid disposable");var t=this.isDisposed,n=void 0;t||(n=this.current,this.current=e),n&&n.dispose(),t&&e&&e.dispose()},e.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var e=this.current;this.current=null,e&&e.dispose()}},e}();t.default=s,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){var r=n.getRegistry(),o=r.addSource(e,t);return{handlerId:o,unregister:function(){r.removeSource(o)}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t.default=function(e){Object.keys(e).forEach(function(t){(0,o.default)(a.indexOf(t)>-1,'Expected the drag source specification to only have some of the following keys: %s. Instead received a specification with an unexpected "%s" key. Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html',a.join(", "),t),(0,o.default)("function"==typeof e[t],"Expected %s in the drag source specification to be a function. Instead received a specification with %s: %s. Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html",t,t,e[t])}),s.forEach(function(t){(0,o.default)("function"==typeof e[t],"Expected %s in the drag source specification to be a function. Instead received a specification with %s: %s. Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html",t,t,e[t])});var t=function(){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this.monitor=e,this.props=null,this.component=null}return r(t,[{key:"receiveProps",value:function(e){this.props=e}},{key:"receiveComponent",value:function(e){this.component=e}},{key:"canDrag",value:function(){return!e.canDrag||e.canDrag(this.props,this.monitor)}},{key:"isDragging",value:function(t,n){return e.isDragging?e.isDragging(this.props,this.monitor):n===t.getSourceId()}},{key:"beginDrag",value:function(){var t=e.beginDrag(this.props,this.monitor,this.component);return t}},{key:"endDrag",value:function(){e.endDrag&&e.endDrag(this.props,this.monitor,this.component)}}]),t}();return function(e){return new t(e)}};var o=i(n(1048));i(n(176));function i(e){return e&&e.__esModule?e:{default:e}}var a=["canDrag","beginDrag","isDragging","endDrag"],s=["beginDrag"]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t.default=function(e){return new u(e)};var o,i=n(1048),a=(o=i)&&o.__esModule?o:{default:o};var s=!1,l=!1,u=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.internalMonitor=t.getMonitor()}return r(e,[{key:"receiveHandlerId",value:function(e){this.sourceId=e}},{key:"canDrag",value:function(){(0,a.default)(!s,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs-drag-source-monitor.html");try{return s=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{s=!1}}},{key:"isDragging",value:function(){(0,a.default)(!l,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs-drag-source-monitor.html");try{return l=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{l=!1}}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}]),e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=void 0,n=void 0,i=void 0,a=void 0,s=void 0,l=void 0,u=void 0;function c(){a&&(a(),a=null),t&&n&&(a=e.connectDragSource(t,n,i))}function d(){u&&(u(),u=null),t&&s&&(u=e.connectDragPreview(t,s,l))}return{receiveHandlerId:function(e){if(e===t)return;t=e,c(),d()},hooks:(0,r.default)({dragSource:function(e,t){e===n&&(0,o.default)(t,i)||(n=e,i=t,c())},dragPreview:function(e,t){e===s&&(0,o.default)(t,l)||(s=e,l=t,d())}})}};var r=i(n(1081)),o=i(n(1082));function i(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=e.ref;if((0,i.default)("string"!=typeof n,"Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://facebook.github.io/react/docs/more-about-refs.html#the-ref-callback-attribute"),!n)return(0,a.cloneElement)(e,{ref:t});return(0,a.cloneElement)(e,{ref:function(e){t(e),n&&n(e)}})};var r,o=n(1048),i=(r=o)&&r.__esModule?r:{default:r},a=n(1)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){var p=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};i.default.apply(void 0,["DropTarget","type, spec, collect[, options]"].concat(Array.prototype.slice.call(arguments)));var f=e;"function"!=typeof e&&((0,r.default)((0,d.default)(e,!0),'Expected "type" provided as the first argument to DropTarget to be a string, an array of strings, or a function that returns either given the current props. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html',e),f=function(){return e});(0,r.default)((0,o.default)(t),'Expected "spec" provided as the second argument to DropTarget to be a plain object. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html',t);var h=(0,l.default)(t);return(0,r.default)("function"==typeof n,'Expected "collect" provided as the third argument to DropTarget to be a function that returns a plain object of props to inject. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html',n),(0,r.default)((0,o.default)(p),'Expected "options" provided as the fourth argument to DropTarget to be a plain object when specified. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html',n),function(e){return(0,a.default)({connectBackend:function(e,t){return e.connectDropTarget(t)},containerDisplayName:"DropTarget",createHandler:h,registerHandler:s.default,createMonitor:u.default,createConnector:c.default,DecoratedComponent:e,getType:f,collect:n,options:p})}};var r=p(n(1048)),o=p(n(176)),i=p(n(1057)),a=p(n(1080)),s=p(n(1143)),l=p(n(1144)),u=p(n(1145)),c=p(n(1146)),d=p(n(1083));function p(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){var r=n.getRegistry(),o=r.addTarget(e,t);return{handlerId:o,unregister:function(){r.removeTarget(o)}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t.default=function(e){Object.keys(e).forEach(function(t){(0,o.default)(a.indexOf(t)>-1,'Expected the drop target specification to only have some of the following keys: %s. Instead received a specification with an unexpected "%s" key. Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html',a.join(", "),t),(0,o.default)("function"==typeof e[t],"Expected %s in the drop target specification to be a function. Instead received a specification with %s: %s. Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html",t,t,e[t])});var t=function(){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this.monitor=e,this.props=null,this.component=null}return r(t,[{key:"receiveProps",value:function(e){this.props=e}},{key:"receiveMonitor",value:function(e){this.monitor=e}},{key:"receiveComponent",value:function(e){this.component=e}},{key:"canDrop",value:function(){return!e.canDrop||e.canDrop(this.props,this.monitor)}},{key:"hover",value:function(){e.hover&&e.hover(this.props,this.monitor,this.component)}},{key:"drop",value:function(){if(e.drop){var t=e.drop(this.props,this.monitor,this.component);return t}}}]),t}();return function(e){return new t(e)}};var o=i(n(1048));i(n(176));function i(e){return e&&e.__esModule?e:{default:e}}var a=["canDrop","hover","drop"]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t.default=function(e){return new l(e)};var o,i=n(1048),a=(o=i)&&o.__esModule?o:{default:o};var s=!1,l=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.internalMonitor=t.getMonitor()}return r(e,[{key:"receiveHandlerId",value:function(e){this.targetId=e}},{key:"canDrop",value:function(){(0,a.default)(!s,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs-drop-target-monitor.html");try{return s=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{s=!1}}},{key:"isOver",value:function(e){return this.internalMonitor.isOverTarget(this.targetId,e)}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}]),e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=void 0,n=void 0,i=void 0,a=void 0;function s(){a&&(a(),a=null),t&&n&&(a=e.connectDropTarget(t,n,i))}return{receiveHandlerId:function(e){if(e===t)return;t=e,s()},hooks:(0,r.default)({dropTarget:function(e,t){e===n&&(0,o.default)(t,i)||(n=e,i=t,s())}})}};var r=i(n(1081)),o=i(n(1082));function i(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEmptyImage=t.NativeTypes=void 0,t.default=function(e){return new r.default(e)};var r=a(n(1148)),o=a(n(1154)),i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(1069));function a(e){return e&&e.__esModule?e:{default:e}}t.NativeTypes=i,t.getEmptyImage=o.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=d(n(277)),i=d(n(1149)),a=d(n(1150)),s=n(1084),l=n(1151),u=n(1153),c=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(1069));function d(e){return e&&e.__esModule?e:{default:e}}var p=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.context=t.getContext(),this.sourcePreviewNodes={},this.sourcePreviewNodeOptions={},this.sourceNodes={},this.sourceNodeOptions={},this.enterLeaveCounter=new a.default,this.getSourceClientOffset=this.getSourceClientOffset.bind(this),this.handleTopDragStart=this.handleTopDragStart.bind(this),this.handleTopDragStartCapture=this.handleTopDragStartCapture.bind(this),this.handleTopDragEndCapture=this.handleTopDragEndCapture.bind(this),this.handleTopDragEnter=this.handleTopDragEnter.bind(this),this.handleTopDragEnterCapture=this.handleTopDragEnterCapture.bind(this),this.handleTopDragLeaveCapture=this.handleTopDragLeaveCapture.bind(this),this.handleTopDragOver=this.handleTopDragOver.bind(this),this.handleTopDragOverCapture=this.handleTopDragOverCapture.bind(this),this.handleTopDrop=this.handleTopDrop.bind(this),this.handleTopDropCapture=this.handleTopDropCapture.bind(this),this.handleSelectStart=this.handleSelectStart.bind(this),this.endDragIfSourceWasRemovedFromDOM=this.endDragIfSourceWasRemovedFromDOM.bind(this),this.endDragNativeItem=this.endDragNativeItem.bind(this)}return r(e,[{key:"setup",value:function(){if(void 0!==this.window){if(this.window.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");this.window.__isReactDndBackendSetUp=!0,this.addEventListeners(this.window)}}},{key:"teardown",value:function(){void 0!==this.window&&(this.window.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.window),this.clearCurrentDragSourceNode())}},{key:"addEventListeners",value:function(e){e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0)}},{key:"removeEventListeners",value:function(e){e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0)}},{key:"connectDragPreview",value:function(e,t,n){var r=this;return this.sourcePreviewNodeOptions[e]=n,this.sourcePreviewNodes[e]=t,function(){delete r.sourcePreviewNodes[e],delete r.sourcePreviewNodeOptions[e]}}},{key:"connectDragSource",value:function(e,t,n){var r=this;this.sourceNodes[e]=t,this.sourceNodeOptions[e]=n;var o=function(t){return r.handleDragStart(t,e)},i=function(t){return r.handleSelectStart(t,e)};return t.setAttribute("draggable",!0),t.addEventListener("dragstart",o),t.addEventListener("selectstart",i),function(){delete r.sourceNodes[e],delete r.sourceNodeOptions[e],t.removeEventListener("dragstart",o),t.removeEventListener("selectstart",i),t.setAttribute("draggable",!1)}}},{key:"connectDropTarget",value:function(e,t){var n=this,r=function(t){return n.handleDragEnter(t,e)},o=function(t){return n.handleDragOver(t,e)},i=function(t){return n.handleDrop(t,e)};return t.addEventListener("dragenter",r),t.addEventListener("dragover",o),t.addEventListener("drop",i),function(){t.removeEventListener("dragenter",r),t.removeEventListener("dragover",o),t.removeEventListener("drop",i)}}},{key:"getCurrentSourceNodeOptions",value:function(){var e=this.monitor.getSourceId(),t=this.sourceNodeOptions[e];return(0,o.default)(t||{},{dropEffect:"move"})}},{key:"getCurrentDropEffect",value:function(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}},{key:"getCurrentSourcePreviewNodeOptions",value:function(){var e=this.monitor.getSourceId(),t=this.sourcePreviewNodeOptions[e];return(0,o.default)(t||{},{anchorX:.5,anchorY:.5,captureDraggingState:!1})}},{key:"getSourceClientOffset",value:function(e){return(0,l.getNodeClientOffset)(this.sourceNodes[e])}},{key:"isDraggingNativeItem",value:function(){var e=this.monitor.getItemType();return Object.keys(c).some(function(t){return c[t]===e})}},{key:"beginDragNativeItem",value:function(e){this.clearCurrentDragSourceNode();var t=(0,u.createNativeDragSource)(e);this.currentNativeSource=new t,this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle]),(0,s.isFirefox)()&&this.window.addEventListener("mousemove",this.endDragNativeItem,!0)}},{key:"endDragNativeItem",value:function(){this.isDraggingNativeItem()&&((0,s.isFirefox)()&&this.window.removeEventListener("mousemove",this.endDragNativeItem,!0),this.actions.endDrag(),this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)}},{key:"endDragIfSourceWasRemovedFromDOM",value:function(){var e=this.currentDragSourceNode;(window.top||window).document.body.contains(e)||this.clearCurrentDragSourceNode()&&this.actions.endDrag()}},{key:"setCurrentDragSourceNode",value:function(e){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e,this.currentDragSourceNodeOffset=(0,l.getNodeClientOffset)(e),this.currentDragSourceNodeOffsetChanged=!1,this.window.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}},{key:"clearCurrentDragSourceNode",value:function(){return!!this.currentDragSourceNode&&(this.currentDragSourceNode=null,this.currentDragSourceNodeOffset=null,this.currentDragSourceNodeOffsetChanged=!1,this.window.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0),!0)}},{key:"checkIfCurrentDragSourceRectChanged",value:function(){var e=this.currentDragSourceNode;return!!e&&(!!this.currentDragSourceNodeOffsetChanged||(this.currentDragSourceNodeOffsetChanged=!(0,i.default)((0,l.getNodeClientOffset)(e),this.currentDragSourceNodeOffset),this.currentDragSourceNodeOffsetChanged))}},{key:"handleTopDragStartCapture",value:function(){this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]}},{key:"handleDragStart",value:function(e,t){this.dragStartSourceIds.unshift(t)}},{key:"handleTopDragStart",value:function(e){var t=this,n=this.dragStartSourceIds;this.dragStartSourceIds=null;var r=(0,l.getEventClientOffset)(e);this.actions.beginDrag(n,{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:r});var o=e.dataTransfer,i=(0,u.matchNativeItemType)(o);if(this.monitor.isDragging()){if("function"==typeof o.setDragImage){var a=this.monitor.getSourceId(),s=this.sourceNodes[a],c=this.sourcePreviewNodes[a]||s,d=this.getCurrentSourcePreviewNodeOptions(),p={anchorX:d.anchorX,anchorY:d.anchorY},f=(0,l.getDragPreviewOffset)(s,c,r,p);o.setDragImage(c,f.x,f.y)}try{o.setData("application/json",{})}catch(e){}this.setCurrentDragSourceNode(e.target),this.getCurrentSourcePreviewNodeOptions().captureDraggingState?this.actions.publishDragSource():setTimeout(function(){return t.actions.publishDragSource()})}else if(i)this.beginDragNativeItem(i);else{if(!(o.types||e.target.hasAttribute&&e.target.hasAttribute("draggable")))return;e.preventDefault()}}},{key:"handleTopDragEndCapture",value:function(){this.clearCurrentDragSourceNode()&&this.actions.endDrag()}},{key:"handleTopDragEnterCapture",value:function(e){if(this.dragEnterTargetIds=[],this.enterLeaveCounter.enter(e.target)&&!this.monitor.isDragging()){var t=e.dataTransfer,n=(0,u.matchNativeItemType)(t);n&&this.beginDragNativeItem(n)}}},{key:"handleDragEnter",value:function(e,t){this.dragEnterTargetIds.unshift(t)}},{key:"handleTopDragEnter",value:function(e){var t=this,n=this.dragEnterTargetIds;(this.dragEnterTargetIds=[],this.monitor.isDragging())&&((0,s.isFirefox)()||this.actions.hover(n,{clientOffset:(0,l.getEventClientOffset)(e)}),n.some(function(e){return t.monitor.canDropOnTarget(e)})&&(e.preventDefault(),e.dataTransfer.dropEffect=this.getCurrentDropEffect()))}},{key:"handleTopDragOverCapture",value:function(){this.dragOverTargetIds=[]}},{key:"handleDragOver",value:function(e,t){this.dragOverTargetIds.unshift(t)}},{key:"handleTopDragOver",value:function(e){var t=this,n=this.dragOverTargetIds;if(this.dragOverTargetIds=[],!this.monitor.isDragging())return e.preventDefault(),void(e.dataTransfer.dropEffect="none");this.actions.hover(n,{clientOffset:(0,l.getEventClientOffset)(e)}),n.some(function(e){return t.monitor.canDropOnTarget(e)})?(e.preventDefault(),e.dataTransfer.dropEffect=this.getCurrentDropEffect()):this.isDraggingNativeItem()?(e.preventDefault(),e.dataTransfer.dropEffect="none"):this.checkIfCurrentDragSourceRectChanged()&&(e.preventDefault(),e.dataTransfer.dropEffect="move")}},{key:"handleTopDragLeaveCapture",value:function(e){this.isDraggingNativeItem()&&e.preventDefault(),this.enterLeaveCounter.leave(e.target)&&this.isDraggingNativeItem()&&this.endDragNativeItem()}},{key:"handleTopDropCapture",value:function(e){this.dropTargetIds=[],e.preventDefault(),this.isDraggingNativeItem()&&this.currentNativeSource.mutateItemByReadingDataTransfer(e.dataTransfer),this.enterLeaveCounter.reset()}},{key:"handleDrop",value:function(e,t){this.dropTargetIds.unshift(t)}},{key:"handleTopDrop",value:function(e){var t=this.dropTargetIds;this.dropTargetIds=[],this.actions.hover(t,{clientOffset:(0,l.getEventClientOffset)(e)}),this.actions.drop(),this.isDraggingNativeItem()?this.endDragNativeItem():this.endDragIfSourceWasRemovedFromDOM()}},{key:"handleSelectStart",value:function(e){var t=e.target;"function"==typeof t.dragDrop&&("INPUT"===t.tagName||"SELECT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable||(e.preventDefault(),t.dragDrop()))}},{key:"window",get:function(){return this.context&&this.context.window||window}}]),e}();t.default=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(e===t)return!0;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=Object.prototype.hasOwnProperty,i=0;i<n.length;i+=1){if(!o.call(t,n[i])||e[n[i]]!==t[n[i]])return!1;var a=e[n[i]],s=t[n[i]];if(a!==s)return!1}return!0}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=a(n(47)),i=a(n(451));function a(e){return e&&e.__esModule?e:{default:e}}var s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.entered=[]}return r(e,[{key:"enter",value:function(e){var t=this.entered.length;return this.entered=(0,o.default)(this.entered.filter(function(t){return document.documentElement.contains(t)&&(!t.contains||t.contains(e))}),[e]),0===t&&this.entered.length>0}},{key:"leave",value:function(e){var t=this.entered.length;return this.entered=(0,i.default)(this.entered.filter(function(e){return document.documentElement.contains(e)}),e),t>0&&0===this.entered.length}},{key:"reset",value:function(){this.entered=[]}}]),e}();t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNodeClientOffset=l,t.getEventClientOffset=function(e){return{x:e.clientX,y:e.clientY}},t.getDragPreviewOffset=function(e,t,n,r){var i="IMG"===t.nodeName&&((0,o.isFirefox)()||!document.documentElement.contains(t)),s=l(i?e:t),u={x:n.x-s.x,y:n.y-s.y},c=e.offsetWidth,d=e.offsetHeight,p=r.anchorX,f=r.anchorY,h=i?t.width:c,g=i?t.height:d;(0,o.isSafari)()&&i&&(g/=window.devicePixelRatio,h/=window.devicePixelRatio);var m=new a.default([0,.5,1],[u.x,u.x/c*h,u.x+h-c]),v=new a.default([0,.5,1],[u.y,u.y/d*g,u.y+g-d]),b=m.interpolate(p),y=v.interpolate(f);(0,o.isSafari)()&&i&&(y+=(window.devicePixelRatio-1)*g);return{x:b,y:y}};var r,o=n(1084),i=n(1152),a=(r=i)&&r.__esModule?r:{default:r};var s=1;function l(e){var t=e.nodeType===s?e:e.parentElement;if(!t)return null;var n=t.getBoundingClientRect(),r=n.top;return{x:n.left,y:r}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var o=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);for(var r=t.length,o=[],i=0;i<r;i++)o.push(i);o.sort(function(e,n){return t[e]<t[n]?-1:1});for(var a=[],s=[],l=[],u=void 0,c=void 0,d=0;d<r-1;d++)u=t[d+1]-t[d],c=n[d+1]-n[d],s.push(u),a.push(c),l.push(c/u);for(var p=[l[0]],f=0;f<s.length-1;f++){var h=l[f],g=l[f+1];if(h*g<=0)p.push(0);else{u=s[f];var m=s[f+1],v=u+m;p.push(3*v/((v+m)/h+(v+u)/g))}}p.push(l[l.length-1]);for(var b=[],y=[],_=void 0,k=0;k<p.length-1;k++){_=l[k];var w=p[k],C=1/s[k],S=w+p[k+1]-_-_;b.push((_-w-S)*C),y.push(S*C*C)}this.xs=t,this.ys=n,this.c1s=p,this.c2s=b,this.c3s=y}return r(e,[{key:"interpolate",value:function(e){var t=this.xs,n=this.ys,r=this.c1s,o=this.c2s,i=this.c3s,a=t.length-1;if(e===t[a])return n[a];for(var s=0,l=i.length-1,u=void 0;s<=l;){var c=t[u=Math.floor(.5*(s+l))];if(c<e)s=u+1;else{if(!(c>e))return n[u];l=u-1}}var d=e-t[a=Math.max(0,l)],p=d*d;return n[a]+r[a]*d+o[a]*p+i[a]*d*p}}]),e}();t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t.createNativeDragSource=function(e){var t=l[e],n=t.exposeProperty,r=t.matchesTypes,i=t.getData;return function(){function e(){var t,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.item=(t={},(r={})[n]=r[n]||{},r[n].get=function(){return console.warn("Browser doesn't allow reading \""+n+'" until the drop event.'),null},function(e,t){for(var n in t){var r=t[n];r.configurable=r.enumerable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,n,r)}}(t,r),t)}return o(e,[{key:"mutateItemByReadingDataTransfer",value:function(e){delete this.item[n],this.item[n]=i(e,r)}},{key:"canDrag",value:function(){return!0}},{key:"beginDrag",value:function(){return this.item}},{key:"isDragging",value:function(e,t){return t===e.getSourceId()}},{key:"endDrag",value:function(){}}]),e}()},t.matchNativeItemType=function(e){var t=Array.prototype.slice.call(e.types||[]);return Object.keys(l).filter(function(e){var n=l[e].matchesTypes;return n.some(function(e){return t.indexOf(e)>-1})})[0]||null};var i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(1069));function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e,t,n){var r=t.reduce(function(t,n){return t||e.getData(n)},null);return null!=r?r:n}var l=(a(r={},i.FILE,{exposeProperty:"files",matchesTypes:["Files"],getData:function(e){return Array.prototype.slice.call(e.files)}}),a(r,i.URL,{exposeProperty:"urls",matchesTypes:["Url","text/uri-list"],getData:function(e,t){return s(e,t,"").split("\n")}}),a(r,i.TEXT,{exposeProperty:"text",matchesTypes:["Text","text/plain"],getData:function(e,t){return s(e,t,"")}}),r)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){r||((r=new Image).src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==");return r};var r=void 0},function(e,t,n){"use strict";var r=n(1),o=n.n(r),i=n(6),a=n.n(i),s=n(46),l=n(24),u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var c=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.a.PureComponent),u(t,[{key:"render",value:function(){var e=this.props.dynamic.attribute;return e.loading?this.props.renderLoading(this.props.type):this.props.children(e.value,e.dynamic)}}]),t}();c.propTypes={type:a.a.oneOf(["text","image"]),attributes:a.a.object.isRequired,attribute:a.a.string.isRequired,value:a.a.oneOfType([a.a.string,a.a.number]),renderLoading:a.a.func,children:a.a.func},c.defaultProps={type:"text",value:void 0,renderLoading:l.l,children:function(e,t){return t?Object(l.k)(e):e}},t.a=Object(s.b)(function(e){return{attribute:{attribute:e.attribute,value:e.value||null}}},function(e){return e.attributes})(c)},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){var r=n(167)("add",n(514));r.placeholder=n(155),e.exports=r},function(e,t,n){},function(e,t,n){},function(e,t,n){var r=n(167)("identity",n(77),n(384));r.placeholder=n(155),e.exports=r},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i,a=n(1),s="undefined"==typeof navigator;s||(i=n(1047));var l=function(){function e(e,t){this.editor=e,this.props=t,this.notifyOfDeprecation()}return e.prototype.notifyOfDeprecation=function(){void 0!==this.props.autoScrollCursorOnSet&&console.warn("`autoScrollCursorOnSet` has been deprecated. Use `autoScroll` instead\n\nSee https://github.com/scniro/react-codemirror2#props"),void 0!==this.props.resetCursorOnSet&&console.warn("`resetCursorOnSet` has been deprecated. Use `autoCursor` instead\n\nSee https://github.com/scniro/react-codemirror2#props"),void 0!==this.props.onSet&&console.warn("`onSet` has been deprecated. User `editorDidMount` instead. See https://github.com/scniro/react-codemirror2#events"),void 0!==this.props.onBeforeSet&&console.warn("`onBeforeSet` has been deprecated. User `onBeforeChange` for `Controlled`. instead. See https://github.com/scniro/react-codemirror2#events")},e.prototype.wire=function(e){var t=this;switch(e){case"onBlur":this.editor.on("blur",function(e,n){t.props.onBlur(t.editor,n)});break;case"onCursor":this.editor.on("cursorActivity",function(e){t.props.onCursor(t.editor,t.editor.getCursor())});break;case"onCursorActivity":this.editor.on("cursorActivity",function(e){t.props.onCursorActivity(t.editor)});break;case"onDragEnter":this.editor.on("dragenter",function(e,n){t.props.onDragEnter(t.editor,n)});break;case"onDragOver":this.editor.on("dragover",function(e,n){t.props.onDragOver(t.editor,n)});break;case"onDrop":this.editor.on("drop",function(e,n){t.props.onDrop(t.editor,n)});break;case"onFocus":this.editor.on("focus",function(e,n){t.props.onFocus(t.editor,n)});break;case"onGutterClick":this.editor.on("gutterClick",function(e,n,r,o){t.props.onGutterClick(t.editor,n,r,o)});break;case"onKeyDown":this.editor.on("keydown",function(e,n){t.props.onKeyDown(t.editor,n)});break;case"onKeyPress":this.editor.on("keypress",function(e,n){t.props.onKeyPress(t.editor,n)});break;case"onKeyUp":this.editor.on("keyup",function(e,n){t.props.onKeyUp(t.editor,n)});break;case"onScroll":this.editor.on("scroll",function(e){t.props.onScroll(t.editor,t.editor.getScrollInfo())});break;case"onSelection":this.editor.on("beforeSelectionChange",function(e,n){t.props.onSelection(t.editor,n)});break;case"onUpdate":this.editor.on("update",function(e){t.props.onUpdate(t.editor)});break;case"onViewportChange":this.editor.on("viewportChange",function(e,n,r){t.props.onViewportChange(t.editor,n,r)})}},e}(),u=function(e){function t(t){var n=e.call(this,t)||this;return s?n:(n.deferred=null,n.emulating=!1,n.hydrated=!1,n.initCb=function(){n.props.editorDidConfigure&&n.props.editorDidConfigure(n.editor)},n.mounted=!1,n)}return o(t,e),t.prototype.setCursor=function(e,t,n){var r=this.editor.getDoc();n&&this.editor.focus(),t?r.setCursor(e):r.setCursor(e,null,{scroll:!1})},t.prototype.moveCursor=function(e,t){var n=this.editor.getDoc();t?n.setCursor(e):n.setCursor(e,null,{scroll:!1})},t.prototype.hydrate=function(e){var t=this;Object.keys(e.options||{}).forEach(function(n){t.editor.setOption(n,e.options[n]),t.mirror.setOption(n,e.options[n])}),this.hydrated||(this.mounted&&this.deferred?this.resolveChange():this.initChange(e.value||"")),this.hydrated=!0},t.prototype.initChange=function(e){this.emulating=!0;var t=this.editor.lastLine(),n=this.editor.getLine(this.editor.lastLine()).length;this.editor.replaceRange(e||"",{line:0,ch:0},{line:t,ch:n}),this.mirror.setValue(e),this.editor.clearHistory(),this.mirror.clearHistory(),this.emulating=!1},t.prototype.resolveChange=function(){this.emulating=!0,"undo"===this.deferred.origin?this.editor.undo():"redo"===this.deferred.origin?this.editor.redo():this.editor.replaceRange(this.deferred.text,this.deferred.from,this.deferred.to,this.deferred.origin),this.emulating=!1,this.deferred=null},t.prototype.mirrorChange=function(e){return"undo"===e.origin?(this.editor.setHistory(this.mirror.getHistory()),this.mirror.undo()):"redo"===e.origin?(this.editor.setHistory(this.mirror.getHistory()),this.mirror.redo()):this.mirror.replaceRange(e.text,e.from,e.to,e.origin),this.mirror.getValue()},t.prototype.componentWillMount=function(){s||this.props.editorWillMount&&this.props.editorWillMount()},t.prototype.componentDidMount=function(){var e=this;if(!s){if(this.props.defineMode&&this.props.defineMode.name&&this.props.defineMode.fn&&i.defineMode(this.props.defineMode.name,this.props.defineMode.fn),this.editor=i(this.ref),this.shared=new l(this.editor,this.props),this.mirror=i(function(){}),this.editor.on("electricInput",function(){e.mirror.setHistory(e.editor.getHistory())}),this.editor.on("cursorActivity",function(){e.mirror.setCursor(e.editor.getCursor())}),this.editor.on("beforeChange",function(t,n){if(!e.emulating){n.cancel(),e.deferred=n;var r=e.mirrorChange(e.deferred);e.props.onBeforeChange&&e.props.onBeforeChange(e.editor,e.deferred,r)}}),this.editor.on("change",function(t,n){e.mounted&&e.props.onChange&&e.props.onChange(e.editor,n,e.editor.getValue())}),this.props.onBlur&&this.shared.wire("onBlur"),this.props.onCursor&&this.shared.wire("onCursor"),this.props.onCursorActivity&&this.shared.wire("onCursorActivity"),this.props.onDragEnter&&this.shared.wire("onDragEnter"),this.props.onDragOver&&this.shared.wire("onDragOver"),this.props.onDrop&&this.shared.wire("onDrop"),this.props.onFocus&&this.shared.wire("onFocus"),this.props.onGutterClick&&this.shared.wire("onGutterClick"),this.props.onKeyDown&&this.shared.wire("onKeyDown"),this.props.onKeyPress&&this.shared.wire("onKeyPress"),this.props.onKeyUp&&this.shared.wire("onKeyUp"),this.props.onScroll&&this.shared.wire("onScroll"),this.props.onSelection&&this.shared.wire("onSelection"),this.props.onUpdate&&this.shared.wire("onUpdate"),this.props.onViewportChange&&this.shared.wire("onViewportChange"),this.hydrate(this.props),this.props.selection)this.editor.getDoc().setSelections(this.props.selection);this.props.cursor&&this.setCursor(this.props.cursor,this.props.autoScroll||!1,this.props.autoFocus||!1),this.props.scroll&&this.editor.scrollTo(this.props.scroll.x,this.props.scroll.y),this.mounted=!0,this.props.editorDidMount&&this.props.editorDidMount(this.editor,this.editor.getValue(),this.initCb)}},t.prototype.componentWillReceiveProps=function(e){var t;s||(e.value!==this.props.value&&(this.hydrated=!1),this.props.autoCursor||void 0===this.props.autoCursor||(t=this.editor.getCursor()),this.hydrate(e),this.props.autoCursor||void 0===this.props.autoCursor||this.moveCursor(t,this.props.autoScroll||!1))},t.prototype.componentWillUnmount=function(){s||this.props.editorWillUnmount&&this.props.editorWillUnmount(i)},t.prototype.shouldComponentUpdate=function(e,t){return!s},t.prototype.render=function(){var e=this;if(s)return null;var t=this.props.className?"react-codemirror2 "+this.props.className:"react-codemirror2";return a.createElement("div",{className:t,ref:function(t){return e.ref=t}})},t}(a.Component);t.Controlled=u;var c=function(e){function t(t){var n=e.call(this,t)||this;return s?n:(n.continueChange=!1,n.hydrated=!1,n.initCb=function(){n.props.editorDidConfigure&&n.props.editorDidConfigure(n.editor)},n.mounted=!1,n.onBeforeChangeCb=function(){n.continueChange=!0},n)}return o(t,e),t.prototype.setCursor=function(e,t,n){var r=this.editor.getDoc();n&&this.editor.focus(),t?r.setCursor(e):r.setCursor(e,null,{scroll:!1})},t.prototype.moveCursor=function(e,t){var n=this.editor.getDoc();t?n.setCursor(e):n.setCursor(e,null,{scroll:!1})},t.prototype.hydrate=function(e){var t=this;if(Object.keys(e.options||{}).forEach(function(n){return t.editor.setOption(n,e.options[n])}),!this.hydrated){var n=this.editor.lastLine(),r=this.editor.getLine(this.editor.lastLine()).length;this.editor.replaceRange(e.value||"",{line:0,ch:0},{line:n,ch:r})}this.hydrated=!0},t.prototype.componentWillMount=function(){s||this.props.editorWillMount&&this.props.editorWillMount()},t.prototype.componentDidMount=function(){var e=this;if(!s){if(this.props.defineMode&&this.props.defineMode.name&&this.props.defineMode.fn&&i.defineMode(this.props.defineMode.name,this.props.defineMode.fn),this.editor=i(this.ref),this.shared=new l(this.editor,this.props),this.editor.on("beforeChange",function(t,n){e.props.onBeforeChange&&e.props.onBeforeChange(e.editor,n,null,e.onBeforeChangeCb)}),this.editor.on("change",function(t,n){if(e.mounted)if(e.props.onBeforeChange){if(!e.continueChange)return;e.props.onChange(e.editor,n,e.editor.getValue())}else e.props.onChange(e.editor,n,e.editor.getValue())}),this.props.onBlur&&this.shared.wire("onBlur"),this.props.onCursor&&this.shared.wire("onCursor"),this.props.onCursorActivity&&this.shared.wire("onCursorActivity"),this.props.onDragEnter&&this.shared.wire("onDragEnter"),this.props.onDragOver&&this.shared.wire("onDragOver"),this.props.onDrop&&this.shared.wire("onDrop"),this.props.onFocus&&this.shared.wire("onFocus"),this.props.onGutterClick&&this.shared.wire("onGutterClick"),this.props.onKeyDown&&this.shared.wire("onKeyDown"),this.props.onKeyPress&&this.shared.wire("onKeyPress"),this.props.onKeyUp&&this.shared.wire("onKeyUp"),this.props.onScroll&&this.shared.wire("onScroll"),this.props.onSelection&&this.shared.wire("onSelection"),this.props.onUpdate&&this.shared.wire("onUpdate"),this.props.onViewportChange&&this.shared.wire("onViewportChange"),this.hydrate(this.props),this.props.selection)this.editor.getDoc().setSelections(this.props.selection);this.props.cursor&&this.setCursor(this.props.cursor,this.props.autoScroll||!1,this.props.autoFocus||!1),this.props.scroll&&this.editor.scrollTo(this.props.scroll.x,this.props.scroll.y),this.mounted=!0,this.editor.clearHistory(),this.props.editorDidMount&&this.props.editorDidMount(this.editor,this.editor.getValue(),this.initCb)}},t.prototype.componentWillReceiveProps=function(e){var t;s||(e.value!==this.props.value&&(this.hydrated=!1),this.props.autoCursor||void 0===this.props.autoCursor||(t=this.editor.getCursor()),this.hydrate(e),this.props.autoCursor||void 0===this.props.autoCursor||this.moveCursor(t,this.props.autoScroll||!1))},t.prototype.componentWillUnmount=function(){s||this.props.editorWillUnmount&&this.props.editorWillUnmount(i)},t.prototype.shouldComponentUpdate=function(e,t){return!s},t.prototype.render=function(){var e=this;if(s)return null;var t=this.props.className?"react-codemirror2 "+this.props.className:"react-codemirror2";return a.createElement("div",{className:t,ref:function(t){return e.ref=t}})},t}(a.Component);t.UnControlled=c},function(e,t,n){ // CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE !function(e){"use strict";var t=e.commands,n=e.Pos;function r(t,r){t.extendSelectionsBy(function(o){return t.display.shift||t.doc.extend||o.empty()?function(t,r,o){if(o<0&&0==r.ch)return t.clipPos(n(r.line-1));var i=t.getLine(r.line);if(o>0&&r.ch>=i.length)return t.clipPos(n(r.line+1,0));for(var a,s="start",l=r.ch,u=o<0?0:i.length,c=0;l!=u;l+=o,c++){var d=i.charAt(o<0?l-1:l),p="_"!=d&&e.isWordChar(d)?"w":"o";if("w"==p&&d.toUpperCase()==d&&(p="W"),"start"==s)"o"!=p&&(s="in",a=p);else if("in"==s&&a!=p){if("w"==a&&"W"==p&&o<0&&l--,"W"==a&&"w"==p&&o>0){a="w";continue}break}}return n(r.line,l)}(t.doc,o.head,r):r<0?o.from():o.to()})}function o(t,r){if(t.isReadOnly())return e.Pass;t.operation(function(){for(var e=t.listSelections().length,o=[],i=-1,a=0;a<e;a++){var s=t.listSelections()[a].head;if(!(s.line<=i)){var l=n(s.line+(r?0:1),0);t.replaceRange("\n",l,null,"+insertLine"),t.indentLine(l.line,null,!0),o.push({head:l,anchor:l}),i=s.line+1}}t.setSelections(o)}),t.execCommand("indentAuto")}function i(t,r){for(var o=r.ch,i=o,a=t.getLine(r.line);o&&e.isWordChar(a.charAt(o-1));)--o;for(;i<a.length&&e.isWordChar(a.charAt(i));)++i;return{from:n(r.line,o),to:n(r.line,i),word:a.slice(o,i)}}function a(e,t){for(var n=e.listSelections(),r=[],o=0;o<n.length;o++){var i=n[o],a=e.findPosV(i.anchor,t,"line"),s=e.findPosV(i.head,t,"line"),l={anchor:a,head:s};r.push(i),r.push(l)}e.setSelections(r)}t.goSubwordLeft=function(e){r(e,-1)},t.goSubwordRight=function(e){r(e,1)},t.scrollLineUp=function(e){var t=e.getScrollInfo();if(!e.somethingSelected()){var n=e.lineAtHeight(t.top+t.clientHeight,"local");e.getCursor().line>=n&&e.execCommand("goLineUp")}e.scrollTo(null,t.top-e.defaultTextHeight())},t.scrollLineDown=function(e){var t=e.getScrollInfo();if(!e.somethingSelected()){var n=e.lineAtHeight(t.top,"local")+1;e.getCursor().line<=n&&e.execCommand("goLineDown")}e.scrollTo(null,t.top+e.defaultTextHeight())},t.splitSelectionByLine=function(e){for(var t=e.listSelections(),r=[],o=0;o<t.length;o++)for(var i=t[o].from(),a=t[o].to(),s=i.line;s<=a.line;++s)a.line>i.line&&s==a.line&&0==a.ch||r.push({anchor:s==i.line?i:n(s,0),head:s==a.line?a:n(s)});e.setSelections(r,0)},t.singleSelectionTop=function(e){var t=e.listSelections()[0];e.setSelection(t.anchor,t.head,{scroll:!1})},t.selectLine=function(e){for(var t=e.listSelections(),r=[],o=0;o<t.length;o++){var i=t[o];r.push({anchor:n(i.from().line,0),head:n(i.to().line+1,0)})}e.setSelections(r)},t.insertLineAfter=function(e){return o(e,!1)},t.insertLineBefore=function(e){return o(e,!0)},t.selectNextOccurrence=function(t){var r=t.getCursor("from"),o=t.getCursor("to"),a=t.state.sublimeFindFullWord==t.doc.sel;if(0==e.cmpPos(r,o)){var s=i(t,r);if(!s.word)return;t.setSelection(s.from,s.to),a=!0}else{var l=t.getRange(r,o),u=a?new RegExp("\\b"+l+"\\b"):l,c=t.getSearchCursor(u,o),d=c.findNext();if(d||(c=t.getSearchCursor(u,n(t.firstLine(),0)),d=c.findNext()),!d||function(e,t,n){for(var r=0;r<e.length;r++)if(e[r].from()==t&&e[r].to()==n)return!0;return!1}(t.listSelections(),c.from(),c.to()))return e.Pass;t.addSelection(c.from(),c.to())}a&&(t.state.sublimeFindFullWord=t.doc.sel)},t.addCursorToPrevLine=function(e){a(e,-1)},t.addCursorToNextLine=function(e){a(e,1)};var s="(){}[]";function l(t){for(var r=t.listSelections(),o=[],i=0;i<r.length;i++){var a=r[i],l=a.head,u=t.scanForBracket(l,-1);if(!u)return!1;for(;;){var c=t.scanForBracket(l,1);if(!c)return!1;if(c.ch==s.charAt(s.indexOf(u.ch)+1)){var d=n(u.pos.line,u.pos.ch+1);if(0!=e.cmpPos(d,a.from())||0!=e.cmpPos(c.pos,a.to())){o.push({anchor:d,head:c.pos});break}if(!(u=t.scanForBracket(u.pos,-1)))return!1}l=n(c.pos.line,c.pos.ch+1)}}return t.setSelections(o),!0}function u(t,r){if(t.isReadOnly())return e.Pass;for(var o,i=t.listSelections(),a=[],s=0;s<i.length;s++){var l=i[s];if(!l.empty()){for(var u=l.from().line,c=l.to().line;s<i.length-1&&i[s+1].from().line==c;)c=i[++s].to().line;i[s].to().ch||c--,a.push(u,c)}}a.length?o=!0:a.push(t.firstLine(),t.lastLine()),t.operation(function(){for(var e=[],i=0;i<a.length;i+=2){var s=a[i],l=a[i+1],u=n(s,0),c=n(l),d=t.getRange(u,c,!1);r?d.sort():d.sort(function(e,t){var n=e.toUpperCase(),r=t.toUpperCase();return n!=r&&(e=n,t=r),e<t?-1:e==t?0:1}),t.replaceRange(d,u,c),o&&e.push({anchor:u,head:n(l+1,0)})}o&&t.setSelections(e,0)})}function c(t,n){t.operation(function(){for(var r=t.listSelections(),o=[],a=[],s=0;s<r.length;s++){var l=r[s];l.empty()?(o.push(s),a.push("")):a.push(n(t.getRange(l.from(),l.to())))}t.replaceSelections(a,"around","case");for(var u,s=o.length-1;s>=0;s--){var l=r[o[s]];if(!(u&&e.cmpPos(l.head,u)>0)){var c=i(t,l.head);u=c.from,t.replaceRange(n(c.word),c.from,c.to)}}})}function d(t){var n=t.getCursor("from"),r=t.getCursor("to");if(0==e.cmpPos(n,r)){var o=i(t,n);if(!o.word)return;n=o.from,r=o.to}return{from:n,to:r,query:t.getRange(n,r),word:o}}function p(e,t){var r=d(e);if(r){var o=r.query,i=e.getSearchCursor(o,t?r.to:r.from);(t?i.findNext():i.findPrevious())?e.setSelection(i.from(),i.to()):(i=e.getSearchCursor(o,t?n(e.firstLine(),0):e.clipPos(n(e.lastLine()))),(t?i.findNext():i.findPrevious())?e.setSelection(i.from(),i.to()):r.word&&e.setSelection(r.from,r.to))}}t.selectScope=function(e){l(e)||e.execCommand("selectAll")},t.selectBetweenBrackets=function(t){if(!l(t))return e.Pass},t.goToBracket=function(t){t.extendSelectionsBy(function(r){var o=t.scanForBracket(r.head,1);if(o&&0!=e.cmpPos(o.pos,r.head))return o.pos;var i=t.scanForBracket(r.head,-1);return i&&n(i.pos.line,i.pos.ch+1)||r.head})},t.swapLineUp=function(t){if(t.isReadOnly())return e.Pass;for(var r=t.listSelections(),o=[],i=t.firstLine()-1,a=[],s=0;s<r.length;s++){var l=r[s],u=l.from().line-1,c=l.to().line;a.push({anchor:n(l.anchor.line-1,l.anchor.ch),head:n(l.head.line-1,l.head.ch)}),0!=l.to().ch||l.empty()||--c,u>i?o.push(u,c):o.length&&(o[o.length-1]=c),i=c}t.operation(function(){for(var e=0;e<o.length;e+=2){var r=o[e],i=o[e+1],s=t.getLine(r);t.replaceRange("",n(r,0),n(r+1,0),"+swapLine"),i>t.lastLine()?t.replaceRange("\n"+s,n(t.lastLine()),null,"+swapLine"):t.replaceRange(s+"\n",n(i,0),null,"+swapLine")}t.setSelections(a),t.scrollIntoView()})},t.swapLineDown=function(t){if(t.isReadOnly())return e.Pass;for(var r=t.listSelections(),o=[],i=t.lastLine()+1,a=r.length-1;a>=0;a--){var s=r[a],l=s.to().line+1,u=s.from().line;0!=s.to().ch||s.empty()||l--,l<i?o.push(l,u):o.length&&(o[o.length-1]=u),i=u}t.operation(function(){for(var e=o.length-2;e>=0;e-=2){var r=o[e],i=o[e+1],a=t.getLine(r);r==t.lastLine()?t.replaceRange("",n(r-1),n(r),"+swapLine"):t.replaceRange("",n(r,0),n(r+1,0),"+swapLine"),t.replaceRange(a+"\n",n(i,0),null,"+swapLine")}t.scrollIntoView()})},t.toggleCommentIndented=function(e){e.toggleComment({indent:!0})},t.joinLines=function(e){for(var t=e.listSelections(),r=[],o=0;o<t.length;o++){for(var i=t[o],a=i.from(),s=a.line,l=i.to().line;o<t.length-1&&t[o+1].from().line==l;)l=t[++o].to().line;r.push({start:s,end:l,anchor:!i.empty()&&a})}e.operation(function(){for(var t=0,o=[],i=0;i<r.length;i++){for(var a,s=r[i],l=s.anchor&&n(s.anchor.line-t,s.anchor.ch),u=s.start;u<=s.end;u++){var c=u-t;u==s.end&&(a=n(c,e.getLine(c).length+1)),c<e.lastLine()&&(e.replaceRange(" ",n(c),n(c+1,/^\s*/.exec(e.getLine(c+1))[0].length)),++t)}o.push({anchor:l||a,head:a})}e.setSelections(o,0)})},t.duplicateLine=function(e){e.operation(function(){for(var t=e.listSelections().length,r=0;r<t;r++){var o=e.listSelections()[r];o.empty()?e.replaceRange(e.getLine(o.head.line)+"\n",n(o.head.line,0)):e.replaceRange(e.getRange(o.from(),o.to()),o.from())}e.scrollIntoView()})},t.sortLines=function(e){u(e,!0)},t.sortLinesInsensitive=function(e){u(e,!1)},t.nextBookmark=function(e){var t=e.state.sublimeBookmarks;if(t)for(;t.length;){var n=t.shift(),r=n.find();if(r)return t.push(n),e.setSelection(r.from,r.to)}},t.prevBookmark=function(e){var t=e.state.sublimeBookmarks;if(t)for(;t.length;){t.unshift(t.pop());var n=t[t.length-1].find();if(n)return e.setSelection(n.from,n.to);t.pop()}},t.toggleBookmark=function(e){for(var t=e.listSelections(),n=e.state.sublimeBookmarks||(e.state.sublimeBookmarks=[]),r=0;r<t.length;r++){for(var o=t[r].from(),i=t[r].to(),a=t[r].empty()?e.findMarksAt(o):e.findMarks(o,i),s=0;s<a.length;s++)if(a[s].sublimeBookmark){a[s].clear();for(var l=0;l<n.length;l++)n[l]==a[s]&&n.splice(l--,1);break}s==a.length&&n.push(e.markText(o,i,{sublimeBookmark:!0,clearWhenEmpty:!1}))}},t.clearBookmarks=function(e){var t=e.state.sublimeBookmarks;if(t)for(var n=0;n<t.length;n++)t[n].clear();t.length=0},t.selectBookmarks=function(e){var t=e.state.sublimeBookmarks,n=[];if(t)for(var r=0;r<t.length;r++){var o=t[r].find();o?n.push({anchor:o.from,head:o.to}):t.splice(r--,0)}n.length&&e.setSelections(n,0)},t.smartBackspace=function(t){if(t.somethingSelected())return e.Pass;t.operation(function(){for(var r=t.listSelections(),o=t.getOption("indentUnit"),i=r.length-1;i>=0;i--){var a=r[i].head,s=t.getRange({line:a.line,ch:0},a),l=e.countColumn(s,null,t.getOption("tabSize")),u=t.findPosH(a,-1,"char",!1);if(s&&!/\S/.test(s)&&l%o==0){var c=new n(a.line,e.findColumn(s,l-o,o));c.ch!=a.ch&&(u=c)}t.replaceRange("",u,a,"+delete")}})},t.delLineRight=function(e){e.operation(function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange("",t[r].anchor,n(t[r].to().line),"+delete");e.scrollIntoView()})},t.upcaseAtCursor=function(e){c(e,function(e){return e.toUpperCase()})},t.downcaseAtCursor=function(e){c(e,function(e){return e.toLowerCase()})},t.setSublimeMark=function(e){e.state.sublimeMark&&e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor())},t.selectToSublimeMark=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&e.setSelection(e.getCursor(),t)},t.deleteToSublimeMark=function(t){var n=t.state.sublimeMark&&t.state.sublimeMark.find();if(n){var r=t.getCursor(),o=n;if(e.cmpPos(r,o)>0){var i=o;o=r,r=i}t.state.sublimeKilled=t.getRange(r,o),t.replaceRange("",r,o)}},t.swapWithSublimeMark=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&(e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor()),e.setCursor(t))},t.sublimeYank=function(e){null!=e.state.sublimeKilled&&e.replaceSelection(e.state.sublimeKilled,null,"paste")},t.showInCenter=function(e){var t=e.cursorCoords(null,"local");e.scrollTo(null,(t.top+t.bottom)/2-e.getScrollInfo().clientHeight/2)},t.findUnder=function(e){p(e,!0)},t.findUnderPrevious=function(e){p(e,!1)},t.findAllUnder=function(e){var t=d(e);if(t){for(var n=e.getSearchCursor(t.query),r=[],o=-1;n.findNext();)r.push({anchor:n.from(),head:n.to()}),n.from().line<=t.from.line&&n.from().ch<=t.from.ch&&o++;e.setSelections(r,o)}};var f=e.keyMap;f.macSublime={"Cmd-Left":"goLineStartSmart","Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-Left":"goSubwordLeft","Ctrl-Right":"goSubwordRight","Ctrl-Alt-Up":"scrollLineUp","Ctrl-Alt-Down":"scrollLineDown","Cmd-L":"selectLine","Shift-Cmd-L":"splitSelectionByLine",Esc:"singleSelectionTop","Cmd-Enter":"insertLineAfter","Shift-Cmd-Enter":"insertLineBefore","Cmd-D":"selectNextOccurrence","Shift-Cmd-Space":"selectScope","Shift-Cmd-M":"selectBetweenBrackets","Cmd-M":"goToBracket","Cmd-Ctrl-Up":"swapLineUp","Cmd-Ctrl-Down":"swapLineDown","Cmd-/":"toggleCommentIndented","Cmd-J":"joinLines","Shift-Cmd-D":"duplicateLine",F9:"sortLines","Cmd-F9":"sortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Cmd-F2":"toggleBookmark","Shift-Cmd-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Cmd-K Cmd-K":"delLineRight","Cmd-K Cmd-U":"upcaseAtCursor","Cmd-K Cmd-L":"downcaseAtCursor","Cmd-K Cmd-Space":"setSublimeMark","Cmd-K Cmd-A":"selectToSublimeMark","Cmd-K Cmd-W":"deleteToSublimeMark","Cmd-K Cmd-X":"swapWithSublimeMark","Cmd-K Cmd-Y":"sublimeYank","Cmd-K Cmd-C":"showInCenter","Cmd-K Cmd-G":"clearBookmarks","Cmd-K Cmd-Backspace":"delLineLeft","Cmd-K Cmd-0":"unfoldAll","Cmd-K Cmd-J":"unfoldAll","Ctrl-Shift-Up":"addCursorToPrevLine","Ctrl-Shift-Down":"addCursorToNextLine","Cmd-F3":"findUnder","Shift-Cmd-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Cmd-[":"fold","Shift-Cmd-]":"unfold","Cmd-I":"findIncremental","Shift-Cmd-I":"findIncrementalReverse","Cmd-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"macDefault"},e.normalizeKeyMap(f.macSublime),f.pcSublime={"Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-T":"transposeChars","Alt-Left":"goSubwordLeft","Alt-Right":"goSubwordRight","Ctrl-Up":"scrollLineUp","Ctrl-Down":"scrollLineDown","Ctrl-L":"selectLine","Shift-Ctrl-L":"splitSelectionByLine",Esc:"singleSelectionTop","Ctrl-Enter":"insertLineAfter","Shift-Ctrl-Enter":"insertLineBefore","Ctrl-D":"selectNextOccurrence","Shift-Ctrl-Space":"selectScope","Shift-Ctrl-M":"selectBetweenBrackets","Ctrl-M":"goToBracket","Shift-Ctrl-Up":"swapLineUp","Shift-Ctrl-Down":"swapLineDown","Ctrl-/":"toggleCommentIndented","Ctrl-J":"joinLines","Shift-Ctrl-D":"duplicateLine",F9:"sortLines","Ctrl-F9":"sortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Ctrl-F2":"toggleBookmark","Shift-Ctrl-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Ctrl-K Ctrl-K":"delLineRight","Ctrl-K Ctrl-U":"upcaseAtCursor","Ctrl-K Ctrl-L":"downcaseAtCursor","Ctrl-K Ctrl-Space":"setSublimeMark","Ctrl-K Ctrl-A":"selectToSublimeMark","Ctrl-K Ctrl-W":"deleteToSublimeMark","Ctrl-K Ctrl-X":"swapWithSublimeMark","Ctrl-K Ctrl-Y":"sublimeYank","Ctrl-K Ctrl-C":"showInCenter","Ctrl-K Ctrl-G":"clearBookmarks","Ctrl-K Ctrl-Backspace":"delLineLeft","Ctrl-K Ctrl-0":"unfoldAll","Ctrl-K Ctrl-J":"unfoldAll","Ctrl-Alt-Up":"addCursorToPrevLine","Ctrl-Alt-Down":"addCursorToNextLine","Ctrl-F3":"findUnder","Shift-Ctrl-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Ctrl-[":"fold","Shift-Ctrl-]":"unfold","Ctrl-I":"findIncremental","Shift-Ctrl-I":"findIncrementalReverse","Ctrl-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"pcDefault"},e.normalizeKeyMap(f.pcSublime);var h=f.default==f.macDefault;f.sublime=h?f.macSublime:f.pcSublime}(n(1047),n(1070),n(1089))},function(e,t,n){ // CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE !function(e){"use strict";var t={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]},n={};function r(e,t){var r=e.match(function(e){var t=n[e];return t||(n[e]=new RegExp("\\s+"+e+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*"))}(t));return r?/^\s*(.*?)\s*$/.exec(r[2])[1]:""}function o(e,t){return new RegExp((t?"^":"")+"</s*"+e+"s*>","i")}function i(e,t){for(var n in e)for(var r=t[n]||(t[n]=[]),o=e[n],i=o.length-1;i>=0;i--)r.unshift(o[i])}e.defineMode("htmlmixed",function(n,a){var s=e.getMode(n,{name:"xml",htmlMode:!0,multilineTagIndentFactor:a.multilineTagIndentFactor,multilineTagIndentPastTag:a.multilineTagIndentPastTag}),l={},u=a&&a.tags,c=a&&a.scriptTypes;if(i(t,l),u&&i(u,l),c)for(var d=c.length-1;d>=0;d--)l.script.unshift(["type",c[d].matches,c[d].mode]);function p(t,i){var a,u=s.token(t,i.htmlState),c=/\btag\b/.test(u);if(c&&!/[<>\s\/]/.test(t.current())&&(a=i.htmlState.tagName&&i.htmlState.tagName.toLowerCase())&&l.hasOwnProperty(a))i.inTag=a+" ";else if(i.inTag&&c&&/>$/.test(t.current())){var d=/^([\S]+) (.*)/.exec(i.inTag);i.inTag=null;var f=">"==t.current()&&function(e,t){for(var n=0;n<e.length;n++){var o=e[n];if(!o[0]||o[1].test(r(t,o[0])))return o[2]}}(l[d[1]],d[2]),h=e.getMode(n,f),g=o(d[1],!0),m=o(d[1],!1);i.token=function(e,t){return e.match(g,!1)?(t.token=p,t.localState=t.localMode=null,null):function(e,t,n){var r=e.current(),o=r.search(t);return o>-1?e.backUp(r.length-o):r.match(/<\/?$/)&&(e.backUp(r.length),e.match(t,!1)||e.match(r)),n}(e,m,t.localMode.token(e,t.localState))},i.localMode=h,i.localState=e.startState(h,s.indent(i.htmlState,""))}else i.inTag&&(i.inTag+=t.current(),t.eol()&&(i.inTag+=" "));return u}return{startState:function(){var t=e.startState(s);return{token:p,inTag:null,localMode:null,localState:null,htmlState:t}},copyState:function(t){var n;return t.localState&&(n=e.copyState(t.localMode,t.localState)),{token:t.token,inTag:t.inTag,localMode:t.localMode,localState:n,htmlState:e.copyState(s,t.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(t,n,r){return!t.localMode||/^\s*<\//.test(n)?s.indent(t.htmlState,n):t.localMode.indent?t.localMode.indent(t.localState,n,r):e.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||s}}}},"xml","javascript","css"),e.defineMIME("text/html","htmlmixed")}(n(1047),n(1171),n(1172),n(1071))},function(e,t,n){ // CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE !function(e){"use strict";var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};e.defineMode("xml",function(r,o){var i,a,s=r.indentUnit,l={},u=o.htmlMode?t:n;for(var c in u)l[c]=u[c];for(var c in o)l[c]=o[c];function d(e,t){function n(n){return t.tokenize=n,n(e,t)}var r=e.next();return"<"==r?e.eat("!")?e.eat("[")?e.match("CDATA[")?n(f("atom","]]>")):null:e.match("--")?n(f("comment","--\x3e")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(function e(t){return function(n,r){for(var o;null!=(o=n.next());){if("<"==o)return r.tokenize=e(t+1),r.tokenize(n,r);if(">"==o){if(1==t){r.tokenize=d;break}return r.tokenize=e(t-1),r.tokenize(n,r)}}return"meta"}}(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=f("meta","?>"),"meta"):(i=e.eat("/")?"closeTag":"openTag",t.tokenize=p,"tag bracket"):"&"==r?(e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"))?"atom":"error":(e.eatWhile(/[^&<]/),null)}function p(e,t){var n,r,o=e.next();if(">"==o||"/"==o&&e.eat(">"))return t.tokenize=d,i=">"==o?"endTag":"selfcloseTag","tag bracket";if("="==o)return i="equals",null;if("<"==o){t.tokenize=d,t.state=v,t.tagName=t.tagStart=null;var a=t.tokenize(e,t);return a?a+" tag error":"tag error"}return/[\'\"]/.test(o)?(t.tokenize=(n=o,(r=function(e,t){for(;!e.eol();)if(e.next()==n){t.tokenize=p;break}return"string"}).isInAttribute=!0,r),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function f(e,t){return function(n,r){for(;!n.eol();){if(n.match(t)){r.tokenize=d;break}n.next()}return e}}function h(e,t,n){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=n,(l.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function g(e){e.context&&(e.context=e.context.prev)}function m(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!l.contextGrabbers.hasOwnProperty(n)||!l.contextGrabbers[n].hasOwnProperty(t))return;g(e)}}function v(e,t,n){return"openTag"==e?(n.tagStart=t.column(),b):"closeTag"==e?y:v}function b(e,t,n){return"word"==e?(n.tagName=t.current(),a="tag",w):l.allowMissingTagName&&"endTag"==e?(a="tag bracket",w(e,0,n)):(a="error",b)}function y(e,t,n){if("word"==e){var r=t.current();return n.context&&n.context.tagName!=r&&l.implicitlyClosed.hasOwnProperty(n.context.tagName)&&g(n),n.context&&n.context.tagName==r||!1===l.matchClosing?(a="tag",_):(a="tag error",k)}return l.allowMissingTagName&&"endTag"==e?(a="tag bracket",_(e,0,n)):(a="error",k)}function _(e,t,n){return"endTag"!=e?(a="error",_):(g(n),v)}function k(e,t,n){return a="error",_(e,0,n)}function w(e,t,n){if("word"==e)return a="attribute",C;if("endTag"==e||"selfcloseTag"==e){var r=n.tagName,o=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||l.autoSelfClosers.hasOwnProperty(r)?m(n,r):(m(n,r),n.context=new h(n,r,o==n.indented)),v}return a="error",w}function C(e,t,n){return"equals"==e?S:(l.allowMissing||(a="error"),w(e,0,n))}function S(e,t,n){return"string"==e?E:"word"==e&&l.allowUnquoted?(a="string",w):(a="error",w(e,0,n))}function E(e,t,n){return"string"==e?E:w(e,0,n)}return d.isInText=!0,{startState:function(e){var t={tokenize:d,state:v,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;i=null;var n=t.tokenize(e,t);return(n||i)&&"comment"!=n&&(a=null,t.state=t.state(i||n,e,t),a&&(n="error"==a?n+" error":a)),n},indent:function(t,n,r){var o=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+s;if(o&&o.noIndent)return e.Pass;if(t.tokenize!=p&&t.tokenize!=d)return r?r.match(/^(\s*)/)[0].length:0;if(t.tagName)return!1!==l.multilineTagIndentPastTag?t.tagStart+t.tagName.length+2:t.tagStart+s*(l.multilineTagIndentFactor||1);if(l.alignCDATA&&/<!\[CDATA\[/.test(n))return 0;var i=n&&/^<(\/)?([\w_:\.-]*)/.exec(n);if(i&&i[1])for(;o;){if(o.tagName==i[2]){o=o.prev;break}if(!l.implicitlyClosed.hasOwnProperty(o.tagName))break;o=o.prev}else if(i)for(;o;){var a=l.contextGrabbers[o.tagName];if(!a||!a.hasOwnProperty(i[2]))break;o=o.prev}for(;o&&o.prev&&!o.startOfLine;)o=o.prev;return o?o.indent+s:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(e){e.state==S&&(e.state=w)}}}),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})}(n(1047))},function(e,t,n){ // CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE !function(e){"use strict";e.defineMode("javascript",function(t,n){var r,o,i=t.indentUnit,a=n.statementIndent,s=n.jsonld,l=n.json||s,u=n.typescript,c=n.wordCharacters||/[\w$\xa1-\uffff]/,d=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),n=e("keyword b"),r=e("keyword c"),o=e("keyword d"),i=e("operator"),a={type:"atom",style:"atom"};return{if:e("if"),while:t,with:t,else:n,do:n,try:n,finally:n,return:o,break:o,continue:o,new:e("new"),delete:r,void:r,throw:r,debugger:e("debugger"),var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:i,typeof:i,instanceof:i,true:a,false:a,null:a,undefined:a,NaN:a,Infinity:a,this:e("this"),class:e("class"),super:e("atom"),yield:r,export:e("export"),import:e("import"),extends:r,await:r}}(),p=/[+\-*&%=<>!?|~^@]/,f=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function h(e,t,n){return r=e,o=n,t}function g(e,t){var n,r=e.next();if('"'==r||"'"==r)return t.tokenize=(n=r,function(e,t){var r,o=!1;if(s&&"@"==e.peek()&&e.match(f))return t.tokenize=g,h("jsonld-keyword","meta");for(;null!=(r=e.next())&&(r!=n||o);)o=!o&&"\\"==r;return o||(t.tokenize=g),h("string","string")}),t.tokenize(e,t);if("."==r&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return h("number","number");if("."==r&&e.match(".."))return h("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(r))return h(r);if("="==r&&e.eat(">"))return h("=>","operator");if("0"==r&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),h("number","number");if("0"==r&&e.eat(/o/i))return e.eatWhile(/[0-7]/i),h("number","number");if("0"==r&&e.eat(/b/i))return e.eatWhile(/[01]/i),h("number","number");if(/\d/.test(r))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),h("number","number");if("/"==r)return e.eat("*")?(t.tokenize=m,m(e,t)):e.eat("/")?(e.skipToEnd(),h("comment","comment")):We(e,t,1)?(function(e){for(var t,n=!1,r=!1;null!=(t=e.next());){if(!n){if("/"==t&&!r)return;"["==t?r=!0:r&&"]"==t&&(r=!1)}n=!n&&"\\"==t}}(e),e.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/),h("regexp","string-2")):(e.eat("="),h("operator","operator",e.current()));if("`"==r)return t.tokenize=v,v(e,t);if("#"==r)return e.skipToEnd(),h("error","error");if(p.test(r))return">"==r&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=r&&"="!=r||e.eat("="):/[<>*+\-]/.test(r)&&(e.eat(r),">"==r&&e.eat(r))),h("operator","operator",e.current());if(c.test(r)){e.eatWhile(c);var o=e.current();if("."!=t.lastType){if(d.propertyIsEnumerable(o)){var i=d[o];return h(i.type,i.style,o)}if("async"==o&&e.match(/^(\s|\/\*.*?\*\/)*[\(\w]/,!1))return h("async","keyword",o)}return h("variable","variable",o)}}function m(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=g;break}r="*"==n}return h("comment","comment")}function v(e,t){for(var n,r=!1;null!=(n=e.next());){if(!r&&("`"==n||"$"==n&&e.eat("{"))){t.tokenize=g;break}r=!r&&"\\"==n}return h("quasi","string-2",e.current())}var b="([{}])";function y(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var n=e.string.indexOf("=>",e.start);if(!(n<0)){if(u){var r=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,n));r&&(n=r.index)}for(var o=0,i=!1,a=n-1;a>=0;--a){var s=e.string.charAt(a),l=b.indexOf(s);if(l>=0&&l<3){if(!o){++a;break}if(0==--o){"("==s&&(i=!0);break}}else if(l>=3&&l<6)++o;else if(c.test(s))i=!0;else{if(/["'\/]/.test(s))return;if(i&&!o){++a;break}}}i&&!o&&(t.fatArrowAt=a)}}var _={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0};function k(e,t,n,r,o,i){this.indented=e,this.column=t,this.type=n,this.prev=o,this.info=i,null!=r&&(this.align=r)}function w(e,t){for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0;for(var r=e.context;r;r=r.prev)for(var n=r.vars;n;n=n.next)if(n.name==t)return!0}var C={state:null,column:null,marked:null,cc:null};function S(){for(var e=arguments.length-1;e>=0;e--)C.cc.push(arguments[e])}function E(){return S.apply(null,arguments),!0}function O(e){function t(t){for(var n=t;n;n=n.next)if(n.name==e)return!0;return!1}var r=C.state;if(C.marked="def",r.context){if(t(r.localVars))return;r.localVars={name:e,next:r.localVars}}else{if(t(r.globalVars))return;n.globalVars&&(r.globalVars={name:e,next:r.globalVars})}}function T(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}var x={name:"this",next:{name:"arguments"}};function M(){C.state.context={prev:C.state.context,vars:C.state.localVars},C.state.localVars=x}function D(){C.state.localVars=C.state.context.vars,C.state.context=C.state.context.prev}function P(e,t){var n=function(){var n=C.state,r=n.indented;if("stat"==n.lexical.type)r=n.lexical.indented;else for(var o=n.lexical;o&&")"==o.type&&o.align;o=o.prev)r=o.indented;n.lexical=new k(r,C.stream.column(),e,null,n.lexical,t)};return n.lex=!0,n}function N(){var e=C.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function L(e){return function t(n){return n==e?E():";"==e?S():E(t)}}function F(e,t){return"var"==e?E(P("vardef",t.length),fe,L(";"),N):"keyword a"==e?E(P("form"),I,F,N):"keyword b"==e?E(P("form"),F,N):"keyword d"==e?C.stream.match(/^\s*$/,!1)?E():E(P("stat"),B,L(";"),N):"debugger"==e?E(L(";")):"{"==e?E(P("}"),te,N):";"==e?E():"if"==e?("else"==C.state.lexical.info&&C.state.cc[C.state.cc.length-1]==N&&C.state.cc.pop()(),E(P("form"),I,F,N,be)):"function"==e?E(Se):"for"==e?E(P("form"),ye,F,N):"class"==e||u&&"interface"==t?(C.marked="keyword",E(P("form"),Te,N)):"variable"==e?u&&"declare"==t?(C.marked="keyword",E(F)):u&&("module"==t||"enum"==t||"type"==t)&&C.stream.match(/^\s*\w/,!1)?(C.marked="keyword","enum"==t?E(Be):"type"==t?E(ie,L("operator"),ie,L(";")):E(P("form"),he,L("{"),P("}"),te,N,N)):u&&"namespace"==t?(C.marked="keyword",E(P("form"),A,te,N)):E(P("stat"),$):"switch"==e?E(P("form"),I,L("{"),P("}","switch"),te,N,N):"case"==e?E(A,L(":")):"default"==e?E(L(":")):"catch"==e?E(P("form"),M,L("("),Ee,L(")"),F,N,D):"export"==e?E(P("stat"),Pe,N):"import"==e?E(P("stat"),Le,N):"async"==e?E(F):"@"==t?E(A,F):S(P("stat"),A,L(";"),N)}function A(e,t){return R(e,t,!1)}function j(e,t){return R(e,t,!0)}function I(e){return"("!=e?S():E(P(")"),A,L(")"),N)}function R(e,t,n){if(C.state.fatArrowAt==C.stream.start){var r=n?z:U;if("("==e)return E(M,P(")"),Z(Ee,")"),N,L("=>"),r,D);if("variable"==e)return S(M,he,L("=>"),r,D)}var o=n?W:H;return _.hasOwnProperty(e)?E(o):"function"==e?E(Se,o):"class"==e||u&&"interface"==t?(C.marked="keyword",E(P("form"),Oe,N)):"keyword c"==e||"async"==e?E(n?j:A):"("==e?E(P(")"),B,L(")"),N,o):"operator"==e||"spread"==e?E(n?j:A):"["==e?E(P("]"),Re,N,o):"{"==e?ee(Y,"}",null,o):"quasi"==e?S(V,o):"new"==e?E(function(e){return function(t){return"."==t?E(e?K:q):"variable"==t&&u?E(ce,e?W:H):S(e?j:A)}}(n)):E()}function B(e){return e.match(/[;\}\)\],]/)?S():S(A)}function H(e,t){return","==e?E(A):W(e,t,!1)}function W(e,t,n){var r=0==n?H:W,o=0==n?A:j;return"=>"==e?E(M,n?z:U,D):"operator"==e?/\+\+|--/.test(t)||u&&"!"==t?E(r):u&&"<"==t&&C.stream.match(/^([^>]|<.*?>)*>\s*\(/,!1)?E(P(">"),Z(ie,">"),N,r):"?"==t?E(A,L(":"),o):E(o):"quasi"==e?S(V,r):";"!=e?"("==e?ee(j,")","call",r):"."==e?E(X,r):"["==e?E(P("]"),B,L("]"),N,r):u&&"as"==t?(C.marked="keyword",E(ie,r)):"regexp"==e?(C.state.lastType=C.marked="operator",C.stream.backUp(C.stream.pos-C.stream.start-1),E(o)):void 0:void 0}function V(e,t){return"quasi"!=e?S():"${"!=t.slice(t.length-2)?E(V):E(A,G)}function G(e){if("}"==e)return C.marked="string-2",C.state.tokenize=v,E(V)}function U(e){return y(C.stream,C.state),S("{"==e?F:A)}function z(e){return y(C.stream,C.state),S("{"==e?F:j)}function q(e,t){if("target"==t)return C.marked="keyword",E(H)}function K(e,t){if("target"==t)return C.marked="keyword",E(W)}function $(e){return":"==e?E(N,F):S(H,L(";"),N)}function X(e){if("variable"==e)return C.marked="property",E()}function Y(e,t){return"async"==e?(C.marked="property",E(Y)):"variable"==e||"keyword"==C.style?(C.marked="property","get"==t||"set"==t?E(J):(u&&C.state.fatArrowAt==C.stream.start&&(n=C.stream.match(/^\s*:\s*/,!1))&&(C.state.fatArrowAt=C.stream.pos+n[0].length),E(Q))):"number"==e||"string"==e?(C.marked=s?"property":C.style+" property",E(Q)):"jsonld-keyword"==e?E(Q):u&&T(t)?(C.marked="keyword",E(Y)):"["==e?E(A,ne,L("]"),Q):"spread"==e?E(j,Q):"*"==t?(C.marked="keyword",E(Y)):":"==e?S(Q):void 0;var n}function J(e){return"variable"!=e?S(Q):(C.marked="property",E(Se))}function Q(e){return":"==e?E(j):"("==e?S(Se):void 0}function Z(e,t,n){function r(o,i){if(n?n.indexOf(o)>-1:","==o){var a=C.state.lexical;return"call"==a.info&&(a.pos=(a.pos||0)+1),E(function(n,r){return n==t||r==t?S():S(e)},r)}return o==t||i==t?E():E(L(t))}return function(n,o){return n==t||o==t?E():S(e,r)}}function ee(e,t,n){for(var r=3;r<arguments.length;r++)C.cc.push(arguments[r]);return E(P(t,n),Z(e,t),N)}function te(e){return"}"==e?E():S(F,te)}function ne(e,t){if(u){if(":"==e)return E(ie);if("?"==t)return E(ne)}}function re(e){if(u&&":"==e)return C.stream.match(/^\s*\w+\s+is\b/,!1)?E(A,oe,ie):E(ie)}function oe(e,t){if("is"==t)return C.marked="keyword",E()}function ie(e,t){return"variable"==e||"void"==t?"keyof"==t?(C.marked="keyword",E(ie)):(C.marked="type",E(ue)):"string"==e||"number"==e||"atom"==e?E(ue):"["==e?E(P("]"),Z(ie,"]",","),N,ue):"{"==e?E(P("}"),Z(se,"}",",;"),N,ue):"("==e?E(Z(le,")"),ae):void 0}function ae(e){if("=>"==e)return E(ie)}function se(e,t){return"variable"==e||"keyword"==C.style?(C.marked="property",E(se)):"?"==t?E(se):":"==e?E(ie):"["==e?E(A,ne,L("]"),se):void 0}function le(e){return"variable"==e?E(le):":"==e?E(ie):void 0}function ue(e,t){return"<"==t?E(P(">"),Z(ie,">"),N,ue):"|"==t||"."==e?E(ie):"["==e?E(L("]"),ue):"extends"==t||"implements"==t?(C.marked="keyword",E(ie)):void 0}function ce(e,t){if("<"==t)return E(P(">"),Z(ie,">"),N,ue)}function de(){return S(ie,pe)}function pe(e,t){if("="==t)return E(ie)}function fe(e,t){return"enum"==t?(C.marked="keyword",E(Be)):S(he,ne,me,ve)}function he(e,t){return u&&T(t)?(C.marked="keyword",E(he)):"variable"==e?(O(t),E()):"spread"==e?E(he):"["==e?ee(he,"]"):"{"==e?ee(ge,"}"):void 0}function ge(e,t){return"variable"!=e||C.stream.match(/^\s*:/,!1)?("variable"==e&&(C.marked="property"),"spread"==e?E(he):"}"==e?S():E(L(":"),he,me)):(O(t),E(me))}function me(e,t){if("="==t)return E(j)}function ve(e){if(","==e)return E(fe)}function be(e,t){if("keyword b"==e&&"else"==t)return E(P("form","else"),F,N)}function ye(e){if("("==e)return E(P(")"),_e,L(")"),N)}function _e(e){return"var"==e?E(fe,L(";"),we):";"==e?E(we):"variable"==e?E(ke):S(A,L(";"),we)}function ke(e,t){return"in"==t||"of"==t?(C.marked="keyword",E(A)):E(H,we)}function we(e,t){return";"==e?E(Ce):"in"==t||"of"==t?(C.marked="keyword",E(A)):S(A,L(";"),Ce)}function Ce(e){")"!=e&&E(A)}function Se(e,t){return"*"==t?(C.marked="keyword",E(Se)):"variable"==e?(O(t),E(Se)):"("==e?E(M,P(")"),Z(Ee,")"),N,re,F,D):u&&"<"==t?E(P(">"),Z(de,">"),N,Se):void 0}function Ee(e,t){return"@"==t&&E(A,Ee),"spread"==e?E(Ee):u&&T(t)?(C.marked="keyword",E(Ee)):S(he,ne,me)}function Oe(e,t){return"variable"==e?Te(e,t):xe(e,t)}function Te(e,t){if("variable"==e)return O(t),E(xe)}function xe(e,t){return"<"==t?E(P(">"),Z(de,">"),N,xe):"extends"==t||"implements"==t||u&&","==e?("implements"==t&&(C.marked="keyword"),E(u?ie:A,xe)):"{"==e?E(P("}"),Me,N):void 0}function Me(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||u&&T(t))&&C.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(C.marked="keyword",E(Me)):"variable"==e||"keyword"==C.style?(C.marked="property",E(u?De:Se,Me)):"["==e?E(A,ne,L("]"),u?De:Se,Me):"*"==t?(C.marked="keyword",E(Me)):";"==e?E(Me):"}"==e?E():"@"==t?E(A,Me):void 0}function De(e,t){return"?"==t?E(De):":"==e?E(ie,me):"="==t?E(j):S(Se)}function Pe(e,t){return"*"==t?(C.marked="keyword",E(Ie,L(";"))):"default"==t?(C.marked="keyword",E(A,L(";"))):"{"==e?E(Z(Ne,"}"),Ie,L(";")):S(F)}function Ne(e,t){return"as"==t?(C.marked="keyword",E(L("variable"))):"variable"==e?S(j,Ne):void 0}function Le(e){return"string"==e?E():S(Fe,Ae,Ie)}function Fe(e,t){return"{"==e?ee(Fe,"}"):("variable"==e&&O(t),"*"==t&&(C.marked="keyword"),E(je))}function Ae(e){if(","==e)return E(Fe,Ae)}function je(e,t){if("as"==t)return C.marked="keyword",E(Fe)}function Ie(e,t){if("from"==t)return C.marked="keyword",E(A)}function Re(e){return"]"==e?E():S(Z(j,"]"))}function Be(){return S(P("form"),he,L("{"),P("}"),Z(He,"}"),N,N)}function He(){return S(he,me)}function We(e,t,n){return t.tokenize==g&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(n||0)))}return N.lex=!0,{startState:function(e){var t={tokenize:g,lastType:"sof",cc:[],lexical:new k((e||0)-i,0,"block",!1),localVars:n.localVars,context:n.localVars&&{vars:n.localVars},indented:e||0};return n.globalVars&&"object"==typeof n.globalVars&&(t.globalVars=n.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),y(e,t)),t.tokenize!=m&&e.eatSpace())return null;var n=t.tokenize(e,t);return"comment"==r?n:(t.lastType="operator"!=r||"++"!=o&&"--"!=o?r:"incdec",function(e,t,n,r,o){var i=e.cc;for(C.state=e,C.stream=o,C.marked=null,C.cc=i,C.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){var a=i.length?i.pop():l?A:F;if(a(n,r)){for(;i.length&&i[i.length-1].lex;)i.pop()();return C.marked?C.marked:"variable"==n&&w(e,r)?"variable-2":t}}}(t,n,r,o,e))},indent:function(t,r){if(t.tokenize==m)return e.Pass;if(t.tokenize!=g)return 0;var o,s=r&&r.charAt(0),l=t.lexical;if(!/^\s*else\b/.test(r))for(var u=t.cc.length-1;u>=0;--u){var c=t.cc[u];if(c==N)l=l.prev;else if(c!=be)break}for(;("stat"==l.type||"form"==l.type)&&("}"==s||(o=t.cc[t.cc.length-1])&&(o==H||o==W)&&!/^[,\.=+\-*:?[\(]/.test(r));)l=l.prev;a&&")"==l.type&&"stat"==l.prev.type&&(l=l.prev);var d=l.type,f=s==d;return"vardef"==d?l.indented+("operator"==t.lastType||","==t.lastType?l.info+1:0):"form"==d&&"{"==s?l.indented:"form"==d?l.indented+i:"stat"==d?l.indented+(function(e,t){return"operator"==e.lastType||","==e.lastType||p.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}(t,r)?a||i:0):"switch"!=l.info||f||0==n.doubleIndentSwitch?l.align?l.column+(f?0:1):l.indented+(f?0:i):l.indented+(/^(?:case|default)\b/.test(r)?i:2*i)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:l?null:"/*",blockCommentEnd:l?null:"*/",blockCommentContinue:l?null:" * ",lineComment:l?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:l?"json":"javascript",jsonldMode:s,jsonMode:l,expressionAllowed:We,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=A&&t!=j||e.cc.pop()}}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})}(n(1047))},function(e,t,n){ // CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE !function(e){"use strict";var t="CodeMirror-hint",n="CodeMirror-hint-active",r=(window.top||window).document;function o(e,t){this.cm=e,this.options=t,this.widget=null,this.debounce=0,this.tick=0,this.startPos=this.cm.getCursor("start"),this.startLen=this.cm.getLine(this.startPos.line).length-this.cm.getSelection().length;var n=this;e.on("cursorActivity",this.activityFunc=function(){n.cursorActivity()})}e.showHint=function(e,t,n){if(!t)return e.showHint(n);n&&n.async&&(t.async=!0);var r={hint:t};if(n)for(var o in n)r[o]=n[o];return e.showHint(r)},e.defineExtension("showHint",function(t){t=function(e,t,n){var r=e.options.hintOptions,o={};for(var i in d)o[i]=d[i];if(r)for(var i in r)void 0!==r[i]&&(o[i]=r[i]);if(n)for(var i in n)void 0!==n[i]&&(o[i]=n[i]);return o.hint.resolve&&(o.hint=o.hint.resolve(e,t)),o}(this,this.getCursor("start"),t);var n=this.listSelections();if(!(n.length>1)){if(this.somethingSelected()){if(!t.hint.supportsSelection)return;for(var r=0;r<n.length;r++)if(n[r].head.line!=n[r].anchor.line)return}this.state.completionActive&&this.state.completionActive.close();var i=this.state.completionActive=new o(this,t);i.options.hint&&(e.signal(this,"startCompletion",this),i.update(!0))}});var i=window.requestAnimationFrame||function(e){return setTimeout(e,1e3/60)},a=window.cancelAnimationFrame||clearTimeout;function s(e){return"string"==typeof e?e:e.text}function l(e,t){for(;t&&t!=e;){if("LI"===t.nodeName.toUpperCase()&&t.parentNode==e)return t;t=t.parentNode}}function u(o,i){this.completion=o,this.data=i,this.picked=!1;var a=this,u=o.cm,c=this.hints=r.createElement("ul");c.className="CodeMirror-hints",this.selectedHint=i.selectedHint||0;for(var d=i.list,p=0;p<d.length;++p){var f=c.appendChild(r.createElement("li")),h=d[p],g=t+(p!=this.selectedHint?"":" "+n);null!=h.className&&(g=h.className+" "+g),f.className=g,h.render?h.render(f,i,h):f.appendChild(r.createTextNode(h.displayText||s(h))),f.hintId=p}var m=u.cursorCoords(o.options.alignWithWord?i.from:null),v=m.left,b=m.bottom,y=!0;c.style.left=v+"px",c.style.top=b+"px";var _=window.top||window,k=_.innerWidth||Math.max(r.body.offsetWidth,r.documentElement.offsetWidth),w=_.innerHeight||Math.max(r.body.offsetHeight,r.documentElement.offsetHeight);(o.options.container||r.body).appendChild(c);var C=c.getBoundingClientRect(),S=C.bottom-w,E=c.scrollHeight>c.clientHeight+1,O=u.getScrollInfo();if(S>0){var T=C.bottom-C.top,x=m.top-(m.bottom-C.top);if(x-T>0)c.style.top=(b=m.top-T)+"px",y=!1;else if(T>w){c.style.height=w-5+"px",c.style.top=(b=m.bottom-C.top)+"px";var M=u.getCursor();i.from.ch!=M.ch&&(m=u.cursorCoords(M),c.style.left=(v=m.left)+"px",C=c.getBoundingClientRect())}}var D,P=C.right-k;if(P>0&&(C.right-C.left>k&&(c.style.width=k-5+"px",P-=C.right-C.left-k),c.style.left=(v=m.left-P)+"px"),E)for(var N=c.firstChild;N;N=N.nextSibling)N.style.paddingRight=u.display.nativeBarWidth+"px";return u.addKeyMap(this.keyMap=function(e,t){var n={Up:function(){t.moveFocus(-1)},Down:function(){t.moveFocus(1)},PageUp:function(){t.moveFocus(1-t.menuSize(),!0)},PageDown:function(){t.moveFocus(t.menuSize()-1,!0)},Home:function(){t.setFocus(0)},End:function(){t.setFocus(t.length-1)},Enter:t.pick,Tab:t.pick,Esc:t.close},r=e.options.customKeys,o=r?{}:n;function i(e,r){var i;i="string"!=typeof r?function(e){return r(e,t)}:n.hasOwnProperty(r)?n[r]:r,o[e]=i}if(r)for(var a in r)r.hasOwnProperty(a)&&i(a,r[a]);var s=e.options.extraKeys;if(s)for(var a in s)s.hasOwnProperty(a)&&i(a,s[a]);return o}(o,{moveFocus:function(e,t){a.changeActive(a.selectedHint+e,t)},setFocus:function(e){a.changeActive(e)},menuSize:function(){return a.screenAmount()},length:d.length,close:function(){o.close()},pick:function(){a.pick()},data:i})),o.options.closeOnUnfocus&&(u.on("blur",this.onBlur=function(){D=setTimeout(function(){o.close()},100)}),u.on("focus",this.onFocus=function(){clearTimeout(D)})),u.on("scroll",this.onScroll=function(){var e=u.getScrollInfo(),t=u.getWrapperElement().getBoundingClientRect(),n=b+O.top-e.top,i=n-(window.pageYOffset||(r.documentElement||r.body).scrollTop);if(y||(i+=c.offsetHeight),i<=t.top||i>=t.bottom)return o.close();c.style.top=n+"px",c.style.left=v+O.left-e.left+"px"}),e.on(c,"dblclick",function(e){var t=l(c,e.target||e.srcElement);t&&null!=t.hintId&&(a.changeActive(t.hintId),a.pick())}),e.on(c,"click",function(e){var t=l(c,e.target||e.srcElement);t&&null!=t.hintId&&(a.changeActive(t.hintId),o.options.completeOnSingleClick&&a.pick())}),e.on(c,"mousedown",function(){setTimeout(function(){u.focus()},20)}),e.signal(i,"select",d[this.selectedHint],c.childNodes[this.selectedHint]),!0}function c(e,t,n,r){if(e.async)e(t,r,n);else{var o=e(t,n);o&&o.then?o.then(r):r(o)}}o.prototype={close:function(){this.active()&&(this.cm.state.completionActive=null,this.tick=null,this.cm.off("cursorActivity",this.activityFunc),this.widget&&this.data&&e.signal(this.data,"close"),this.widget&&this.widget.close(),e.signal(this.cm,"endCompletion",this.cm))},active:function(){return this.cm.state.completionActive==this},pick:function(t,n){var r=t.list[n];r.hint?r.hint(this.cm,t,r):this.cm.replaceRange(s(r),r.from||t.from,r.to||t.to,"complete"),e.signal(t,"pick",r),this.close()},cursorActivity:function(){this.debounce&&(a(this.debounce),this.debounce=0);var e=this.cm.getCursor(),t=this.cm.getLine(e.line);if(e.line!=this.startPos.line||t.length-e.ch!=this.startLen-this.startPos.ch||e.ch<this.startPos.ch||this.cm.somethingSelected()||e.ch&&this.options.closeCharacters.test(t.charAt(e.ch-1)))this.close();else{var n=this;this.debounce=i(function(){n.update()}),this.widget&&this.widget.disable()}},update:function(e){if(null!=this.tick){var t=this,n=++this.tick;c(this.options.hint,this.cm,this.options,function(r){t.tick==n&&t.finishUpdate(r,e)})}},finishUpdate:function(t,n){this.data&&e.signal(this.data,"update");var r=this.widget&&this.widget.picked||n&&this.options.completeSingle;this.widget&&this.widget.close(),this.data=t,t&&t.list.length&&(r&&1==t.list.length?this.pick(t,0):(this.widget=new u(this,t),e.signal(t,"shown")))}},u.prototype={close:function(){if(this.completion.widget==this){this.completion.widget=null,this.hints.parentNode.removeChild(this.hints),this.completion.cm.removeKeyMap(this.keyMap);var e=this.completion.cm;this.completion.options.closeOnUnfocus&&(e.off("blur",this.onBlur),e.off("focus",this.onFocus)),e.off("scroll",this.onScroll)}},disable:function(){this.completion.cm.removeKeyMap(this.keyMap);var e=this;this.keyMap={Enter:function(){e.picked=!0}},this.completion.cm.addKeyMap(this.keyMap)},pick:function(){this.completion.pick(this.data,this.selectedHint)},changeActive:function(t,r){if(t>=this.data.list.length?t=r?this.data.list.length-1:0:t<0&&(t=r?0:this.data.list.length-1),this.selectedHint!=t){var o=this.hints.childNodes[this.selectedHint];o.className=o.className.replace(" "+n,""),(o=this.hints.childNodes[this.selectedHint=t]).className+=" "+n,o.offsetTop<this.hints.scrollTop?this.hints.scrollTop=o.offsetTop-3:o.offsetTop+o.offsetHeight>this.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=o.offsetTop+o.offsetHeight-this.hints.clientHeight+3),e.signal(this.data,"select",this.data.list[this.selectedHint],o)}},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1}},e.registerHelper("hint","auto",{resolve:function(t,n){var r,o=t.getHelpers(n,"hint");if(o.length){var i=function(e,t,n){var r=function(e,t){if(!e.somethingSelected())return t;for(var n=[],r=0;r<t.length;r++)t[r].supportsSelection&&n.push(t[r]);return n}(e,o);!function o(i){if(i==r.length)return t(null);c(r[i],e,n,function(e){e&&e.list.length>0?t(e):o(i+1)})}(0)};return i.async=!0,i.supportsSelection=!0,i}return(r=t.getHelper(t.getCursor(),"hintWords"))?function(t){return e.hint.fromList(t,{words:r})}:e.hint.anyword?function(t,n){return e.hint.anyword(t,n)}:function(){}}}),e.registerHelper("hint","fromList",function(t,n){var r=t.getCursor(),o=t.getTokenAt(r),i=e.Pos(r.line,o.end);if(o.string&&/\w/.test(o.string[o.string.length-1]))var a=o.string,s=e.Pos(r.line,o.start);else var a="",s=i;for(var l=[],u=0;u<n.words.length;u++){var c=n.words[u];c.slice(0,a.length)==a&&l.push(c)}if(l.length)return{list:l,from:s,to:i}}),e.commands.autocomplete=e.showHint;var d={hint:e.hint.auto,completeSingle:!0,alignWithWord:!0,closeCharacters:/[\s()\[\]{};:>,]/,closeOnUnfocus:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null};e.defineOption("hintOptions",null)}(n(1047))},function(e,t,n){ // CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE !function(e){"use strict";var t={link:1,visited:1,active:1,hover:1,focus:1,"first-letter":1,"first-line":1,"first-child":1,before:1,after:1,lang:1};e.registerHelper("hint","css",function(n){var r=n.getCursor(),o=n.getTokenAt(r),i=e.innerMode(n.getMode(),o.state);if("css"==i.mode.name){if("keyword"==o.type&&0=="!important".indexOf(o.string))return{list:["!important"],from:e.Pos(r.line,o.start),to:e.Pos(r.line,o.end)};var a=o.start,s=r.ch,l=o.string.slice(0,s-a);/[^\w$_-]/.test(l)&&(l="",a=s=r.ch);var u=e.resolveMode("text/css"),c=[],d=i.state.state;return"pseudo"==d||"variable-3"==o.type?p(t):"block"==d||"maybeprop"==d?p(u.propertyKeywords):"prop"==d||"parens"==d||"at"==d||"params"==d?(p(u.valueKeywords),p(u.colorKeywords)):"media"!=d&&"media_parens"!=d||(p(u.mediaTypes),p(u.mediaFeatures)),c.length?{list:c,from:e.Pos(r.line,a),to:e.Pos(r.line,s)}:void 0}function p(e){for(var t in e)l&&0!=t.lastIndexOf(l,0)||c.push(t)}})}(n(1047),n(1071))},function(e,t,n){ // CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE !function(e){"use strict";var t="ab aa af ak sq am ar an hy as av ae ay az bm ba eu be bn bh bi bs br bg my ca ch ce ny zh cv kw co cr hr cs da dv nl dz en eo et ee fo fj fi fr ff gl ka de el gn gu ht ha he hz hi ho hu ia id ie ga ig ik io is it iu ja jv kl kn kr ks kk km ki rw ky kv kg ko ku kj la lb lg li ln lo lt lu lv gv mk mg ms ml mt mi mr mh mn na nv nb nd ne ng nn no ii nr oc oj cu om or os pa pi fa pl ps pt qu rm rn ro ru sa sc sd se sm sg sr gd sn si sk sl so st es su sw ss sv ta te tg th ti bo tk tl tn to tr ts tt tw ty ug uk ur uz ve vi vo wa cy wo fy xh yi yo za zu".split(" "),n=["_blank","_self","_top","_parent"],r=["ascii","utf-8","utf-16","latin1","latin1"],o=["get","post","put","delete"],i=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],a=["all","screen","print","embossed","braille","handheld","print","projection","screen","tty","tv","speech","3d-glasses","resolution [>][<][=] [X]","device-aspect-ratio: X/Y","orientation:portrait","orientation:landscape","device-height: [X]","device-width: [X]"],s={attrs:{}},l={a:{attrs:{href:null,ping:null,type:null,media:a,target:n,hreflang:t}},abbr:s,acronym:s,address:s,applet:s,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:a,hreflang:t,type:null,shape:["default","rect","circle","poly"]}},article:s,aside:s,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["","autoplay"],loop:["","loop"],controls:["","controls"]}},b:s,base:{attrs:{href:null,target:n}},basefont:s,bdi:s,bdo:s,big:s,blockquote:{attrs:{cite:null}},body:s,br:s,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["","autofocus"],disabled:["","autofocus"],formenctype:i,formmethod:o,formnovalidate:["","novalidate"],formtarget:n,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:s,center:s,cite:s,code:s,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["","disabled"],checked:["","checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["","disabled"],multiple:["","multiple"]}},datalist:{attrs:{data:null}},dd:s,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["","open"]}},dfn:s,dir:s,div:s,dl:s,dt:s,em:s,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["","disabled"],form:null,name:null}},figcaption:s,figure:s,font:s,footer:s,form:{attrs:{action:null,name:null,"accept-charset":r,autocomplete:["on","off"],enctype:i,method:o,novalidate:["","novalidate"],target:n}},frame:s,frameset:s,h1:s,h2:s,h3:s,h4:s,h5:s,h6:s,head:{attrs:{},children:["title","base","link","style","meta","script","noscript","command"]},header:s,hgroup:s,hr:s,html:{attrs:{manifest:null},children:["head","body"]},i:s,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["","seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["","autofocus"],checked:["","checked"],disabled:["","disabled"],formenctype:i,formmethod:o,formnovalidate:["","novalidate"],formtarget:n,multiple:["","multiple"],readonly:["","readonly"],required:["","required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:s,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["","autofocus"],disabled:["","disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:s,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:t,media:a,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:s,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:r,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:s,noframes:s,noscript:s,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["","typemustmatch"]}},ol:{attrs:{reversed:["","reversed"],start:null,type:["1","a","A","i","I"]}},optgroup:{attrs:{disabled:["","disabled"],label:null}},option:{attrs:{disabled:["","disabled"],label:null,selected:["","selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:s,param:{attrs:{name:null,value:null}},pre:s,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:s,rt:s,ruby:s,s:s,samp:s,script:{attrs:{type:["text/javascript"],src:null,async:["","async"],defer:["","defer"],charset:r}},section:s,select:{attrs:{form:null,name:null,size:null,autofocus:["","autofocus"],disabled:["","disabled"],multiple:["","multiple"]}},small:s,source:{attrs:{src:null,type:null,media:null}},span:s,strike:s,strong:s,style:{attrs:{type:["text/css"],media:a,scoped:null}},sub:s,summary:s,sup:s,table:s,tbody:s,td:{attrs:{colspan:null,rowspan:null,headers:null}},textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["","autofocus"],disabled:["","disabled"],readonly:["","readonly"],required:["","required"],wrap:["soft","hard"]}},tfoot:s,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:s,time:{attrs:{datetime:null}},title:s,tr:s,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:t}},tt:s,u:s,ul:s,var:s,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["","autoplay"],mediagroup:["movie"],muted:["","muted"],controls:["","controls"]}},wbr:s},u={accesskey:["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9"],class:null,contenteditable:["true","false"],contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["en","es"],spellcheck:["true","false"],style:null,tabindex:["1","2","3","4","5","6","7","8","9"],title:null,translate:["yes","no"],onclick:null,rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"]};function c(e){for(var t in u)u.hasOwnProperty(t)&&(e.attrs[t]=u[t])}for(var d in c(s),l)l.hasOwnProperty(d)&&l[d]!=s&&c(l[d]);e.htmlSchema=l,e.registerHelper("hint","html",function(t,n){var r={schemaInfo:l};if(n)for(var o in n)r[o]=n[o];return e.hint.xml(t,r)})}(n(1047),n(1176))},function(e,t,n){ // CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE !function(e){"use strict";var t=e.Pos;e.registerHelper("hint","xml",function(n,r){var o=r&&r.schemaInfo,i=r&&r.quoteChar||'"';if(o){var a=n.getCursor(),s=n.getTokenAt(a);s.end>a.ch&&(s.end=a.ch,s.string=s.string.slice(0,a.ch-s.start));var l=e.innerMode(n.getMode(),s.state);if("xml"==l.mode.name){var u,c,d=[],p=!1,f=/\btag\b/.test(s.type)&&!/>$/.test(s.string),h=f&&/^\w/.test(s.string);if(h){var g=n.getLine(a.line).slice(Math.max(0,s.start-2),s.start),m=/<\/$/.test(g)?"close":/<$/.test(g)?"open":null;m&&(c=s.start-("close"==m?2:1))}else f&&"<"==s.string?m="open":f&&"</"==s.string&&(m="close");if(!f&&!l.state.tagName||m){h&&(u=s.string),p=m;var v=l.state.context,b=v&&o[v.tagName],y=v?b&&b.children:o["!top"];if(y&&"close"!=m)for(var _=0;_<y.length;++_)u&&0!=y[_].lastIndexOf(u,0)||d.push("<"+y[_]);else if("close"!=m)for(var k in o)!o.hasOwnProperty(k)||"!top"==k||"!attrs"==k||u&&0!=k.lastIndexOf(u,0)||d.push("<"+k);v&&(!u||"close"==m&&0==v.tagName.lastIndexOf(u,0))&&d.push("</"+v.tagName+">")}else{var b=o[l.state.tagName],w=b&&b.attrs,C=o["!attrs"];if(!w&&!C)return;if(w){if(C){var S={};for(var E in C)C.hasOwnProperty(E)&&(S[E]=C[E]);for(var E in w)w.hasOwnProperty(E)&&(S[E]=w[E]);w=S}}else w=C;if("string"==s.type||"="==s.string){var O,g=n.getRange(t(a.line,Math.max(0,a.ch-60)),t(a.line,"string"==s.type?s.start:s.end)),T=g.match(/([^\s\u00a0=<>\"\']+)=$/);if(!T||!w.hasOwnProperty(T[1])||!(O=w[T[1]]))return;if("function"==typeof O&&(O=O.call(this,n)),"string"==s.type){u=s.string;var x=0;/['"]/.test(s.string.charAt(0))&&(i=s.string.charAt(0),u=s.string.slice(1),x++);var M=s.string.length;/['"]/.test(s.string.charAt(M-1))&&(i=s.string.charAt(M-1),u=s.string.substr(x,M-2)),p=!0}for(var _=0;_<O.length;++_)u&&0!=O[_].lastIndexOf(u,0)||d.push(i+O[_]+i)}else for(var D in"attribute"==s.type&&(u=s.string,p=!0),w)!w.hasOwnProperty(D)||u&&0!=D.lastIndexOf(u,0)||d.push(D)}return{list:d,from:p?t(a.line,null==c?s.start:c):a,to:p?t(a.line,s.end):a}}}})}(n(1047))},function(e,t,n){ // CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE !function(e){var t={pairs:"()[]{}''\"\"",triples:"",explode:"[]{}"},n=e.Pos;function r(e,n){return"pairs"==n&&"string"==typeof e?e:"object"==typeof e&&null!=e[n]?e[n]:t[n]}e.defineOption("autoCloseBrackets",!1,function(t,n,a){a&&a!=e.Init&&(t.removeKeyMap(o),t.state.closeBrackets=null),n&&(i(r(n,"pairs")),t.state.closeBrackets=n,t.addKeyMap(o))});var o={Backspace:function(t){var o=s(t);if(!o||t.getOption("disableInput"))return e.Pass;for(var i=r(o,"pairs"),a=t.listSelections(),l=0;l<a.length;l++){if(!a[l].empty())return e.Pass;var c=u(t,a[l].head);if(!c||i.indexOf(c)%2!=0)return e.Pass}for(var l=a.length-1;l>=0;l--){var d=a[l].head;t.replaceRange("",n(d.line,d.ch-1),n(d.line,d.ch+1),"+delete")}},Enter:function(t){var n=s(t),o=n&&r(n,"explode");if(!o||t.getOption("disableInput"))return e.Pass;for(var i=t.listSelections(),a=0;a<i.length;a++){if(!i[a].empty())return e.Pass;var l=u(t,i[a].head);if(!l||o.indexOf(l)%2!=0)return e.Pass}t.operation(function(){var e=t.lineSeparator()||"\n";t.replaceSelection(e+e,null),t.execCommand("goCharLeft"),i=t.listSelections();for(var n=0;n<i.length;n++){var r=i[n].head.line;t.indentLine(r,null,!0),t.indentLine(r+1,null,!0)}})}};function i(e){for(var t=0;t<e.length;t++){var n=e.charAt(t),r="'"+n+"'";o[r]||(o[r]=a(n))}}function a(t){return function(o){return function(t,o){var i=s(t);if(!i||t.getOption("disableInput"))return e.Pass;var a=r(i,"pairs"),u=a.indexOf(o);if(-1==u)return e.Pass;for(var d,p=r(i,"triples"),f=a.charAt(u+1)==o,h=t.listSelections(),g=u%2==0,m=0;m<h.length;m++){var v,b=h[m],y=b.head,_=t.getRange(y,n(y.line,y.ch+1));if(g&&!b.empty())v="surround";else if(!f&&g||_!=o)if(f&&y.ch>1&&p.indexOf(o)>=0&&t.getRange(n(y.line,y.ch-2),y)==o+o){if(y.ch>2&&/\bstring/.test(t.getTokenTypeAt(n(y.line,y.ch-2))))return e.Pass;v="addFour"}else if(f){var k=0==y.ch?" ":t.getRange(n(y.line,y.ch-1),y);if(e.isWordChar(_)||k==o||e.isWordChar(k))return e.Pass;v="both"}else{if(!g||t.getLine(y.line).length!=y.ch&&!l(_,a)&&!/\s/.test(_))return e.Pass;v="both"}else v=f&&c(t,y)?"both":p.indexOf(o)>=0&&t.getRange(y,n(y.line,y.ch+3))==o+o+o?"skipThree":"skip";if(d){if(d!=v)return e.Pass}else d=v}var w=u%2?a.charAt(u-1):o,C=u%2?o:a.charAt(u+1);t.operation(function(){if("skip"==d)t.execCommand("goCharRight");else if("skipThree"==d)for(var r=0;r<3;r++)t.execCommand("goCharRight");else if("surround"==d){for(var o=t.getSelections(),r=0;r<o.length;r++)o[r]=w+o[r]+C;t.replaceSelections(o,"around"),o=t.listSelections().slice();for(var r=0;r<o.length;r++)o[r]=(i=o[r],a=void 0,a=e.cmpPos(i.anchor,i.head)>0,{anchor:new n(i.anchor.line,i.anchor.ch+(a?-1:1)),head:new n(i.head.line,i.head.ch+(a?1:-1))});t.setSelections(o)}else"both"==d?(t.replaceSelection(w+C,null),t.triggerElectric(w+C),t.execCommand("goCharLeft")):"addFour"==d&&(t.replaceSelection(w+w+w+w,"before"),t.execCommand("goCharRight"));var i,a})}(o,t)}}function s(e){var t=e.state.closeBrackets;if(!t||t.override)return t;var n=e.getModeAt(e.getCursor());return n.closeBrackets||t}function l(e,t){var n=t.lastIndexOf(e);return n>-1&&n%2==1}function u(e,t){var r=e.getRange(n(t.line,t.ch-1),n(t.line,t.ch+1));return 2==r.length?r:null}function c(e,t){var r=e.getTokenAt(n(t.line,t.ch+1));return/\bstring/.test(r.type)&&r.start==t.ch&&(0==t.ch||!/\bstring/.test(e.getTokenTypeAt(t)))}i(t.pairs+"`")}(n(1047))},function(e,t,n){ // CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE !function(e){e.defineOption("autoCloseTags",!1,function(a,s,l){if(l!=e.Init&&l&&a.removeKeyMap("autoCloseTags"),s){var u={name:"autoCloseTags"};("object"!=typeof s||s.whenClosing)&&(u["'/'"]=function(t){return function(t){return t.getOption("disableInput")?e.Pass:r(t,!0)}(t)}),("object"!=typeof s||s.whenOpening)&&(u["'>'"]=function(r){return function(r){if(r.getOption("disableInput"))return e.Pass;for(var a=r.listSelections(),s=[],l=r.getOption("autoCloseTags"),u=0;u<a.length;u++){if(!a[u].empty())return e.Pass;var c=a[u].head,d=r.getTokenAt(c),p=e.innerMode(r.getMode(),d.state),f=p.state;if("xml"!=p.mode.name||!f.tagName)return e.Pass;var h="html"==p.mode.configuration,g="object"==typeof l&&l.dontCloseTags||h&&t,m="object"==typeof l&&l.indentTags||h&&n,v=f.tagName;d.end>c.ch&&(v=v.slice(0,v.length-d.end+c.ch));var b=v.toLowerCase();if(!v||"string"==d.type&&(d.end!=c.ch||!/[\"\']/.test(d.string.charAt(d.string.length-1))||1==d.string.length)||"tag"==d.type&&"closeTag"==f.type||d.string.indexOf("/")==d.string.length-1||g&&o(g,b)>-1||i(r,v,c,f,!0))return e.Pass;var y=m&&o(m,b)>-1;s[u]={indent:y,text:">"+(y?"\n\n":"")+"</"+v+">",newPos:y?e.Pos(c.line+1,0):e.Pos(c.line,c.ch+1)}}for(var _="object"==typeof l&&l.dontIndentOnAutoClose,u=a.length-1;u>=0;u--){var k=s[u];r.replaceRange(k.text,a[u].head,a[u].anchor,"+insert");var w=r.listSelections().slice(0);w[u]={head:k.newPos,anchor:k.newPos},r.setSelections(w),!_&&k.indent&&(r.indentLine(k.newPos.line,null,!0),r.indentLine(k.newPos.line+1,null,!0))}}(r)}),a.addKeyMap(u)}});var t=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],n=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function r(t,n){for(var r=t.listSelections(),o=[],a=n?"/":"</",s=t.getOption("autoCloseTags"),l="object"==typeof s&&s.dontIndentOnSlash,u=0;u<r.length;u++){if(!r[u].empty())return e.Pass;var c,d=r[u].head,p=t.getTokenAt(d),f=e.innerMode(t.getMode(),p.state),h=f.state;if(n&&("string"==p.type||"<"!=p.string.charAt(0)||p.start!=d.ch-1))return e.Pass;if("xml"!=f.mode.name)if("htmlmixed"==t.getMode().name&&"javascript"==f.mode.name)c=a+"script";else{if("htmlmixed"!=t.getMode().name||"css"!=f.mode.name)return e.Pass;c=a+"style"}else{if(!h.context||!h.context.tagName||i(t,h.context.tagName,d,h))return e.Pass;c=a+h.context.tagName}">"!=t.getLine(d.line).charAt(p.end)&&(c+=">"),o[u]=c}if(t.replaceSelections(o),r=t.listSelections(),!l)for(var u=0;u<r.length;u++)(u==r.length-1||r[u].head.line<r[u+1].head.line)&&t.indentLine(r[u].head.line)}function o(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;++n)if(e[n]==t)return n;return-1}function i(t,n,r,o,i){if(!e.scanForClosingTag)return!1;var a=Math.min(t.lastLine()+1,r.line+500),s=e.scanForClosingTag(t,r,null,a);if(!s||s.tag!=n)return!1;for(var l=o.context,u=i?1:0;l&&l.tagName==n;l=l.prev)++u;r=s.to;for(var c=1;c<u;c++){var d=e.scanForClosingTag(t,r,null,a);if(!d||d.tag!=n)return!1;r=d.to}return!0}e.commands.closeTag=function(e){return r(e)}}(n(1047),n(1090))},function(e,t,n){ // CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE !function(e){"use strict";function t(e){e.state.tagHit&&e.state.tagHit.clear(),e.state.tagOther&&e.state.tagOther.clear(),e.state.tagHit=e.state.tagOther=null}function n(n){n.state.failedTagMatch=!1,n.operation(function(){if(t(n),!n.somethingSelected()){var r=n.getCursor(),o=n.getViewport();o.from=Math.min(o.from,r.line),o.to=Math.max(r.line+1,o.to);var i=e.findMatchingTag(n,r,o);if(i){if(n.state.matchBothTags){var a="open"==i.at?i.open:i.close;a&&(n.state.tagHit=n.markText(a.from,a.to,{className:"CodeMirror-matchingtag"}))}var s="close"==i.at?i.open:i.close;s?n.state.tagOther=n.markText(s.from,s.to,{className:"CodeMirror-matchingtag"}):n.state.failedTagMatch=!0}}})}function r(e){e.state.failedTagMatch&&n(e)}e.defineOption("matchTags",!1,function(o,i,a){a&&a!=e.Init&&(o.off("cursorActivity",n),o.off("viewportChange",r),t(o)),i&&(o.state.matchBothTags="object"==typeof i&&i.bothTags,o.on("cursorActivity",n),o.on("viewportChange",r),n(o))}),e.commands.toMatchingTag=function(t){var n=e.findMatchingTag(t,t.getCursor());if(n){var r="close"==n.at?n.open:n.close;r&&t.extendSelection(r.to,r.from)}}}(n(1047),n(1090))},function(e,t,n){ // CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE !function(e){"use strict";var t="CodeMirror-activeline",n="CodeMirror-activeline-background",r="CodeMirror-activeline-gutter";function o(e){for(var o=0;o<e.state.activeLines.length;o++)e.removeLineClass(e.state.activeLines[o],"wrap",t),e.removeLineClass(e.state.activeLines[o],"background",n),e.removeLineClass(e.state.activeLines[o],"gutter",r)}function i(e,i){for(var a=[],s=0;s<i.length;s++){var l=i[s],u=e.getOption("styleActiveLine");if("object"==typeof u&&u.nonEmpty?l.anchor.line==l.head.line:l.empty()){var c=e.getLineHandleVisualStart(l.head.line);a[a.length-1]!=c&&a.push(c)}}(function(e,t){if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0})(e.state.activeLines,a)||e.operation(function(){o(e);for(var i=0;i<a.length;i++)e.addLineClass(a[i],"wrap",t),e.addLineClass(a[i],"background",n),e.addLineClass(a[i],"gutter",r);e.state.activeLines=a})}function a(e,t){i(e,t.ranges)}e.defineOption("styleActiveLine",!1,function(t,n,r){var s=r!=e.Init&&r;n!=s&&(s&&(t.off("beforeSelectionChange",a),o(t),delete t.state.activeLines),n&&(t.state.activeLines=[],i(t,t.listSelections()),t.on("beforeSelectionChange",a)))})}(n(1047))},function(e,t,n){ // CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE !function(e){"use strict";function t(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}function n(e){return e.state.search||(e.state.search=new t)}function r(e){return"string"==typeof e&&e==e.toLowerCase()}function o(e,t,n){return e.getSearchCursor(t,n,{caseFold:r(t),multiline:!0})}function i(e,t,n,r,o){e.openDialog?e.openDialog(t,o,{value:r,selectValueOnOpen:!0}):o(prompt(n,r))}function a(e){return e.replace(/\\(.)/g,function(e,t){return"n"==t?"\n":"r"==t?"\r":t})}function s(e){var t=e.match(/^\/(.*)\/([a-z]*)$/);if(t)try{e=new RegExp(t[1],-1==t[2].indexOf("i")?"":"i")}catch(e){}else e=a(e);return("string"==typeof e?""==e:e.test(""))&&(e=/x^/),e}var l='<span class="CodeMirror-search-label">Search:</span> <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>';function u(e,t,n){t.queryText=n,t.query=s(n),e.removeOverlay(t.overlay,r(t.query)),t.overlay=function(e,t){return"string"==typeof e?e=new RegExp(e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),t?"gi":"g"):e.global||(e=new RegExp(e.source,e.ignoreCase?"gi":"g")),{token:function(t){e.lastIndex=t.pos;var n=e.exec(t.string);if(n&&n.index==t.pos)return t.pos+=n[0].length||1,"searching";n?t.pos=n.index:t.skipToEnd()}}}(t.query,r(t.query)),e.addOverlay(t.overlay),e.showMatchesOnScrollbar&&(t.annotate&&(t.annotate.clear(),t.annotate=null),t.annotate=e.showMatchesOnScrollbar(t.query,r(t.query)))}function c(t,r,o,a){var s=n(t);if(s.query)return d(t,r);var c=t.getSelection()||s.lastQuery;if(c instanceof RegExp&&"x^"==c.source&&(c=null),o&&t.openDialog){var f=null,h=function(n,r){e.e_stop(r),n&&(n!=s.queryText&&(u(t,s,n),s.posFrom=s.posTo=t.getCursor()),f&&(f.style.opacity=1),d(t,r.shiftKey,function(e,n){var r;n.line<3&&document.querySelector&&(r=t.display.wrapper.querySelector(".CodeMirror-dialog"))&&r.getBoundingClientRect().bottom-4>t.cursorCoords(n,"window").top&&((f=r).style.opacity=.4)}))};!function(e,t,n,r,o){e.openDialog(t,r,{value:n,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){p(e)},onKeyDown:o})}(t,l,c,h,function(r,o){var i=e.keyName(r),a=t.getOption("extraKeys"),s=a&&a[i]||e.keyMap[t.getOption("keyMap")][i];"findNext"==s||"findPrev"==s||"findPersistentNext"==s||"findPersistentPrev"==s?(e.e_stop(r),u(t,n(t),o),t.execCommand(s)):"find"!=s&&"findPersistent"!=s||(e.e_stop(r),h(o,r))}),a&&c&&(u(t,s,c),d(t,r))}else i(t,l,"Search for:",c,function(e){e&&!s.query&&t.operation(function(){u(t,s,e),s.posFrom=s.posTo=t.getCursor(),d(t,r)})})}function d(t,r,i){t.operation(function(){var a=n(t),s=o(t,a.query,r?a.posFrom:a.posTo);(s.find(r)||(s=o(t,a.query,r?e.Pos(t.lastLine()):e.Pos(t.firstLine(),0))).find(r))&&(t.setSelection(s.from(),s.to()),t.scrollIntoView({from:s.from(),to:s.to()},20),a.posFrom=s.from(),a.posTo=s.to(),i&&i(s.from(),s.to()))})}function p(e){e.operation(function(){var t=n(e);t.lastQuery=t.query,t.query&&(t.query=t.queryText=null,e.removeOverlay(t.overlay),t.annotate&&(t.annotate.clear(),t.annotate=null))})}var f=' <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>',h='<span class="CodeMirror-search-label">With:</span> <input type="text" style="width: 10em" class="CodeMirror-search-field"/>',g='<span class="CodeMirror-search-label">Replace?</span> <button>Yes</button> <button>No</button> <button>All</button> <button>Stop</button>';function m(e,t,n){e.operation(function(){for(var r=o(e,t);r.findNext();)if("string"!=typeof t){var i=e.getRange(r.from(),r.to()).match(t);r.replace(n.replace(/\$(\d)/g,function(e,t){return i[t]}))}else r.replace(n)})}function v(e,t){if(!e.getOption("readOnly")){var r=e.getSelection()||n(e).lastQuery,l='<span class="CodeMirror-search-label">'+(t?"Replace all:":"Replace:")+"</span>";i(e,l+f,l,r,function(n){n&&(n=s(n),i(e,h,"Replace with:","",function(r){if(r=a(r),t)m(e,n,r);else{p(e);var i=o(e,n,e.getCursor("from")),s=function(){var t,a=i.from();!(t=i.findNext())&&(i=o(e,n),!(t=i.findNext())||a&&i.from().line==a.line&&i.from().ch==a.ch)||(e.setSelection(i.from(),i.to()),e.scrollIntoView({from:i.from(),to:i.to()}),function(e,t,n,r){e.openConfirm?e.openConfirm(t,r):confirm(n)&&r[0]()}(e,g,"Replace?",[function(){l(t)},s,function(){m(e,n,r)}]))},l=function(e){i.replace("string"==typeof n?r:r.replace(/\$(\d)/g,function(t,n){return e[n]})),s()};s()}}))})}}e.commands.find=function(e){p(e),c(e)},e.commands.findPersistent=function(e){p(e),c(e,!1,!0)},e.commands.findPersistentNext=function(e){c(e,!1,!0,!0)},e.commands.findPersistentPrev=function(e){c(e,!0,!0,!0)},e.commands.findNext=c,e.commands.findPrev=function(e){c(e,!0)},e.commands.clearSearch=p,e.commands.replace=v,e.commands.replaceAll=function(e){v(e,!0)}}(n(1047),n(1070),n(1091))},function(e,t,n){n(1047).defineExtension("colorpicker",function(){var e,t,n,r,o,i,a,s,l,u,c,d,p,f,h,g,m,v,b,y,_,k,w,C,S,E,O,T,x,M,D,P,N,L=function(){return window.top||window},F={trim:function(e){return e.replace(/^\s+|\s+$/g,"")},format:function(e,t){if("hex"==t){var n=e.r.toString(16);e.r<16&&(n="0"+n);var r=e.g.toString(16);e.g<16&&(r="0"+r);var o=e.b.toString(16);return e.b<16&&(o="0"+o),"#"+[n,r,o].join("")}return"rgb"==t?void 0===e.a?"rgb("+[e.r,e.g,e.b].join(",")+")":"rgba("+[e.r,e.g,e.b,e.a].join(",")+")":"hsl"==t?void 0===e.a?"hsl("+[e.h,e.s+"%",e.l+"%"].join(",")+")":"hsla("+[e.h,e.s+"%",e.l+"%",e.a].join(",")+")":e},parse:function(e){if("string"==typeof e){if(e.indexOf("rgb(")>-1){for(var t=e.replace("rgb(","").replace(")","").split(","),n=0,r=t.length;n<r;n++)t[n]=parseInt(F.trim(t[n]),10);return{type:"rgb",r:t[0],g:t[1],b:t[2],a:1}}if(e.indexOf("rgba(")>-1){for(var t=e.replace("rgba(","").replace(")","").split(","),n=0,r=t.length;n<r;n++)t[n]=r-1==n?parseFloat(F.trim(t[n])):parseInt(F.trim(t[n]),10);return{type:"rgb",r:t[0],g:t[1],b:t[2],a:t[3]}}if(e.indexOf("hsl(")>-1){for(var t=e.replace("hsl(","").replace(")","").split(","),n=0,r=t.length;n<r;n++)t[n]=parseInt(F.trim(t[n]),10);var o={type:"hsl",h:t[0],s:t[1],l:t[2],a:1},i=F.HSLtoRGB(o.h,o.s,o.l);return o.r=i.r,o.g=i.g,o.b=i.b,o}if(e.indexOf("hsla(")>-1){for(var t=e.replace("hsla(","").replace(")","").split(","),n=0,r=t.length;n<r;n++)t[n]=r-1==n?parseFloat(F.trim(t[n])):parseInt(F.trim(t[n]),10);var o={type:"hsl",h:t[0],s:t[1],l:t[2],a:t[3]},i=F.HSLtoRGB(o.h,o.s,o.l);return o.r=i.r,o.g=i.g,o.b=i.b,o}if(0==e.indexOf("#")){e=e.replace("#","");var t=[];if(3==e.length)for(var n=0,r=e.length;n<r;n++){var a=e.substr(n,1);t.push(parseInt(a+a,16))}else for(var n=0,r=e.length;n<r;n+=2)t.push(parseInt(e.substr(n,2),16));return{type:"hex",r:t[0],g:t[1],b:t[2],a:1}}}return e},HSVtoRGB:function(e,t,n){360==e&&(e=0);var r=t*n,o=r*(1-Math.abs(e/60%2-1)),i=n-r,a=[];return 0<=e&&e<60?a=[r,o,0]:60<=e&&e<120?a=[o,r,0]:120<=e&&e<180?a=[0,r,o]:180<=e&&e<240?a=[0,o,r]:240<=e&&e<300?a=[o,0,r]:300<=e&&e<360&&(a=[r,0,o]),{r:Math.ceil(255*(a[0]+i)),g:Math.ceil(255*(a[1]+i)),b:Math.ceil(255*(a[2]+i))}},RGBtoHSV:function(e,t,n){var r=e/255,o=t/255,i=n/255,a=Math.max(r,o,i),s=Math.min(r,o,i),l=a-s,u=0;0==l?u=0:a==r?u=(o-i)/l%6*60:a==o?u=60*((i-r)/l+2):a==i&&(u=60*((r-o)/l+4)),u<0&&(u=360+u);var c=a;return{h:u,s:0==a?0:l/a,v:c}},RGBtoHSL:function(e,t,n){e/=255,t/=255,n/=255;var r,o,i=Math.max(e,t,n),a=Math.min(e,t,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 e:r=(t-n)/l+(t<n?6:0);break;case t:r=(n-e)/l+2;break;case n:r=(e-t)/l+4}r/=6}return{h:Math.round(360*r),s:Math.round(100*o),l:Math.round(100*s)}},HUEtoRGB:function(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e},HSLtoRGB:function(e,t,n){var r,o,i;if(e/=360,n/=100,0==(t/=100))r=o=i=n;else{var a=n<.5?n*(1+t):n+t-n*t,s=2*n-a;r=this.HUEtoRGB(s,a,e+1/3),o=this.HUEtoRGB(s,a,e),i=this.HUEtoRGB(s,a,e-1/3)}return{r:255*r,g:255*o,b:255*i}}},A=[{rgb:"#ff0000",start:0},{rgb:"#ffff00",start:.17},{rgb:"#00ff00",start:.33},{rgb:"#00ffff",start:.5},{rgb:"#0000ff",start:.67},{rgb:"#ff00ff",start:.83},{rgb:"#ff0000",start:1}],j=(function(){for(var e=["","-o-","-ms-","-moz-","-webkit-"],t=L().document.createElement("div"),n=0;n<e.length;n++)t.style.background=e[n]+"linear-gradient(#000000, #ffffff)",t.style.background;t=null,delete t}(),function(){}),I=0,R={},B=!1,H=!1,W=2e3;function V(e,t,n){if("string"!=typeof e)this.el=e;else{var r=L().document.createElement(e);for(var o in this.uniqId=I++,r.className=t,n=n||{})r.setAttribute(o,n[o]);this.el=r}}function G(){return F.HSVtoRGB(_,k,w)}function U(){var e=F.HSVtoRGB(_,k,w);return F.RGBtoHSL(e.r,e.g,e.b)}function z(e){if("rgb"==(e=e||"hex")){var t=G();return t.a=1==y?void 0:y,F.format(t,"rgb")}if("hsl"==e){var n=U();return n.a=1==y?void 0:y,F.format(n,"hsl")}var t=G();return F.format(t,"hex")}function q(){var e,t,n,r,o,i,a=v.data("format")||"hex",s=null;if("hex"==a)C.val(F.format(G(),"hex"));else if("rgb"==a){var s=G();r=s.r,o=s.g,i=s.b,S.val(r),E.val(o),O.val(i),T.val(y)}else if("hsl"==a){var l=U();e=l.h,t=l.s,n=l.l,x.val(e),M.val(t+"%"),D.val(n+"%"),P.val(y)}!function(e){c.css("background-color",e)}(z("rgb"));var s=G(),u=F.format(s,"rgb");!function(e){var t=F.parse(e);t.a=0;var n=F.format(t,"rgb");t.a=1;var r=F.format(t,"rgb");h.css("background","linear-gradient(to right, "+n+", "+r+")")}(u),"function"==typeof j&&(isNaN(y)||j(z(a)))}function K(e){e.preventDefault();var n=t.position(),o=r.width(),i=r.height(),s=e.clientX-n.left,l=e.clientY-n.top;s<0?s=0:s>o&&(s=o),l<0?l=0:l>i&&(l=i),a.css({left:s-5+"px",top:l-5+"px"}),a.data("pos",{x:s,y:l}),Q(),q()}function $(e){for(var t,n,r=0;r<A.length;r++)if(A[r].start>=e){t=A[r-1],n=A[r];break}return t&&n?function(e,t,n){var r={r:parseInt(e.r+(t.r-e.r)*n,10),g:parseInt(e.g+(t.g-e.g)*n,10),b:parseInt(e.b+(t.b-e.b)*n,10)};return F.format(r,"hex")}(t,n,(e-t.start)/(n.start-t.start)):A[0].rgb}function X(e){r.css("background-color",e)}function Y(e){var t,n=d.offset().left,r=n+d.width(),o=e?Z(e).clientX:n+_/360*(r-n);t=o<n?0:o>r?100:(o-n)/(r-n)*100;var i=d.width()*(t/100);s.css({left:i-Math.ceil(s.width()/2)+"px"}),s.data("pos",{x:i});var a=$(t/100);X(a),_=t/100*360,q()}function J(e){var t,n=f.offset().left,r=n+f.width(),o=Z(e).clientX;t=o<n?0:o>r?100:(o-n)/(r-n)*100;var i,a,s,l=f.width()*(t/100);m.css({left:l-Math.ceil(m.width()/2)+"px"}),m.data("pos",{x:l}),i=m.data("pos")||{x:0},a=Math.round(i.x/f.width()*100)/100,y=isNaN(a)?1:a,s=v.data("format")||"hex",y<1&&"hex"==s&&(v.removeClass(s),v.addClass("rgb"),v.data("format","rgb"),q()),q()}function Q(){var e=a.data("pos")||{x:0,y:0},t=s.data("pos")||{x:0},n=r.width(),o=r.height(),i=t.x/d.width()*360,l=e.x/n,u=(o-e.y)/o;0==n&&(i=0,l=0,u=0),_=i,k=l,w=u}function Z(e){return e.touches&&e.touches[0]?e.touches[0]:e}function ee(e){var t=e.which,n=!1;return 37!=t&&39!=t&&8!=t&&46!=t&&9!=t||(n=!0),!(!n&&(t<48||t>57))}function te(e){var t=S.val(),n=E.val(),r=O.val();""!=t&&""!=n&&""!=r&&(parseInt(t)>255?S.val(255):S.val(parseInt(t)),parseInt(n)>255?E.val(255):E.val(parseInt(n)),parseInt(r)>255?O.val(255):O.val(parseInt(r)),re(F.format({r:S.int(),g:E.int(),b:O.int()},"hex")))}function ne(e){var t;v.data("format",e),t=v.data("format")||"hex",v.removeClass("hex"),v.removeClass("rgb"),v.removeClass("hsl"),v.addClass(t)}function re(e){var t=e||"#FF0000",n=F.parse(t);ne(n.type),X(t);var o,i,l,u,c=F.RGBtoHSV(n.r,n.g,n.b);o=c.h,i=c.s,l=c.v,u=n.a,y=u,_=o,k=i,w=l,function(){var e=r.width()*k,t=r.height()*(1-w);a.css({left:e-5+"px",top:t-5+"px"}),a.data("pos",{x:e,y:t});var n=d.width()*(_/360);s.css({left:n-7.5+"px"}),s.data("pos",{x:n});var o=f.width()*(y||0);m.css({left:o-7.5+"px"}),m.data("pos",{x:o})}(),Y(),q()}function oe(e,t,n){e.addEventListener(t,n)}function ie(e,t,n){e.removeEventListener(t,n)}function ae(e){r.data("isDown",!0),K(e)}function se(e){r.data("isDown",!1)}function le(e){e.preventDefault(),n.data("isDown",!0)}function ue(e){e.preventDefault(),p.data("isDown",!0)}function ce(e){n.data("isDown",!0),Y(e)}function de(e){p.data("isDown",!0),J(e)}function pe(e){if(e.which<65||e.which>70)return ee(e)}function fe(e){var t=C.val();"#"==t.charAt(0)&&7==t.length&&re(t)}function he(e){var t,n;t=v.data("format")||"hex",n="hex","hex"==t?n="rgb":"rgb"==t?n="hsl":"hsl"==t&&(n=1==y?"hex":"rgb"),v.removeClass(t),v.addClass(n),v.data("format",n),q()}function ge(e){r.data("isDown",!1),n.data("isDown",!1),p.data("isDown",!1),"HTML"==e.target.nodeName||0==function(e){var t=new V(e).closest("codemirror-colorview"),n=new V(e).closest("codemirror-colorpicker"),r=new V(e).closest("CodeMirror");return e.nodeName,!!(n||t||r)}(e.target)&&ye()}function me(e){r.data("isDown")&&K(e),n.data("isDown")&&Y(e),p.data("isDown")&&J(e)}function ve(){ie(r.el,"mousedown",ae),ie(r.el,"mouseup",se),ie(s.el,"mousedown",le),ie(m.el,"mousedown",ue),ie(d.el,"mousedown",ce),ie(f.el,"mousedown",de),ie(C.el,"keydown",pe),ie(C.el,"keyup",fe),ie(S.el,"keydown",ee),ie(S.el,"keyup",te),ie(E.el,"keydown",ee),ie(E.el,"keyup",te),ie(O.el,"keydown",ee),ie(O.el,"keyup",te),ie(L().document,"mouseup",ge),ie(L().document,"mousemove",me),ie(g.el,"click",he),j=void 0}function be(e){var t=new V("div","information-item "+e);if("hex"==e){var n=new V("div","input-field hex");C=new V("input","input",{type:"text"}),n.append(C),n.append(new V("div","title").html("HEX")),t.append(n)}else if("rgb"==e){var n=new V("div","input-field rgb-r");S=new V("input","input",{type:"text"}),n.append(S),n.append(new V("div","title").html("R")),t.append(n),n=new V("div","input-field rgb-g"),E=new V("input","input",{type:"text"}),n.append(E),n.append(new V("div","title").html("G")),t.append(n),n=new V("div","input-field rgb-b"),O=new V("input","input",{type:"text"}),n.append(O),n.append(new V("div","title").html("B")),t.append(n),n=new V("div","input-field rgb-a"),T=new V("input","input",{type:"text"}),n.append(T),n.append(new V("div","title").html("A")),t.append(n)}else if("hsl"==e){var n=new V("div","input-field hsl-h");x=new V("input","input",{type:"text"}),n.append(x),n.append(new V("div","title").html("H")),t.append(n),n=new V("div","input-field hsl-s"),M=new V("input","input",{type:"text"}),n.append(M),n.append(new V("div","title").html("S")),t.append(n),n=new V("div","input-field hsl-l"),D=new V("input","input",{type:"text"}),n.append(D),n.append(new V("div","title").html("L")),t.append(n),n=new V("div","input-field hsl-a"),P=new V("input","input",{type:"text"}),n.append(P),n.append(new V("div","title").html("A")),t.append(n)}return t}function ye(){B&&(ve(),t.hide(),t.remove(),B=!1)}return V.prototype.closest=function(e){for(var t=this,n=!1;!(n=t.hasClass(e));){if(!t.el.parentNode)return null;t=new V(t.el.parentNode)}return n?t:null},V.prototype.removeClass=function(e){this.el.className=F.trim((" "+this.el.className+" ").replace(" "+e+" "," "))},V.prototype.hasClass=function(e){if(this.el.className){var t=" "+this.el.className+" ";return t.indexOf(" "+e+" ")>-1}return!1},V.prototype.addClass=function(e){this.hasClass(e)||(this.el.className=this.el.className+" "+e)},V.prototype.html=function(e){return this.el.innerHTML=e,this},V.prototype.empty=function(){return this.html("")},V.prototype.append=function(e){return"string"==typeof e?this.el.appendChild(L().document.createTextNode(e)):this.el.appendChild(e.el||e),this},V.prototype.appendTo=function(e){var t=e.el?e.el:e;return t.appendChild(this.el),this},V.prototype.remove=function(){return this.el.parentNode&&this.el.parentNode.removeChild(this.el),this},V.prototype.text=function(){return this.el.textContent},V.prototype.css=function(e,t){if(2==arguments.length)this.el.style[e]=t;else if(1==arguments.length){if("string"==typeof e)return getComputedStyle(this.el)[e];var n=e||{};for(var r in n)this.el.style[r]=n[r]}return this},V.prototype.offset=function(){var e=this.el.getBoundingClientRect();return{top:e.top+L().document.body.scrollTop,left:e.left+L().document.body.scrollLeft}},V.prototype.position=function(){return{top:parseFloat(this.el.style.top),left:parseFloat(this.el.style.left)}},V.prototype.width=function(){return this.el.offsetWidth},V.prototype.height=function(){return this.el.offsetHeight},V.prototype.dataKey=function(e){return this.uniqId+"."+e},V.prototype.data=function(e,t){if(2!=arguments.length){if(1==arguments.length)return R[this.dataKey(e)];var n=Object.keys(R),r=this.uniqId+".";return n.filter(function(e){return 0==e.indexOf(r)}).map(function(e){return R[e]})}return R[this.dataKey(e)]=t,this},V.prototype.val=function(e){return 0==arguments.length?this.el.value:(1==arguments.length&&(this.el.value=e),this)},V.prototype.int=function(){return parseInt(this.val(),10)},V.prototype.show=function(){return this.css("display","block")},V.prototype.hide=function(){return this.css("display","none")},e=new V(L().document.body),t=new V("div","codemirror-colorpicker"),r=new V("div","color"),a=new V("div","drag-pointer"),o=new V("div","value"),i=new V("div","saturation"),l=new V("div","control"),u=new V("div","empty"),c=new V("div","color"),n=new V("div","hue"),d=new V("div","hue-container"),s=new V("div","drag-bar"),p=new V("div","opacity"),f=new V("div","opacity-container"),h=new V("div","color-bar"),m=new V("div","drag-bar2"),v=new V("div","information hex"),b=new V("div","information-change"),g=new V("button","format-change-button",{type:"button"}).html("\u2194"),b.append(g),v.append(be("hex")),v.append(be("rgb")),v.append(be("hsl")),v.append(b),o.append(a),i.append(o),r.append(i),d.append(s),n.append(d),f.append(h),f.append(m),p.append(f),l.append(n),l.append(p),l.append(u),l.append(c),t.append(r),t.append(l),t.append(v),function(){for(var e=0,t=A.length;e<t;e++){var n=A[e],r=F.parse(n.rgb);n.r=r.r,n.g=r.g,n.b=r.b}}(),re(),{isShortCut:function(){return H},$root:t,show:function(n,o,i){var a;ve(),oe(r.el,"mousedown",ae),oe(r.el,"mouseup",se),oe(s.el,"mousedown",le),oe(m.el,"mousedown",ue),oe(d.el,"mousedown",ce),oe(f.el,"mousedown",de),oe(C.el,"keydown",pe),oe(C.el,"keyup",fe),oe(S.el,"keydown",ee),oe(S.el,"keyup",te),oe(E.el,"keydown",ee),oe(E.el,"keyup",te),oe(O.el,"keydown",ee),oe(O.el,"keyup",te),oe(L().document,"mouseup",ge),oe(L().document,"mousemove",me),oe(g.el,"click",he),t.appendTo(L().document.body),t.css({position:"fixed",left:"-10000px",top:"-10000px"}),t.show(),function(n){var r=t.width(),o=t.height(),i=n.left-e.el.scrollLeft;r+i>window.innerWidth&&(i-=r+i-window.innerWidth),i<0&&(i=0);var a=n.top-e.el.scrollTop;o+a>window.innerHeight&&(a-=o+a-window.innerHeight),a<0&&(a=0),t.css({left:i+"px",top:a+"px"})}(n),B=!0,H=n.isShortCut||!1,re(o),j=function(e){i(e)},(W=n.hideDelay||2e3)>0&&(a=(a=W)||0,ie(t.el,"mouseenter"),ie(t.el,"mouseleave"),oe(t.el,"mouseenter",function(){clearTimeout(N)}),oe(t.el,"mouseleave",function(){clearTimeout(N),N=setTimeout(ye,a)}),clearTimeout(N),N=setTimeout(ye,a))},hide:ye,setColor:function(e){if("object"==typeof e){if(!e.r||!e.g||!e.b)return;re(F.format(e,"hex"))}else if("string"==typeof e){if("#"!=e.charAt(0))return;re(e)}},getColor:function(e){Q();var t=G();return e?F.format(t,e):t}}})},function(e,t,n){!function(e){"use strict";var t=function(){return window.top||window},n={aliceblue:"rgb(240, 248, 255)",antiquewhite:"rgb(250, 235, 215)",aqua:"rgb(0, 255, 255)",aquamarine:"rgb(127, 255, 212)",azure:"rgb(240, 255, 255)",beige:"rgb(245, 245, 220)",bisque:"rgb(255, 228, 196)",black:"rgb(0, 0, 0)",blanchedalmond:"rgb(255, 235, 205)",blue:"rgb(0, 0, 255)",blueviolet:"rgb(138, 43, 226)",brown:"rgb(165, 42, 42)",burlywood:"rgb(222, 184, 135)",cadetblue:"rgb(95, 158, 160)",chartreuse:"rgb(127, 255, 0)",chocolate:"rgb(210, 105, 30)",coral:"rgb(255, 127, 80)",cornflowerblue:"rgb(100, 149, 237)",cornsilk:"rgb(255, 248, 220)",crimson:"rgb(237, 20, 61)",cyan:"rgb(0, 255, 255)",darkblue:"rgb(0, 0, 139)",darkcyan:"rgb(0, 139, 139)",darkgoldenrod:"rgb(184, 134, 11)",darkgray:"rgb(169, 169, 169)",darkgrey:"rgb(169, 169, 169)",darkgreen:"rgb(0, 100, 0)",darkkhaki:"rgb(189, 183, 107)",darkmagenta:"rgb(139, 0, 139)",darkolivegreen:"rgb(85, 107, 47)",darkorange:"rgb(255, 140, 0)",darkorchid:"rgb(153, 50, 204)",darkred:"rgb(139, 0, 0)",darksalmon:"rgb(233, 150, 122)",darkseagreen:"rgb(143, 188, 143)",darkslateblue:"rgb(72, 61, 139)",darkslategray:"rgb(47, 79, 79)",darkslategrey:"rgb(47, 79, 79)",darkturquoise:"rgb(0, 206, 209)",darkviolet:"rgb(148, 0, 211)",deeppink:"rgb(255, 20, 147)",deepskyblue:"rgb(0, 191, 255)",dimgray:"rgb(105, 105, 105)",dimgrey:"rgb(105, 105, 105)",dodgerblue:"rgb(30, 144, 255)",firebrick:"rgb(178, 34, 34)",floralwhite:"rgb(255, 250, 240)",forestgreen:"rgb(34, 139, 34)",fuchsia:"rgb(255, 0, 255)",gainsboro:"rgb(220, 220, 220)",ghostwhite:"rgb(248, 248, 255)",gold:"rgb(255, 215, 0)",goldenrod:"rgb(218, 165, 32)",gray:"rgb(128, 128, 128)",grey:"rgb(128, 128, 128)",green:"rgb(0, 128, 0)",greenyellow:"rgb(173, 255, 47)",honeydew:"rgb(240, 255, 240)",hotpink:"rgb(255, 105, 180)",indianred:"rgb(205, 92, 92)",indigo:"rgb(75, 0, 130)",ivory:"rgb(255, 255, 240)",khaki:"rgb(240, 230, 140)",lavender:"rgb(230, 230, 250)",lavenderblush:"rgb(255, 240, 245)",lawngreen:"rgb(124, 252, 0)",lemonchiffon:"rgb(255, 250, 205)",lightblue:"rgb(173, 216, 230)",lightcoral:"rgb(240, 128, 128)",lightcyan:"rgb(224, 255, 255)",lightgoldenrodyellow:"rgb(250, 250, 210)",lightgreen:"rgb(144, 238, 144)",lightgray:"rgb(211, 211, 211)",lightgrey:"rgb(211, 211, 211)",lightpink:"rgb(255, 182, 193)",lightsalmon:"rgb(255, 160, 122)",lightseagreen:"rgb(32, 178, 170)",lightskyblue:"rgb(135, 206, 250)",lightslategray:"rgb(119, 136, 153)",lightslategrey:"rgb(119, 136, 153)",lightsteelblue:"rgb(176, 196, 222)",lightyellow:"rgb(255, 255, 224)",lime:"rgb(0, 255, 0)",limegreen:"rgb(50, 205, 50)",linen:"rgb(250, 240, 230)",magenta:"rgb(255, 0, 255)",maroon:"rgb(128, 0, 0)",mediumaquamarine:"rgb(102, 205, 170)",mediumblue:"rgb(0, 0, 205)",mediumorchid:"rgb(186, 85, 211)",mediumpurple:"rgb(147, 112, 219)",mediumseagreen:"rgb(60, 179, 113)",mediumslateblue:"rgb(123, 104, 238)",mediumspringgreen:"rgb(0, 250, 154)",mediumturquoise:"rgb(72, 209, 204)",mediumvioletred:"rgb(199, 21, 133)",midnightblue:"rgb(25, 25, 112)",mintcream:"rgb(245, 255, 250)",mistyrose:"rgb(255, 228, 225)",moccasin:"rgb(255, 228, 181)",navajowhite:"rgb(255, 222, 173)",navy:"rgb(0, 0, 128)",oldlace:"rgb(253, 245, 230)",olive:"rgb(128, 128, 0)",olivedrab:"rgb(107, 142, 35)",orange:"rgb(255, 165, 0)",orangered:"rgb(255, 69, 0)",orchid:"rgb(218, 112, 214)",palegoldenrod:"rgb(238, 232, 170)",palegreen:"rgb(152, 251, 152)",paleturquoise:"rgb(175, 238, 238)",palevioletred:"rgb(219, 112, 147)",papayawhip:"rgb(255, 239, 213)",peachpuff:"rgb(255, 218, 185)",peru:"rgb(205, 133, 63)",pink:"rgb(255, 192, 203)",plum:"rgb(221, 160, 221)",powderblue:"rgb(176, 224, 230)",purple:"rgb(128, 0, 128)",rebeccapurple:"rgb(102, 51, 153)",red:"rgb(255, 0, 0)",rosybrown:"rgb(188, 143, 143)",royalblue:"rgb(65, 105, 225)",saddlebrown:"rgb(139, 69, 19)",salmon:"rgb(250, 128, 114)",sandybrown:"rgb(244, 164, 96)",seagreen:"rgb(46, 139, 87)",seashell:"rgb(255, 245, 238)",sienna:"rgb(160, 82, 45)",silver:"rgb(192, 192, 192)",skyblue:"rgb(135, 206, 235)",slateblue:"rgb(106, 90, 205)",slategray:"rgb(112, 128, 144)",slategrey:"rgb(112, 128, 144)",snow:"rgb(255, 250, 250)",springgreen:"rgb(0, 255, 127)",steelblue:"rgb(70, 130, 180)",tan:"rgb(210, 180, 140)",teal:"rgb(0, 128, 128)",thistle:"rgb(216, 191, 216)",tomato:"rgb(255, 99, 71)",turquoise:"rgb(64, 224, 208)",violet:"rgb(238, 130, 238)",wheat:"rgb(245, 222, 179)",white:"rgb(255, 255, 255)",whitesmoke:"rgb(245, 245, 245)",yellow:"rgb(255, 255, 0)",yellowgreen:"rgb(154, 205, 50)",transparent:"rgba(0, 0, 0, 0)"},r=["comment"];function o(e,t){"setValue"==t.origin?(e.state.colorpicker.close_color_picker(),e.state.colorpicker.init_color_update(),e.state.colorpicker.style_color_update()):e.state.colorpicker.style_color_update(e.getCursor().line)}function i(e,t){e.state.colorpicker.isUpdate||(e.state.colorpicker.isUpdate=!0,e.state.colorpicker.close_color_picker(),e.state.colorpicker.init_color_update(),e.state.colorpicker.style_color_update())}function a(e,t){o(e,{origin:"setValue"})}function s(e,t){e.state.colorpicker.keyup(t)}function l(e,t){e.state.colorpicker.is_edit_mode()&&e.state.colorpicker.check_mousedown(t)}function u(e,t){o(e,{origin:"setValue"})}function c(e){e.state.colorpicker.close_color_picker()}function d(e,t){t="boolean"==typeof t?{mode:"view"}:Object.assign({mode:"view"},t||{}),this.opt=t,this.cm=e,this.markers={},r=this.opt.excluded_token||r,this.cm.colorpicker?this.colorpicker=this.cm.colorpicker():this.opt.colorpicker&&(this.colorpicker=this.opt.colorpicker),this.init_event()}e.defineOption("colorpicker",!1,function(t,n,r){r&&r!=e.Init&&t.state.colorpicker&&(t.state.colorpicker.destroy(),t.state.colorpicker=null),n&&(t.state.colorpicker=new d(t,n))}),d.prototype.init_event=function(){var e,t;this.cm.on("mousedown",l),this.cm.on("keyup",s),this.cm.on("change",o),this.cm.on("update",i),this.cm.on("refresh",a),this.onPasteCallback=(e=this.cm,t=u,function(n){t.call(this,e,n)}),this.cm.getWrapperElement().addEventListener("paste",this.onPasteCallback),this.is_edit_mode()&&this.cm.on("scroll",function(e,t){var n=void 0;return function(r,o){n&&clearTimeout(n),n=setTimeout(function(){e(r,o)},t||300)}}(c,50))},d.prototype.is_edit_mode=function(){return"edit"==this.opt.mode},d.prototype.is_view_mode=function(){return"view"==this.opt.mode},d.prototype.destroy=function(){this.cm.off("mousedown",l),this.cm.off("keyup",s),this.cm.off("change",o),this.cm.getWrapperElement().removeEventListener("paste",this.onPasteCallback),this.is_edit_mode()&&this.cm.off("scroll")},d.prototype.hasClass=function(e,t){if(e.className){var n=" "+e.className+" ";return n.indexOf(" "+t+" ")>-1}return!1},d.prototype.check_mousedown=function(e){this.hasClass(e.target,"codemirror-colorview-background")?this.open_color_picker(e.target.parentNode):this.close_color_picker()},d.prototype.popup_color_picker=function(e){var t=this.cm.getCursor(),n=this,r={lineNo:t.line,ch:t.ch,color:e||"#FFFFFF",isShortCut:!0};Object.keys(this.markers).forEach(function(e){var t="#"+e;if(t.indexOf("#"+r.lineNo+":")>-1){var o=n.markers[e];o.ch<=r.ch&&r.ch<=o.ch+o.color.length&&(r.ch=o.ch,r.color=o.color,r.nameColor=o.nameColor)}}),this.open_color_picker(r)},d.prototype.open_color_picker=function(e){var t=e.lineNo,n=e.ch,r=e.nameColor,o=e.color;if(this.colorpicker){var i=this,a=o,s=this.cm.charCoords({line:t,ch:n});this.colorpicker.show({left:s.left,top:s.bottom,isShortCut:e.isShortCut||!1,hideDelay:i.opt.hideDelay||2e3},r||o,function(e){i.cm.replaceRange(e,{line:t,ch:n},{line:t,ch:n+a.length},"*colorpicker"),a=e})}},d.prototype.close_color_picker=function(e){this.colorpicker&&this.colorpicker.hide()},d.prototype.key=function(e,t){return[e,t].join(":")},d.prototype.keyup=function(e){this.colorpicker&&("Escape"==e.key?this.colorpicker.hide():0==this.colorpicker.isShortCut()&&this.colorpicker.hide())},d.prototype.init_color_update=function(){this.markers={}},d.prototype.style_color_update=function(e){if(e)this.match(e);else for(var t=this.cm.lineCount(),n=0;n<t;n++)this.match(n)},d.prototype.empty_marker=function(e,t){for(var n=t.markedSpans||[],r=0,o=n.length;r<o;r++){var i=this.key(e,n[r].from);i&&(a=n[r].marker.replacedWith,s="codemirror-colorview",a&&a.className&&(" "+a.className+" ").indexOf(" "+s+" ")>-1)&&(delete this.markers[i],n[r].marker.clear())}var a,s},d.prototype.color_regexp=/(#(?:[\da-f]{3}){1,2}|rgb\((?:\s*\d{1,3},\s*){2}\d{1,3}\s*\)|rgba\((?:\s*\d{1,3},\s*){3}\d*\.?\d+\s*\)|hsl\(\s*\d{1,3}(?:,\s*\d{1,3}%){2}\s*\)|hsla\(\s*\d{1,3}(?:,\s*\d{1,3}%){2},\s*\d*\.?\d+\s*\)|([\w_\-]+))/gi,d.prototype.match_result=function(e){return e.text.match(this.color_regexp)},d.prototype.submatch=function(e,t){this.empty_marker(e,t);var r=this.match_result(t);if(r&&r.length)for(var o={next:0},i=0,a=r.length;i<a;i++)if(r[i].indexOf("#")>-1||r[i].indexOf("rgb")>-1||r[i].indexOf("hsl")>-1)this.render(o,e,t,r[i]);else{var s=n[r[i]];s&&this.render(o,e,t,r[i],s)}},d.prototype.match=function(e){var t=this.cm.getLineHandle(e),n=this;this.cm.operation(function(){n.submatch(e,t)})},d.prototype.make_element=function(){var e=t().document.createElement("div");return e.className="codemirror-colorview",this.is_edit_mode()?e.title="open color picker":e.title="",e.back_element=this.make_background_element(),e.appendChild(e.back_element),e},d.prototype.make_background_element=function(){var e=t().document.createElement("div");return e.className="codemirror-colorview-background",e},d.prototype.set_state=function(e,t,n,r){var o=this.create_marker(e,t);return o.lineNo=e,o.ch=t,o.color=n,o.nameColor=r,o},d.prototype.create_marker=function(e,t){var n=this.key(e,t);return this.markers[n]||(this.markers[n]=this.make_element()),this.markers[n]},d.prototype.has_marker=function(e,t){var n=this.key(e,t);return!!this.markers[n]},d.prototype.update_element=function(e,t){e.back_element.style.backgroundColor=t},d.prototype.set_mark=function(e,t,n){this.cm.setBookmark({line:e,ch:t},{widget:n,handleMouseEvents:!0})},d.prototype.is_excluded_token=function(e,t){for(var n=this.cm.getTokenTypeAt({line:e,ch:t}),o=0,i=0,a=r.length;i<a;i++)if(n===r[i]){o++;break}return o>0},d.prototype.render=function(e,t,n,r,o){var i=n.text.indexOf(r,e.next);if(!0!==this.is_excluded_token(t,i)){if(e.next=i+r.length,this.has_marker(t,i))return this.update_element(this.create_marker(t,i),o||r),void this.set_state(t,i,r,o);var a=this.create_marker(t,i);this.update_element(a,o||r),this.set_state(t,i,r,o||r),this.set_mark(t,i,a)}}}(n(1047))},function(e,t,n){},function(e,t,n){"use strict";var r=n(4),o=n.n(r),i=n(7),a=n.n(i),s=n(11),l=n.n(s),u=n(508),c=n.n(u),d=n(39),p=n.n(d),f=n(764),h=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var g={"known-properties":1,"duplicate-properties":1},m={coverGutter:!1,noHScroll:!0},v=function(e){var t=e.message,n=e.line,r=e.type;return{description:t.replace(/ \w+ \w+ \d+, \w+ \d+\.$/,"."),line:n,type:r}},b=function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.mode=t,this.editor=n,this.delay=r,this.timer=0,this.lineWidgets=[],this.doLint=this.doLint.bind(this),this.removeLineWidget=this.removeLineWidget.bind(this),this.showErrors=this.showErrors.bind(this),this.showError=this.showError.bind(this)}return h(e,[{key:"lint",value:function(e){clearTimeout(this.timer);var t=o()(e)?this.delay:e;0===t?this.doLint():this.timer=setTimeout(this.doLint,t)}},{key:"doLint",value:function(){this.editor&&this.editor.operation(this.showErrors)}},{key:"getErrors",value:function(){var e=this.editor.getValue(),t=void 0;switch(this.mode.name){case"css":var n=this.mode.inline?"p {"+e+"}":e,r=f.CSSLint.verify(n,g).messages;t=c()(r,p.a).map(v);break;default:t=[]}return t}},{key:"removeLineWidget",value:function(e){this.editor.removeLineWidget(e)}},{key:"showError",value:function(e){var t=this.editor,n=e.description,r=e.line,o=e.type,i=document.createElement("div");return i.appendChild(document.createTextNode(""+n)),i.className="codemirror-lint-"+o,t.addLineWidget(r-1,i,m)}},{key:"showErrors",value:function(){a()(this.lineWidgets)||l()(this.lineWidgets,this.removeLineWidget);var e=this.getErrors();a()(e)?this.lineWidgets=[]:this.lineWidgets=e.map(this.showError)}},{key:"destroy",value:function(){clearTimeout(this.timer),this.editor=!1}}]),e}();t.a=b},function(e,t,n){},function(e,t,n){"use strict";(function(e){var r=n(1),o=n.n(r),i=(n(6),n(18)),a=n.n(i),s=n(54),l=n(2),u=n.n(l),c=n(36),d=n.n(c),p=n(71),f=n.n(p),h=n(39),g=n.n(h),m=n(9),v=n.n(m),b=n(451),y=n.n(b),_=(n(57),n(4)),k=n.n(_),w=n(33),C=(n(1188),function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}());var S=function(t){function n(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this));return e.state={activeOption:[]},e._onChange=e._onChange.bind(e),e.switchButton=e.switchButton.bind(e),e.getProcessedValue=e.getProcessedValue.bind(e),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,o.a.Component),C(n,[{key:"shouldComponentUpdate",value:function(e,t){return!g()(e,this.props)||!g()(t,this.state)}},{key:"componentDidMount",value:function(){this.setState({activeOption:this.getProcessedValue()})}},{key:"componentDidUpdate",value:function(){this.setState({activeOption:this.getProcessedValue()})}},{key:"getProcessedValue",value:function(){var e=this.props.value||this.props.default;return k()(e)||""===e?[]:e.split("|")}},{key:"switchButton",value:function(t){t.preventDefault();var n=e(t.target).closest(".et-fb-multiple-buttons-toggle").data("option_value"),r=this.state.activeOption;this.props.toggleable&&v()(this.state.activeOption,n)?r=this.props.multi_selection?y()(r,n).join("|"):this.props.default:(this.props.multi_selection&&r.push(n),r=this.props.multi_selection?r.join("|"):n),this._onChange(r)}},{key:"_onChange",value:function(e){var t=this.props,n=t.name,r=t._onChange;this.setState({activeOption:e.split("|")}),r(n,e)}},{key:"render",value:function(){var e=this,t=e.props.options,n=f()(this.props.options),r=100/n,i=r-r*(3*(n-1)/100)+"%",l=d()(t,function(t,n){var r=u()(t,"icon",!1),l=v()(e.state.activeOption,n),c=l?s.a.activeTabIcon:s.a.optionTabIcon,d=a()({"et-fb-multiple-buttons-toggle-internal":!0,"et-fb-multiple-buttons-toggle-internal__active":l}),p=r?o.a.createElement(w.a,{icon:t.icon,color:c}):t.title;return o.a.createElement("li",{className:"et-fb-multiple-buttons-toggle",style:{width:i},"data-option_value":n,onClick:e.switchButton,key:n},o.a.createElement("span",{className:d},p))});return o.a.createElement("div",{className:"et-fb-multiple-buttons-outer"},o.a.createElement("ul",{className:"et-fb-multiple-buttons-container"},l))}}]),n}();t.a=S}).call(this,n(28))},function(e,t,n){},function(e,t,n){"use strict";(function(e){var r=n(1),o=n.n(r),i=n(84),a=n.n(i),s=n(18),l=n.n(s),u=n(0),c=n(32),d=n.n(c),p=n(7),f=n.n(p),h=n(2),g=n.n(h),m=(n(1190),Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}),v=a()({displayName:"ETBuilderControlSelectFontIcon",mixins:[d.a],render:function(){var e=this,t=this.props.additional_attrs?this.props.additional_attrs:{},n="icon_down"===g()(this.props,"renderer_options.icons_list","")?ETBuilderBackend.fontIconsDown:ETBuilderBackend.fontIcons,r=this.props.value,i=!1,a=0;f()(r)||(i=-1!==r.search(/^%%/),a=parseInt(r.replace(/%/g,"")));var s=n.map(function(t,n){var s,c=u.default.processFontIcon(t);if(i){if(e.props.readonly&&n!==a)return!1;s=n===a?{active:!0}:{}}else s='"'===r?0===n?{active:!0}:{}:c===r?{active:!0}:{};return o.a.createElement("li",{className:l()(s),key:e.props.address+"-font-icon-"+n,"data-icon":c,onClick:e._onChange})});return o.a.createElement("ul",m({id:"et-fb-"+this.props.name,className:"et-fb-font-icon-list"},t),s)},_onChange:function(t){if(!this.props.readonly){var n="%%"+e(t.target).index()+"%%";this.props._onChange(this.props.name,n)}}});t.a=v}).call(this,n(28))},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";(function(e){var r=n(1),o=n.n(r),i=(n(6),n(28),n(84)),a=n.n(i),s=n(17),l=n.n(s),u=n(18),c=n.n(u),d=n(665),p=n.n(d),f=n(32),h=n.n(f),g=n(1194),m=n(0),v=n(10),b=n(45),y=n.n(b),k=n(4),w=n.n(k),C=n(11),S=n.n(C),E=n(7),O=n.n(E),T=n(52),x=n.n(T),M=n(103),D=n.n(M),P=n(138),N=n.n(P),L=n(48),F=n.n(L),A=n(2),j=n.n(A),I=n(9),R=n.n(I),B=(n(1195),Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e});var H=m.default.topWindow(),W=m.default.condition("is_bfb"),V=m.default.condition("is_rich_editor");p.a.getDefaultProps.isReactClassApproved={},m.default.topWindow().QTags=void 0,m.default.topWindow().send_to_editor=function(e){var t=void 0!==m.default.topWindow().tinymce,n=void 0!==m.default.topWindow().QTags,r=void 0;if(m.default.appWindow().wpActiveEditor)t&&(r=tinymce.get(m.default.appWindow().wpActiveEditor));else if(t&&m.default.topWindow().tinymce.activeEditor)r=m.default.topWindow().tinymce.activeEditor,m.default.appWindow().wpActiveEditor=r.id;else if(!n)return!1;if(r&&!r.isHidden()?r.execCommand("mceInsertContent",!1,e):n?QTags.insertContent(e):(m.default.topDocument().getElementById(m.default.appWindow().wpActiveEditor).value+=e,m.default.$topWindow("#"+m.default.appWindow().wpActiveEditor).focus().blur()),m.default.topWindow().tb_remove)try{m.default.topWindow().tb_remove()}catch(e){}};var G,U=a()({displayName:"ETBuilderControlTinyMCE",mixins:[h.a],getDefaultProps:(G=function(){return{onModeSwitch:F.a}},G.isReactClassApproved={},G),getInitialState:function(){var e=void 0;e="no"===V?"html":m.default.hasValue(getUserSetting("editor"))?getUserSetting("editor"):"tinymce",this.editor=null;var t=j()(this.props,"toggle_slug",""),n=j()(this.props,"name","");return this.uuid=t+"_"+n+"_vb_tiny_mce",this.processedContent=!1,this.isEditing=!1,this.isUnmounting=!1,this.updateProps=!0,{editorMode:e,content:this.props.content}},componentWillReceiveProps:function(e){if(this.isEditing)this.isEditing=!1;else{var t=e.content;if((this.processedContent?this.processContent(t):t)!==this.state.content){var n="tinymce"===this.state.editorMode;if(n){var r=m.default.appWindow().tinymce.EditorManager.get(this.uuid);x()(j()(r,"setContent"))&&(this.updateProps=!1,r.setContent(g.a.wpautop(this.processContent(t)),{format:"raw"}),this.updateProps=!0)}this.processedContent=!1,this.setState({content:n?t:this.processContent(t)})}}},switchEditorMode:function(e){var t=this;e!==this.state.editorMode&&(this.setState({editorMode:e},function(){t.props.onModeSwitch(t.state.editorMode)}),setUserSetting("editor",e))}, /* Adapted from WordPress wp-includes/js/media-editor.js: * wp.media.editor.send.attachment() function code was used in this.sendAttachment() * wp.media.editor.add() function code was used in this.addMedia() @copyright 2015 by the WordPress contributors. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA This program incorporates work covered by the following copyright and permission notices: b2 is (c) 2001, 2002 Michel Valdrighi - m@tidakada.com - http://tidakada.com b2 is released under the GPL WordPress - Web publishing software Copyright 2003-2010 by the contributors WordPress is released under the GPL */ sendAttachment:function(e,t){var n,r,o=t.caption;return H.wp.media.view.settings.captions||delete t.caption,e=H.wp.media.string.props(e,t),n={id:t.id,post_content:t.description,post_excerpt:o},e.linkUrl&&(n.url=e.linkUrl),"image"===t.type?(e.url=e.src,r=H.wp.media.string.image(e),S()({align:"align",size:"image-size",alt:"image_alt"},function(t,r){e[r]&&(n[t]=e[r])})):"video"===t.type?r=H.wp.media.string.video(e,t):"audio"===t.type?r=H.wp.media.string.audio(e,t):(r=H.wp.media.string.link(e),n.post_title=e.title),r},addMedia:function(t){t.preventDefault();var n,r=this;if(w()(n)){var o=H.wp.media.controller.Library.extend({defaults:_.defaults({id:"insert",displaySettings:!0,multiple:!0},H.wp.media.controller.Library.prototype.defaults)});(n=H.wp.media.frames.file_frame=H.wp.media({title:ETBuilderBackend.i18n.controls.insertMedia.modalTitleText,state:"insert",states:[new o],frame:"post"})).on("select",function(t){var o=n.state();if(t=t||o.get("selection"),"embed"!==o.attributes.content)t&&e.when.apply(e,t.map(function(e){var t=o.display(e).toJSON();return r.sendAttachment(t,e.toJSON())},this)).done(function(){var e=N()(arguments).join("\n\n");r.insertMedia(e)});else{var i=o.props.attributes,a=w()(i.url)?"":i.url,s="";if(""===a)return;if("image"===o.attributes.type){var l=w()(i.alt)?"":i.alt,u=w()(i.width)?"":i.width,c=w()(i.height)?"":i.height,d=w()(i.align)?"alignnone":"align"+i.align,p=w()(i.caption)?"":i.caption,f=w()(i.link)?"":i.link,h=w()(i.linkUrl)?"":i.linkUrl;if(s='<img width="'+u+'" height="'+c+'" src="'+a+'" alt="'+l+'" class="'+(""!==p?"size-medium":"size-medium "+d)+'" />',""!==f)s='<a href="'+("custom"===f?h:a)+'">'+s+"</a>";""!==p&&(s='[caption align="'+d+'" width="'+u+'" ]'+s+" "+p+"[/caption]")}else s="[embed]"+a+"[/embed]";r.insertMedia(s)}}),n.on("update",function(e){var t=w()(e.gallery)?"playlist":"gallery",n="playlist"===t?H.wp.media.playlist.shortcode(e).attrs.named:H.wp.media.gallery.shortcode(e).attrs.named,o=w()(n.ids)?"":n.ids.join(",");if(""!==o){var i="";S()(n,function(e,t){"ids"!==t&&(i+=" "+t+'="'+e+'"')});var a="["+t+' ids="'+o+'"'+i+"]";r.insertMedia(a)}}),n.open()}else n.open()},insertMedia:function(e){if(m.default.appWindow().wpActiveEditor=!1,"html"===getUserSetting("editor")){var t=m.default.$topWindow(".et-fb-tinymce-html-input:visible"),n=t.val()+e;t.val(n),this.setTextareaContent(n)}else H.wp.media.editor.insert(e)},switchToVisual:function(e){e.preventDefault(),this.switchEditorMode("tinymce")},switchToHtml:function(e){e.preventDefault(),this.switchEditorMode("html"),this.processedContent=!0,this.setState({content:this.processContent(this.state.content)})},setActiveModeClass:function(e){var t,n,r,o=(r=!0,(n="et-fb-switch-editor-mode__tab--"+e)in(t={"et-fb-switch-editor-mode__tab":!0})?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t);return e===this.state.editorMode&&(o["et-fb-switch-editor-mode__tab--active"]=!0),c()(o)},processContent:function(e){return e=e.replace(/<p>(?:<br ?\/?>|\u00a0|\uFEFF| )*<\/p>/g,"<p> </p>"),e=g.a.removep(e)},_onDoubleClick:function(e){e.stopPropagation()},_tinyMCESetup:function(e){e.settings.convert_urls=0,e.settings.remove_script_host=0},render:function(){var e=this.props.additional_attrs?this.props.additional_attrs:{},t=ETBuilderBackend.i18n.controls.tinymce,n=(this.props.className&&this.props.className,"html"===this.state.editorMode?this.state.content:g.a.wpautop(this.processContent(this.state.content))),r={entity_encoding:"raw",skin_url:ETBuilderBackend.tinymceSkinUrl,plugins:"autolink link image lists print preview autoresize textcolor table paste fullscreen charmap emoticons wpview",menubar:!1,valid_elements:"*[*]",toolbar:"formatselect,bold,italic,bullist,numlist,link,blockquote,alignleft,aligncenter,alignright,alignjustify,table,strikethrough,underline,hr,forecolor,pastetext,removeformat,outdent,indent,fullscreen,charmap,emoticons,undo,redo",content_css:ETBuilderBackend.tinymceCSSFiles,autoresize_bottom_margin:0,setup:this._tinyMCESetup};"html"===this.state.editorMode&&"<br />\n"===n&&(n=""),m.default.condition("is_bfb")&&(r=j()(m.default.topWindow(),"tinyMCEPreInit.mceInit.content",{}),w()(r.toolbar1)||(r.toolbar1=r.toolbar1.replace("dfw","fullscreen")));var i=m.default.hasValue(ETBuilderBackend.mediaButtons)?{}:{display:"none"},a="html"===this.state.editorMode?o.a.createElement("textarea",{id:this.uuid,ref:"textarea",className:"et-fb-tinymce-html-input",value:n,onChange:F.a,onInput:this._onInputHTML,onScroll:this._onTextareaScroll,onFocus:this._onFocus,onBlur:this._onBlur}):o.a.createElement(p.a,B({id:this.uuid,ref:"tinymce",content:n,config:r,onInit:this._onInit,onChange:this._onChange,onDoubleClick:this._onDoubleClick,onKeyup:this._onChange,onKeydown:this._onKeyDown,onLoadContent:this._loadtinyMCEContent,onSetContent:this._onChange,onFocus:this._onFocus,onBlur:this._onBlur},e)),s="no"!==V&&o.a.createElement("a",{href:"#",onClick:this.switchToVisual,className:this.setActiveModeClass("tinymce")},t.visual);return o.a.createElement("div",{id:"et-fb-"+this.props.name,className:"et-fb-tinymce-buttons"},o.a.createElement("button",{className:"et-fb-settings-option-upload-button et-fb-tinymce-add-media-button et-fb-tinymce-add-media-button--absolute",onClick:this.addMedia},ETBuilderBackend.i18n.controls.insertMedia.buttonText),o.a.createElement("span",{className:"et-fb-tinymce-media-buttons",id:"et-fb-tinymce-"+this.props.name+"-media-buttons",style:i,dangerouslySetInnerHTML:{__html:ETBuilderBackend.mediaButtons}}),o.a.createElement("div",{className:"et-fb-switch-editor-mode"},s,o.a.createElement("a",{href:"#",onClick:this.switchToHtml,className:this.setActiveModeClass("html")},t.text)),a)},_loadtinyMCEContent:function(e,t){O()(D()(this.state.content))||t.setContent(g.a.wpautop(this.processContent(this.state.content)),{format:"raw"})},_onKeyDown:function(e){var t=e.keyCode,n=e.metaKey,r=e.ctrlKey,o=e.altKey;x()(KeyboardEvent)&&(83!==t||!n&&!r||o||(m.default.appDocument().dispatchEvent(new KeyboardEvent("keydown",{keyCode:t,metaKey:n,ctrlKey:r,bubbles:!0,cancelable:!0})),e.preventDefault()))},_onChange:function(e,t){if(!this.isUnmounting){var n=w()(e.type)?"":e.type;if(!this.props.isItemSelected||!R()(["loadcontent","setcontent"],n)){var r=t.getContent({format:"html"}).replace(/<p>(?:<br ?\/?>|\u00a0|\uFEFF| )*<\/p>/g,"<p> </p>"),o=O()(r)?r:g.a.wpautop(r);this.setTextareaContent(o)}}},_onInit:function(e,t){this.editor=t,W&&(t.on("ExecCommand",function(e){if("mceInsertLink"===e.command){var n=t.$('a[href="_wp_link_placeholder"]')[0];n&&n.scrollIntoView&&n.scrollIntoView({block:"nearest"})}}),t.on("wp-toolbar-toggle",function(){m.default.$topWindow().trigger("wp-toolbar-toggle")}))},componentWillUnmount:function(){this.isUnmounting=!0},_onInputHTML:function(e){e.persist();var t=e.target.value;this.setTextareaContent(t)},_onTextareaScroll:function(t){var n=e(t.currentTarget).closest(".et-fb-tabs__panel");n.scrollTop()||n.scrollTop(1)},setTextareaContent:function(e){this.isEditing=!0;var t="content"===this.props.name,n=t?"content":"value";j()(this.props,n,"")!==e&&(this.updateProps&&this.props._onChange(this.props.name,e,"",t),this.processedContent=!1,this.setState({content:e}))},getFrameTargetElement:function(e){if(y()(e))return!1;var t=e.contentWindow;return w()(m.default.appWindow().pageYOffset)&&(t=t.document.documentElement?t.document.documentElement:t=document.body),t},_onFocus:function(){(this.props.module||this.props.isPageSetting)&&v.b.settingFieldFocused(this)},_onBlur:function(e){(this.props.module||this.props.isPageSetting)&&v.b.settingFieldFocused(!1),"html"===this.state.editorMode&&this._onInputHTML(e)},focus:function(){var e=this;if("html"===this.state.editorMode)m.default.$topWindow(this.refs.textarea).focus();else try{window.tinymce.EditorManager.get(this.uuid).focus()}catch(t){setTimeout(function(){return e.focus()},100)}},activateEditor:function(){"tinymce"===this.state.editorMode&&m.default.appWindow().tinyMCE.setActive(this.editor),m.default.appWindow().wpActiveEditor=this.uuid,this.focus()},componentDidUpdate:function(){var e=this;setTimeout(function(){var t=m.default.$topWindow(l.a.findDOMNode(e.refs.tinymce)).parent().find("iframe");if(0!==t.length){var n=t.height(),r=t.contents().find("html");if(r.length>0){var o=r.innerHeight();n<o&&t.height(o)}}},200)},componentDidMount:function(){var t=this;this.props.onModeSwitch(this.state.editorMode);var n=e(l.a.findDOMNode(this.refs.tinymce)).parent().find("iframe"),r=n.attr("id"),o=this.getFrameTargetElement(m.default.topWindow().document.getElementById(r));!1!==o?(m.default.condition("is_bfb")||n.contents().find("head").append("<style type='text/css'> .wpview iframe { max-width: 100% !important; } .wpview { width: auto !important; }</style>"),o.onwheel=function(e){var t,r=n.closest(".et-fb-tabs__panel--active"),o=!1,i=!1;if(t=r.find(".et-fb-form").outerHeight(),r.length>0&&(o=r.scrollTop()<1&&e.deltaY<1,i=r.scrollTop()>=t-r.height()&&e.deltaY>=0,o||i))return!1},m.default.$topWindow("#et-fb-"+this.props.name+", #et-fb-"+this.props.name+" *, .et-fb-tinymce-media-buttons a").on("click",function(){t.activateEditor()})):m.default.$topWindow(".et-fb-tinymce-media-buttons a").on("click",function(){t.activateEditor()})}});t.a=U}).call(this,n(28))},function(e,t,n){"use strict"; /** * Automatically add paragraph and break tags * * Sourced from WP-Calypso * https://github.com/Automattic/wp-calypso * * Adapted from WordPress * * @copyright 2015 by the WordPress contributors. * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * This program incorporates work covered by the following copyright and * permission notices: * * b2 is (c) 2001, 2002 Michel Valdrighi - m@tidakada.com - * http://tidakada.com * * Wherever third party code has been used, credit has been given in the code's * comments. * * b2 is released under the GPL * * and * * WordPress - Web publishing software * * Copyright 2003-2010 by the contributors * * WordPress is released under the GPL * * * @see wp-admin/js/editor.js * * @param {string} pee html string * @return {string} html string with HTML paragraphs instead of double line-breaks */t.a={wpautop:function(e){var t="table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary",n=!1,r=!1;return-1!==e.indexOf("<object")&&(e=e.replace(/<object[\s\S]+?<\/object>/g,function(e){return e.replace(/[\r\n]+/g,"")})),-1===(e=e.replace(/<[^<>]+>/g,function(e){return e.replace(/[\r\n]+/g," ")})).indexOf("<pre")&&-1===e.indexOf("<script")||(n=!0,e=e.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g,function(e){return e.replace(/(\r\n|\n)/g,"<wp-line-break>")})),-1!==e.indexOf("[caption")&&(r=!0,e=e.replace(/\[caption[\s\S]+?\[\/caption\]/g,function(e){return(e=(e=e.replace(/<br([^>]*)>/g,"<wp-temp-br$1>")).replace(/<[a-zA-Z0-9]+( [^<>]+)?>/g,function(e){return e.replace(/[\r\n\t]+/," ")})).replace(/\s*\n\s*/g,"<wp-temp-br />")})),e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e+="\n\n").replace(/<br \/>\s*<br \/>/gi,"\n\n")).replace(new RegExp("(<(?:"+t+")(?: [^>]*)?>)","gi"),"\n$1")).replace(new RegExp("(</(?:"+t+")>)","gi"),"$1\n\n")).replace(/<hr( [^>]*)?>/gi,"<hr$1>\n\n")).replace(/\s*<option/gi,"<option")).replace(/<\/option>\s*/gi,"</option>")).replace(/\r\n|\r/g,"\n")).replace(/\n\s*\n+/g,"\n\n")).replace(/([\s\S]+?)\n\n/g,"<p>$1</p>\n")).replace(/<p>\s*?<\/p>/gi,"")).replace(new RegExp("<p>\\s*(</?(?:"+t+")(?: [^>]*)?>)\\s*</p>","gi"),"$1")).replace(/<p>(<li.+?)<\/p>/gi,"$1")).replace(/<p>\s*<blockquote([^>]*)>/gi,"<blockquote$1><p>")).replace(/<\/blockquote>\s*<\/p>/gi,"</p></blockquote>")).replace(new RegExp("<p>\\s*(</?(?:"+t+")(?: [^>]*)?>)","gi"),"$1")).replace(new RegExp("(</?(?:"+t+")(?: [^>]*)?>)\\s*</p>","gi"),"$1")).replace(/\s*\n/gi,"<br />\n")).replace(new RegExp("(</?(?:"+t+")[^>]*>)\\s*<br />","gi"),"$1")).replace(/<br \/>(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)/gi,"$1")).replace(/(?:<p>|<br ?\/?>)*\s*\[caption([^\[]+)\[\/caption\]\s*(?:<\/p>|<br ?\/?>)*/gi,"[caption$1[/caption]")).replace(/(<(?:div|th|td|form|fieldset|dd)[^>]*>)(.*?)<\/p>/g,function(e,t,n){return n.match(/<p( [^>]*)?>/)?e:t+"<p>"+n+"</p>"}),n&&(e=e.replace(/<wp-line-break>/g,"\n")),r&&(e=e.replace(/<wp-temp-br([^>]*)>/g,"<br$1>")),e},removep:function(e){var t="blockquote|ul|ol|li|table|thead|tbody|tfoot|tr|th|td|h[1-6]|fieldset",n=t+"|div|p",r=t+"|pre",o=!1,i=!1;return e?(-1===e.indexOf("<pre")&&-1===e.indexOf("<script")||(o=!0,e=e.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g,function(e){return(e=(e=e.replace(/<br ?\/?>(\r\n|\n)?/g,"<wp-line-break>")).replace(/<\/?p( [^>]*)?>(\r\n|\n)?/g,"<wp-line-break>")).replace(/\r?\n/g,"<wp-line-break>")})),-1!==e.indexOf("[caption")&&(i=!0,e=e.replace(/\[caption[\s\S]+?\[\/caption\]/g,function(e){return e.replace(/<br([^>]*)>/g,"<wp-temp-br$1>").replace(/[\r\n\t]+/,"")})),-1!==(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(new RegExp("\\s*</("+n+")>\\s*","g"),"</$1>\n")).replace(new RegExp("\\s*<((?:"+n+")(?: [^>]*)?)>","g"),"\n<$1>")).replace(/(<p [^>]+>.*?)<\/p>/g,"$1</p#>")).replace(/<div( [^>]*)?>\s*<p>/gi,"<div$1>\n\n")).replace(/\s*<p>/gi,"")).replace(/\s*<\/p>\s*/gi,"\n\n")).replace(/\n[\s\u00a0]+\n/g,"\n\n")).replace(/\s*<br ?\/?>\s*/gi,"\n")).replace(/\s*<div/g,"\n<div")).replace(/<\/div>\s*/g,"</div>\n")).replace(/\s*\[caption([^\[]+)\[\/caption\]\s*/gi,"\n\n[caption$1[/caption]\n\n")).replace(/caption\]\n\n+\[caption/g,"caption]\n\n[caption")).replace(new RegExp("\\s*<((?:"+r+")(?: [^>]*)?)\\s*>","g"),"\n<$1>")).replace(new RegExp("\\s*</("+r+")>\\s*","g"),"</$1>\n")).replace(/<li([^>]*)>/g,"\t<li$1>")).indexOf("<option")&&(e=(e=e.replace(/\s*<option/g,"\n<option")).replace(/\s*<\/select>/g,"\n</select>")),-1!==e.indexOf("<hr")&&(e=e.replace(/\s*<hr( [^>]*)?>\s*/g,"\n\n<hr$1>\n\n")),-1!==e.indexOf("<object")&&(e=e.replace(/<object[\s\S]+?<\/object>/g,function(e){return e.replace(/[\r\n]+/g,"")})),e=(e=(e=(e=e.replace(/<\/p#>/g,"</p>\n")).replace(/\s*(<p [^>]+>[\s\S]*?<\/p>)/g,"\n$1")).replace(/^\s+/,"")).replace(/[\s\u00a0]+$/,""),o&&(e=e.replace(/<wp-line-break>/g,"\n")),i&&(e=e.replace(/<wp-temp-br([^>]*)>/g,"<br$1>")),e):""}}},function(e,t,n){},function(e,t,n){"use strict";(function(e){var r=n(1),o=n.n(r),i=n(84),a=n.n(i),s=(n(18),n(32)),l=n.n(s),u=n(2),c=n.n(u),d=n(48),p=n.n(d),f=n(9),h=n.n(f),g=n(4),m=n.n(g),v=(n(38),n(33)),b=n(35),y=n(16),_=n(10),k=(n(1197),Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}),w=a()({displayName:"ETBuilderConditionalLogic",mixins:[l.a],getInitialState:function(){return{options:this.props.value,fieldValues:{},selectedValues:{},moduleType:c()(this,"props.module.props.module.props.type","")}},componentDidMount:function(){var e=this,t=this.props.module.props.module,n=t.parentModule.props.content,r={};n.map(function(n,o){if(n.address!==t.props.address){var i=c()(n,"attrs.field_id","");if(""!==i.trim()){i="et_pb_signup_custom_field"===e.state.moduleType?i:i.toLowerCase();var a=[];if(h()(["checkbox","radio","select"],n.attrs.field_type)){var s=void 0;switch(n.attrs.field_type){case"checkbox":s=n.attrs.checkbox_options;break;case"radio":s=n.attrs.radio_options;break;case"select":s=n.attrs.select_options}0!==(s=""===s||m()(s)?[]:s).length&&(a=(s=JSON.parse(s)).map(function(e){return e.value}))}r[i]=a}}}),this.setState({fieldValues:r}),setTimeout(function(){if(!e.state.options){var t=[],n="";for(var r in e.state.fieldValues)if(e.state.fieldValues.hasOwnProperty(r)){n=r;break}var o=c()(e,["state","fieldValues",n,0]);t.push({field:n,condition:"is",value:o}),e.setState({options:JSON.stringify(t)}),e.updateOptions(0,n),e._updateFrontEnd()}for(var i={},a=JSON.parse(e.state.options),s=0;s<a.length;s++)i[s]=a[s].value;e.setState({selectedValues:i})},0)},updateOptions:function(t,n,r,o,i){var a=this.state.options||"",s=""===a?[]:JSON.parse(a),l="condition"+t,u="value"+t,c="",d="";m()(this[l])||(c=this[l].value),m()(this[u])||(d=this[u].value),!0===r&&(d=m()(this.state.selectedValues[t])?"":this.state.selectedValues[t],h()(["checkbox","radio","select"],o)&&(d=this.state.fieldValues[n][0]));var p={field:n,condition:c,value:d};s[t]=p;var f=e.intentionallyCloneDeep(this.state.selectedValues);!0===i&&(f[t]=d),this.setState({options:JSON.stringify(s),selectedValues:f}),this._updateFrontEnd()},updateSelected:function(e,t){var n=this,r=this.state.options||"",o=""===r?[]:JSON.parse(r),i=t.target.value,a=this.props.module.props.module.parentModule.props.content,s="input";a.map(function(e,t){("et_pb_signup_custom_field"===n.state.moduleType?e.attrs.field_id:e.attrs.field_id.toLowerCase())===i&&(s=e.attrs.field_type)}),o[e].field=i,this.setState({options:JSON.stringify(o)}),setTimeout(function(){n.updateOptions(e,i,!0,s)},0)},addRow:function(e,t){t&&t.preventDefault();var n=this,r=this.state.options||"",o=""===r?[]:JSON.parse(r),i="";for(var a in this.state.fieldValues)if(this.state.fieldValues.hasOwnProperty(a)){i=a;break}var s=c()(this,["state","fieldValues",i,0]);!1!==e?o.splice(e+1,0,{field:i,condition:"is",value:s}):o.push({field:i,condition:"is",value:s}),this.setState({options:JSON.stringify(o)}),setTimeout(function(){if(!1!==e)n.updateOptions(e+1,i);else{var t=o.length>0?o.length-1:0;n.updateOptions(t,i)}n._updateFrontEnd()},0)},removeRow:function(e,t){t.preventDefault();var n=this,r=this.state.options||"",o=""===r?[]:JSON.parse(r);if(o.splice(e,1),0===o.length){var i="";for(var a in this.state.fieldValues)if(this.state.fieldValues.hasOwnProperty(a)){i=a;break}o=[{field:i,condition:"is",value:c()(this,["state","fieldValues",i,0])}]}this.setState({options:JSON.stringify(o)}),setTimeout(function(){n._updateFrontEnd()},0)},_fieldSelect:function(e,t){var n=this,r=this,i=this.props.module.props.module,a=i.parentModule.props.content,s="field"+e,l="condition"+e,u="value"+e,d=t.field,p=this.updateOptions.bind(this,e,d);return o.a.createElement("div",{className:"et-fb-settings-conditional-logic",key:e},o.a.createElement("select",{className:"et-fb-settings-option-select et-fb-main-setting",onChange:this.updateSelected.bind(this,e),ref:function(e){return n[s]=e},value:t.field,disabled:this.props.readonly||!1},a.map(function(e,t){if(e.address!==i.props.address){var n=c()(e,"attrs.field_id","");if(""!==n.trim()){n="et_pb_signup_custom_field"===r.state.moduleType?n:n.toLowerCase();var a=c()(ETBuilderBackend,"componentDefinitions.fieldsDefaults.et_pb_contact_field.field_title[0]",""),s=c()(e,"attrs.field_title",""),l=""!==a&&s===a?n:s;if(""!==l.trim())return o.a.createElement("option",{value:n,key:t},l)}}})),o.a.createElement("select",{className:"et-fb-settings-option-select et-fb-main-setting",onChange:p,ref:function(e){return n[l]=e},value:t.condition,disabled:this.props.readonly||!1},o.a.createElement("option",{value:"is"},ETBuilderBackend.i18n.controls.conditionalLogic.is),o.a.createElement("option",{value:"is not"},ETBuilderBackend.i18n.controls.conditionalLogic.isNot),o.a.createElement("option",{value:"is greater"},ETBuilderBackend.i18n.controls.conditionalLogic.isGreater),o.a.createElement("option",{value:"is less"},ETBuilderBackend.i18n.controls.conditionalLogic.isLess),o.a.createElement("option",{value:"contains"},ETBuilderBackend.i18n.controls.conditionalLogic.contains),o.a.createElement("option",{value:"does not contain"},ETBuilderBackend.i18n.controls.conditionalLogic.doesNotContain),o.a.createElement("option",{value:"is empty"},ETBuilderBackend.i18n.controls.conditionalLogic.isEmpty),o.a.createElement("option",{value:"is not empty"},ETBuilderBackend.i18n.controls.conditionalLogic.isNotEmpty)),this._fieldSelectValues(e,d,t.value,u,t.condition))},_fieldSelectValues:function(e,t,n,r,i){var a=this,s=(this.props.module.props.module.parentModule.props.content,this.state.fieldValues[t]);m()(s)&&(s=[],m()(this.state.fieldValues[0])||(s=this.state.fieldValues[0])),m()(n)&&(n="");var l=!!h()(["is empty","is not empty"],i);return 0===s.length?o.a.createElement("input",{className:"et-fb-settings-option-input et-fb-main-setting",type:"text",onChange:this.updateOptions.bind(this,e,t,!1,!1,!0),ref:function(e){return a[r]=e},disabled:l,value:n,readOnly:this.props.readonly||!1,onFocus:this._onFocus,onBlur:this._onBlur}):o.a.createElement("select",{className:"et-fb-settings-option-select et-fb-main-setting",onChange:this.updateOptions.bind(this,e,t),ref:function(e){return a[r]=e},disabled:l,value:n},s.map(function(e,t){return o.a.createElement("option",{value:e,key:t},e)}))},_onFocus:function(){(this.props.module||this.props.isPageSetting)&&_.b.settingFieldFocused(this)},_onBlur:function(){(this.props.module||this.props.isPageSetting)&&_.b.settingFieldFocused(!1)},_optionsControls:function(){var e=this,t=this.state.options||"";return(""===t?[]:JSON.parse(t)).map(function(t,n){var r=!e.props.readonly&&!e.props.hideDeleteButton&&o.a.createElement("a",{href:"#",className:"et_options_list_remove",onClick:e.removeRow.bind(e,n)},o.a.createElement(v.a,{icon:"delete",color:"rgb(163, 176, 194)"}));return o.a.createElement("div",{className:"et_options_list_row et_condition_row",key:n},e._fieldSelect(n,t),r)})},render:function(){var e=this.props.additional_attrs?this.props.additional_attrs:{},t=this.addRow.bind(this,!1,!1),n=!this.props.readonly&&!this.props.hideAddButton&&o.a.createElement("span",{className:"et-fb-item-button-wrap--add"},o.a.createElement(y.Motion,{defaultStyle:{size:0,opacity:0},style:{size:Object(y.spring)(1,{stiffness:300,damping:20}),opacity:Object(y.spring)(1,{stiffness:300,damping:20})}},function(e){return o.a.createElement(b.a,{round:!0,style:{opacity:e.opacity,transform:"scale( "+e.size+" )"},tooltip:ETBuilderBackend.i18n.controls.moduleItem.addNew,_onClick:t},o.a.createElement(v.a,{size:"14",icon:"add",color:"#FFFFFF"}))}));return o.a.createElement("div",{className:"et_options_list"},this._optionsControls(),o.a.createElement("textarea",k({value:this.state.options,name:this.props.name,id:"et-fb-"+this.props.name,onChange:p.a,onFocus:this._onFocus,onBlur:this._onBlur},e)),n)},_updateFrontEnd:function(){var e=this;setTimeout(function(){e.props._onChange(e.props.name,e.state.options,e.props.type)},0)}});t.a=w}).call(this,n(0))},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){var r=n(167)("toPairs",n(519),n(384));r.placeholder=n(155),e.exports=r},function(e,t,n){var r=n(167)("fromPairs",n(359));r.placeholder=n(155),e.exports=r},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";(function(e){var r=n(1),o=n.n(r),i=n(17),a=n(6),s=n.n(a),l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var u=function(t){function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,r["Component"]),l(n,[{key:"render",value:function(){var t=this.props,n=t.connectDragSource,r=t.connectDropTarget,a=t.isDragging,s=o.a.Children.only(this.props.children);return o.a.cloneElement(s,{ref:function(t){var o=Object(i.findDOMNode)(t),s=e(o);r(o),n(o),s.addClass("et-fb-draggable-item"),a?s.addClass("et-fb-draggable-item--dragging"):s.removeClass("et-fb-draggable-item--dragging")}})}}]),n}();u.propTypes={connectDragSource:s.a.func.isRequired,connectDropTarget:s.a.func.isRequired,isDragging:s.a.bool.isRequired,find:s.a.func.isRequired,move:s.a.func.isRequired,id:s.a.number.isRequired},t.a=u}).call(this,n(28))},function(e,t,n){},function(e,t,n){var r=n(167)("find",n(61));r.placeholder=n(155),e.exports=r},function(e,t,n){var r=n(167)("noop",n(48),n(384));r.placeholder=n(155),e.exports=r},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";(function(e,r){var o=n(1),i=n.n(o),a=n(6),s=n.n(a),l=n(18),u=n.n(l),c=n(91),d=n(4),p=n.n(d),f=(n(1212),function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}());var h=new c.AllHtmlEntities,g=function(t){function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,o["Component"]),f(n,[{key:"_openLinkInNewTab",value:function(t){var n=t.target.href;p()(n)||(t.preventDefault(),e.topWindow().open(n,"_blank").focus())}},{key:"componentDidMount",value:function(){this.$warningTag=r(this.warningTag),this.$warningTag.on("click","a",this._openLinkInNewTab)}},{key:"componentWillUnmount",value:function(){this.$warningTag.off("click","a",this._openLinkInNewTab)}},{key:"render",value:function(){var e=this,t={"et-fb-main-settings-option":!0};return this.props.className&&(t[this.props.className]=!0),this.props.value!==this.props.display_if?null:i.a.createElement("div",{className:u()(t),dangerouslySetInnerHTML:{__html:h.decode(this.props.message)},ref:function(t){return e.warningTag=t}})}}]),n}();g.propTypes={display_if:s.a.bool,message:s.a.string,module:s.a.object,name:s.a.string,type:s.a.string,value:s.a.bool},t.a=g}).call(this,n(0),n(28))},function(e,t,n){},function(e,t,n){"use strict";(function(e){var r=n(1),o=n.n(r),i=n(17),a=n.n(i),s=n(6),l=n.n(s),u=n(78),c=n.n(u),d=n(12),p=n.n(d),f=n(2),h=n.n(f),g=n(39),m=n.n(g),v=n(45),b=n.n(v),y=n(4),_=n.n(y),k=n(36),w=n.n(k),C=(n(83),n(48)),S=n.n(C),E=n(1214),O=n(1215),T=n(1102),x=n(33),M=n(694),D=(n(1220),n(763)),P=n(0),N=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var L=function(t){function n(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,t));return r.setValue=function(e,t){var n=p()({},r.props.values,function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},e,t));r.props.onChange(n)},r.handleSave=function(){r.props.onClose()},r.handleCancel=function(){r.props.onChange(r.state.initialValues),r.props.onClose()},r.maybeClose=function(t){var n=e(a.a.findDOMNode(r));e(t.target).closest(n).length<1&&r.handleSave()},r.state={initialValues:p()({},r.props.values),positioning:null},r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,r["Component"]),N(n,[{key:"updatePositioning",value:function(){var t=e(a.a.findDOMNode(this)),n=t.find(".et-fb-field-settings-modal:first"),r=t.find(".et-fb-field-settings-modal__content:first"),o=parseInt(P.default.$topWindow("#wpadminbar").height())+30,i=P.default.condition("is_bfb")?30:100,s=Object(D.a)(t,n,r.height()+40,o,i);m()(this.state.positioning,s)||this.setState({positioning:s})}},{key:"componentDidMount",value:function(){P.default.topWindow().addEventListener("mousedown",this.maybeClose),P.default.appWindow().addEventListener("mousedown",this.maybeClose),e("body:first").addClass("et-fb-dynamic-content-settings-opened"),this.updatePositioning(),c.a.rebuild()}},{key:"componentWillUnmount",value:function(){P.default.topWindow().removeEventListener("mousedown",this.maybeClose),P.default.appWindow().removeEventListener("mousedown",this.maybeClose),e("body:first").removeClass("et-fb-dynamic-content-settings-opened")}},{key:"componentDidUpdate",value:function(){this.updatePositioning()}},{key:"render",value:function(){var e=this,t=new M.a(this.props.values);return o.a.createElement("div",{className:"et-fb-field-settings-modal-root"},o.a.createElement(E.a,{enabled:this.props.animation},function(n){var r=e.state.positioning,i=n;return b()(r)||(i.top=r.position.top,i.maxWidth=r.size.width,i.maxHeight=r.size.height),o.a.createElement("div",{className:"et-fb-field-settings-modal",style:i},o.a.createElement("div",{className:"et-fb-field-settings-modal__container"},o.a.createElement("div",{className:"et-fb-field-settings-modal__scroll et-fb-allow-mouse-wheel"},o.a.createElement("div",{className:"et-fb-field-settings-modal__content"},e.props.title&&o.a.createElement("h4",{className:"et-fb-field-settings-modal__title"},e.props.title),w()(e.props.fields,function(n,r){var i=h()(n,"default","");return _()(e.props.values[r])||(i=e.props.values[r]),o.a.createElement(O.a,{key:r,field:n,fieldName:r,value:i,propertyResolver:t,onChange:e.setValue,animation:e.props.animation})}))),o.a.createElement(T.b,{block:!0},o.a.createElement(T.a,{block:!0,danger:!0,tooltip:ETBuilderBackend.i18n.tooltip.modal.cancel,_onClick:e.handleCancel},o.a.createElement(x.a,{icon:"exit",color:"#FFFFFF"})),o.a.createElement(T.a,{block:!0,success:!0,tooltip:ETBuilderBackend.i18n.tooltip.modal.save,_onClick:e.handleSave},o.a.createElement(x.a,{icon:"check",color:"#FFFFFF"})))))}))}}]),n}();L.propTypes={title:l.a.string,fields:l.a.object.isRequired,values:l.a.object.isRequired,onChange:l.a.func,onClose:l.a.func},L.defaultProps={animation:!0,onChange:S.a,onClose:S.a},t.a=L}).call(this,n(28))},function(e,t,n){"use strict";var r=n(1),o=n.n(r),i=n(6),a=n.n(i),s=n(16),l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var c=function(e){function t(){var e,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var o=arguments.length,i=Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=r=u(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(i))),r.getDefaultStyle=function(){return{size:.5,opacity:0}},r.getStyle=function(){return{size:r.props.enabled?Object(s.spring)(1,{stiffness:300,damping:20}):1,opacity:r.props.enabled?Object(s.spring)(1,{stiffness:300,damping:20}):1}},u(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r["Component"]),l(t,[{key:"render",value:function(){var e=this;return o.a.createElement(s.Motion,{defaultStyle:this.getDefaultStyle(),style:this.getStyle()},function(t){return e.props.children({opacity:t.opacity,transform:"scale("+t.size+")"})})}}]),t}();c.propTypes={children:a.a.func.isRequired,enabled:a.a.bool},c.defaultProps={enabled:!0},t.a=c},function(e,t,n){"use strict";var r=n(1),o=n.n(r),i=n(6),a=n.n(i),s=n(48),l=n.n(s),u=n(1050),c=n(695),d=n(694),p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},f=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var h=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r["PureComponent"]),f(t,[{key:"render",value:function(){var e=u.a.getControl(this.props.field.type);return Object(c.a)(this.props.field,this.props.propertyResolver)?o.a.createElement("div",{className:"et-fb-field-settings-modal__field"},this.props.field.label&&o.a.createElement("p",{className:"et-fb-form__label"},this.props.field.label),o.a.createElement(e,p({name:this.props.fieldName,value:this.props.value,_onChange:this.props.onChange,processedKey:this.props.fieldName,content:this.props.value,animate:this.props.animation},this.props.field))):null}}]),t}();h.propTypes={field:a.a.object.isRequired,fieldName:a.a.string.isRequired,propertyResolver:a.a.instanceOf(d.a).isRequired,animation:a.a.bool,onChange:a.a.func},h.defaultProps={animation:!0,onChange:l.a},t.a=h},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";(function(e){var r=n(1),o=n.n(r),i=n(17),a=n.n(i),s=n(1225),l=n.n(s),u=n(18),c=n.n(u),d=n(4),p=n.n(d),f=n(41),h=n.n(f),g=(n(38),n(39)),m=n.n(g),v=n(354),b=n.n(v),y=n(452),_=n.n(y),k=n(352),w=n.n(k),C=n(27),S=n.n(C),E=n(194),O=n.n(E),T=(n(1228),n(33)),x=n(35),M=n(0),D=n(1106),P=n(2),N=n.n(P),L=n(58),F=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var A=function(e,t){return 0===S()(e).length?t:e},j=function(e){var t,n=w()(e,"|"),r=(t=n,Array.isArray(t)?t:Array.from(t)),o=r[0],i=r.slice(1);return[o||"off"].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(i))},I=function(e,t){return b()(_()(j(e),j(t),A),"|")},R=function(t){function n(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var t=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));t._onCornerChange=O()(function(e,n){var r=M.default.intentionallyCloneDeep(t._getValues());t._lastValue=n,r[e]=n,t.setState({inputValues:r}),t._onChange(e)});var r=I(t.props.value,t._getDefaultValue());return t.state={inputValues:t._splitValue(r)},t._values=t._splitValue(r),t._lastValue="",t._onChange=t._onChange.bind(t),t._onClickLink=t._onClickLink.bind(t),t._onResize=t._onResize.bind(t),t._onTopLeftChange=t._onCornerChange("top-left").bind(t),t._onTopRightChange=t._onCornerChange("top-right").bind(t),t._onBottomLeftChange=t._onCornerChange("bottom-left").bind(t),t._onBottomRightChange=t._onCornerChange("bottom-right").bind(t),t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,o.a.Component),F(n,[{key:"componentWillReceiveProps",value:function(e){var t=I(e.value,this._getDefaultValue());this._values=this._splitValue(t),this.setState({inputValues:this._splitValue(t)})}},{key:"shouldComponentUpdate",value:function(e,t){return I(e.value,this._getDefaultValue())!==this.props.value||!m()(this.state.inputValues,t.inputValues)}},{key:"componentDidMount",value:function(){this._onResize(),this._onChange=this._onChange.bind(this)}},{key:"_onResize",value:function(){var t=e(a.a.findDOMNode(this.refs.radiusPreview)),n=t.innerHeight(),r=t.innerWidth(),o='"data:image/svg+xml,%3Csvg%20width%3D%27'+r+"%27%20height%3D%27"+n+"%27%20viewBox%3D%270%200%20"+r+"%20"+n+"%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%3E%3Cline%20x1%3D%270%27%20y1%3D%270%27%20x2%3D%27"+r+"%27%20y2%3D%27"+n+"%27%20style%3D%27stroke%3A%23f1f5f9%3Bstroke-width%3A2%27%20/%3E%3Cline%20x1%3D%270%27%20y1%3D%27"+n+"%27%20x2%3D%27"+r+'%27%20y2%3D%270%27%20style%3D%27stroke%3A%23f1f5f9%3Bstroke-width%3A2%27%20/%3E%3C/svg%3E"';t.css("background","#FFFFFF url("+o+")")}},{key:"_isLinkedMode",value:function(){return this._getSettingValue("border-link")}},{key:"_onChange",value:function(e){var t=void 0,n=L.a.sanitizeInputUnit(this._lastValue),r=this._getDefaultSettingValue(e);(n===r||""===r&&"0px"===n)&&(n=""),this._isLinkedMode()?t=this._spreadValue(n):(t=this._getValues())[e]=n,this.props._onChange(this.props.name,this._combineValues(t)),this.setState({inputValues:t})}},{key:"_spreadValue",value:function(e){return{"border-link":!0,"top-left":e,"top-right":e,"bottom-right":e,"bottom-left":e}}},{key:"_onClickLink",value:function(){if(!this.props.readonly)if(this._getSettingValue("border-link")){var e=this._getValues();e["border-link"]=!1,this.props._onChange(this.props.name,this._combineValues(e))}else{""===this._lastValue&&(this._lastValue=this._getSettingValue("top-left"));var t=this._spreadValue(this._lastValue);this.props._onChange(this.props.name,this._combineValues(t)),this.setState({inputValues:t})}}},{key:"_combineValues",value:function(e){return(e["border-link"]?"on":"")+"|"+e["top-left"]+"|"+e["top-right"]+"|"+e["bottom-right"]+"|"+e["bottom-left"]}},{key:"_splitValue",value:function(e){var t=h()(e)?e:e.split("|");return{"border-link":!!p()(t[0])||M.default.isOn(t[0]),"top-left":p()(t[1])||""===t[1]?"":t[1],"top-right":p()(t[2])||""===t[2]?"":t[2],"bottom-right":p()(t[3])||""===t[3]?"":t[3],"bottom-left":p()(t[4])||""===t[4]?"":t[4]}}},{key:"_getDefaultValue",value:function(){return p()(this.props.default)||""===this.props.default?"on||||":this.props.default}},{key:"_getDefaultSettingValue",value:function(e){return this._splitValue(this._getDefaultValue())[e]}},{key:"_getSettingPlaceholder",value:function(e){var t=this._getDefaultSettingValue(e);return""===t?"0px":t}},{key:"_getValues",value:function(){return this._values}},{key:"_getSettingValue",value:function(e){return this._getValues()[e]}},{key:"getInput",value:function(e){var t=N()({"top-left":this._onTopLeftChange,"top-right":this._onTopRightChange,"bottom-right":this._onBottomRightChange,"bottom-left":this._onBottomLeftChange},e),n=this._getDefaultSettingValue(e)===this.state.inputValues[e]?"":this.state.inputValues[e];return o.a.createElement("div",{className:"et-fb-settings-border-radius-"+e},o.a.createElement(D.a,{lassName:"et-fb-settings-option-input",value:n,onChange:t,defaultValue:this._getSettingPlaceholder(e),speed:.5,min:0,defaultUnit:"px",readonly:this.props.readonly}))}},{key:"render",value:function(){var e={borderTopLeftRadius:this._getSettingValue("top-left"),borderTopRightRadius:this._getSettingValue("top-right"),borderBottomRightRadius:this._getSettingValue("bottom-right"),borderBottomLeftRadius:this._getSettingValue("bottom-left")},t=this._getSettingValue("border-link")?"#2b87da":"#bec9d6";return o.a.createElement("div",{className:"et-fb-settings-border-radius-wrap"},o.a.createElement("div",{className:"et-fb-settings-border-radius-wrap-column"},this.getInput("top-left"),this.getInput("bottom-left")),o.a.createElement("div",{className:"et-fb-settings-border-radius-wrap-column"},o.a.createElement("div",{className:"et-fb-settings-border-radius-preview",style:e,ref:"radiusPreview"},o.a.createElement(l.a,{handleWidth:!0,handleHeight:!0,onResize:this._onResize}),o.a.createElement("div",{className:"et-fb-settings-border-radius-wrap-link-button"},o.a.createElement(x.a,{buttonName:"ROUNDED_CORNERS_SYNC_VALUES",className:c()({"et-fb-settings-border-radius-wrap-link-button-active":this._getSettingValue("border-link")}),tooltip:this.props.tooltip,stopPropagation:!0,ink:!1,_onClick:this._onClickLink},o.a.createElement(T.a,{icon:"border-link",color:t}))))),o.a.createElement("div",{className:"et-fb-settings-border-radius-wrap-column"},this.getInput("top-right"),this.getInput("bottom-right")))}}]),n}();t.a=R}).call(this,n(28))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(1226),i=(r=o)&&r.__esModule?r:{default:r};t.default=i.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(1),s=c(a),l=c(n(6)),u=n(1227);function c(e){return e&&e.__esModule?e:{default:e}}var d=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.state={expandChildHeight:0,expandChildWidth:0,expandScrollLeft:0,expandScrollTop:0,shrinkScrollTop:0,shrinkScrollLeft:0,lastWidth:0,lastHeight:0},e.reset=e.reset.bind(e),e.handleScroll=e.handleScroll.bind(e),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,a.Component),i(t,[{key:"componentWillMount",value:function(){this.forceUpdate()}},{key:"componentDidMount",value:function(){var e=this.containerSize(),t=o(e,2),n=t[0],r=t[1];this.reset(n,r),this.props.onResize(n,r)}},{key:"shouldComponentUpdate",value:function(e,t){return this.props!==e||this.state!==t}},{key:"componentDidUpdate",value:function(){this.expand.scrollLeft=this.expand.scrollWidth,this.expand.scrollTop=this.expand.scrollHeight,this.shrink.scrollLeft=this.shrink.scrollWidth,this.shrink.scrollTop=this.shrink.scrollHeight}},{key:"containerSize",value:function(){return[this.props.handleWidth&&this.container.parentElement.offsetWidth,this.props.handleHeight&&this.container.parentElement.offsetHeight]}},{key:"reset",value:function(e,t){if("undefined"!=typeof window){var n=this.container.parentElement,r="static";n.currentStyle?r=n.currentStyle.position:window.getComputedStyle&&(r=window.getComputedStyle(n).position),"static"===r&&(n.style.position="relative"),this.setState({expandChildHeight:this.expand.offsetHeight+10,expandChildWidth:this.expand.offsetWidth+10,lastWidth:e,lastHeight:t})}}},{key:"handleScroll",value:function(e){if("undefined"!=typeof window){e.preventDefault(),e.stopPropagation();var t=this.state,n=this.containerSize(),r=o(n,2),i=r[0],a=r[1];i===t.lastWidth&&a===t.lastHeight||this.props.onResize(i,a),this.reset(i,a)}}},{key:"render",value:function(){var e=this,t=this.state,n=r({},u.expandChildStyle,{width:t.expandChildWidth,height:t.expandChildHeight});return s.default.createElement("div",{style:u.parentStyle,ref:function(t){e.container=t}},s.default.createElement("div",{style:u.parentStyle,onScroll:this.handleScroll,ref:function(t){e.expand=t}},s.default.createElement("div",{style:n})),s.default.createElement("div",{style:u.parentStyle,onScroll:this.handleScroll,ref:function(t){e.shrink=t}},s.default.createElement("div",{style:u.shrinkChildStyle})))}}]),t}();t.default=d,d.propTypes={handleWidth:l.default.bool,handleHeight:l.default.bool,onResize:l.default.func},d.defaultProps={handleWidth:!1,handleHeight:!1,onResize:function(e){return e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.parentStyle={position:"absolute",left:0,top:0,right:0,bottom:0,overflow:"hidden",zIndex:-1,visibility:"hidden"},t.shrinkChildStyle={position:"absolute",left:0,top:0,width:"200%",height:"200%"},t.expandChildStyle={position:"absolute",left:0,top:0,width:"100%",height:"100%"}},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";(function(e){var r=n(1),o=n.n(r),i=n(17),a=n.n(i),s=n(32),l=n.n(s),u=n(18),c=n.n(u),d=n(2),p=n.n(d),f=n(7),h=n.n(f),g=n(67),m=n.n(g),v=n(9),b=n.n(v),y=n(12),_=n.n(y),k=n(30),w=n.n(k),C=n(72),S=n.n(C),E=n(50),O=n.n(E),T=n(125),x=n.n(T),M=n(283),D=n.n(M),P=(n(233),n(31),n(0)),N=n(1051),L=n(35),F=n(218),A=n(21),j=n(3),I=n(10),R=(n(1231),function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}());function B(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var H=P.default.$topWindow("body"),W=function(t){function n(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var t=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));t.force_clear_fields=!1,t.getProviderName=function(){return t.props.name.replace("_list","")};var r=p()(t.props,"value","none");return t.state={add_new_account_in_progress:!1,fetch_lists_in_progress:!1,ajax_in_progress:!1,remove_account_in_progress:!1,remove_account_ajax:!1,no_account_selected:""===r||"none"===r},t._provider_name=null,t.previous_selection="none",t.selected_account="",t.shouldComponentUpdate=l.a.shouldComponentUpdate.bind(t),t._addNewAccount=t._addNewAccount.bind(t),t._removeAccount=t._removeAccount.bind(t),t._ajaxSendRequest=t._ajaxSendRequest.bind(t),t._ajaxComplete=t._ajaxComplete.bind(t),t._fetchLists=t._fetchLists.bind(t),t.actionInProgress=t.actionInProgress.bind(t),t.cancelAllActions=t.cancelAllActions.bind(t),t.getProviderName=t.getProviderName.bind(t),t.getSelectedAccount=t.getSelectedAccount.bind(t),t._onChange=t._onChange.bind(t),t._onClickAddNewAccountButton=t._onClickAddNewAccountButton.bind(t),t._onClickFetchListsButton=t._onClickFetchListsButton.bind(t),t._onClickRemoveAccountButton=t._onClickRemoveAccountButton.bind(t),t._renderAddNewAccountButton=t._renderAddNewAccountButton.bind(t),t._renderRemoveAccountButton=t._renderRemoveAccountButton.bind(t),t._renderFetchListsButton=t._renderFetchListsButton.bind(t),t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,o.a.Component),R(n,[{key:"componentWillMount",value:function(){j.a.addSignupModuleAddAccountCancelEventListener(this.cancelAllActions),j.a.addSignupModuleAddAccountSubmitEventListener(this._addNewAccount)}},{key:"componentWillUnmount",value:function(){j.a.removeSignupModuleAddAccountCancelEventListener(this.cancelAllActions),j.a.removeSignupModuleAddAccountSubmitEventListener(this._addNewAccount),H.removeClass("et-fb--email-action-in-progress et-fb--email-ajax-in-progress")}},{key:"componentWillReceiveProps",value:function(e){w()(e.options).length<3&&this.setState({no_account_selected:!0})}},{key:"_addNewAccount",value:function(){var e=this,t=p()(this.props,"module.state.generalFields"),n=this.getProviderName(),r=S()(t,function(e,t){return O()(t,n)});if(!m()(r,function(e){return h()(e)})){var o=D()(r,function(t,n,r){x()(r,"_list")||(t["et_"+r]=p()(e.props,"module.props.module.props.attrs."+r,""))});o.action="et_builder_email_add_account",o.et_provider=n,o.et_builder_email_add_account_nonce=ETBuilderBackend.nonces.moduleEmailOptinAddAccount,this._ajaxSendRequest(o)}}},{key:"_removeAccount",value:function(){var e=this.getProviderName(),t=this.selected_account,n={action:"et_builder_email_remove_account",et_builder_email_remove_account_nonce:ETBuilderBackend.nonces.moduleEmailOptinRemoveAccount,et_provider:e,et_account:t};this._ajaxSendRequest(n,"remove_account_ajax")}},{key:"_ajaxSendRequest",value:function(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"ajax_in_progress";this.setState(B({},r,!0)),e.ajax({type:"POST",url:ETBuilderBackend.ajaxUrl,dataType:"json",data:t}).done(function(e,t,r){n._ajaxComplete(e)}).fail(function(){return n._ajaxComplete()})}},{key:"_ajaxComplete",value:function(e){if(e){var t=this.props.module.props.module,n=A.a.getComponentFields(t.props.type)[this.props.name];n.options=_()({},e.accounts_list),I.b.updateComponentFieldDefinition(t.props.type,this.props.name,n),h()(e.predefined_custom_fields)||(ETBuilderBackend.emailPredefinedCustomFields=e.predefined_custom_fields),h()(e.custom_fields)||I.b.updateComponentFieldDefinitions(t.props.child_slug,e.custom_fields)}this.state.add_new_account_in_progress&&this.state.ajax_in_progress&&j.a.emitSignupModuleAddAccountAjaxCompleteEvent(),this.force_clear_fields=this.state.remove_account_in_progress,this.cancelAllActions()}},{key:"_fetchLists",value:function(){var e=this.getProviderName(),t=this.getSelectedAccount(),n={action:"et_builder_email_get_lists",et_builder_email_fetch_lists_nonce:ETBuilderBackend.nonces.moduleEmailOptinFetchLists,et_provider:e,et_account:t};this._ajaxSendRequest(n)}},{key:"actionInProgress",value:function(){return this.state.add_new_account_in_progress||this.state.fetch_lists_in_progress||this.state.remove_account_in_progress}},{key:"cancelAllActions",value:function(){(""===this.previous_selection||b()(["add_new_account","fetch_lists","remove_account"],this.previous_selection))&&(this.previous_selection="none"),this.setState({add_new_account_in_progress:!1,fetch_lists_in_progress:!1,ajax_in_progress:!1,remove_account_in_progress:!1,remove_account_ajax:!1,no_account_selected:"none"===this.previous_selection}),this.props._onChange(this.props.name,this.previous_selection)}},{key:"getSelectedAccount",value:function(){return e(a.a.findDOMNode(this)).find(":selected").parent().attr("label")}},{key:"setPreviousSelection",value:function(){this.previous_selection=this.getSelectedAccount()+"|"+this.props.value}},{key:"_onChange",value:function(e,t,n){var r=b()(["add_new_account","fetch_lists","remove_account"],t),o=this.actionInProgress()&&!r;this.props._onChange(e,t),o&&this.cancelAllActions(),"none"===t||""===t?this.setState({no_account_selected:!0}):this.state.no_account_selected&&this.setState({no_account_selected:!1}),!this.actionInProgress()&&r&&("add_new_account"===t?(this.setState({add_new_account_in_progress:!0}),"aweber"===this.getProviderName()&&setTimeout(function(){P.default.topWindow().open("https://auth.aweber.com/1.0/oauth/authorize_app/b17f3351")},500)):"fetch_lists"===t?(this.setState({fetch_lists_in_progress:!0}),this._fetchLists()):"remove_account"===t&&this.setState({remove_account_in_progress:!0}))}},{key:"_onClickAddNewAccountButton",value:function(){this.state.add_new_account_in_progress||(this.setPreviousSelection(),this._onChange(this.props.name,"add_new_account"))}},{key:"_onClickFetchListsButton",value:function(){this.state.remove_account_in_progress?this.cancelAllActions():this.actionInProgress()||(this.setPreviousSelection(),this._onChange(this.props.name,"fetch_lists"))}},{key:"_onClickRemoveAccountButton",value:function(){this.state.remove_account_in_progress&&!this.state.remove_account_ajax?this._removeAccount():this.state.remove_account_in_progress||(this.selected_account=this.getSelectedAccount(),this.setPreviousSelection(),this._onChange(this.props.name,"remove_account"))}},{key:"componentWillUpdate",value:function(e,t){var n=t.add_new_account_in_progress,r=t.fetch_lists_in_progress,o=t.ajax_in_progress;n||r?H.addClass("et-fb--email-action-in-progress"):H.removeClass("et-fb--email-action-in-progress"),o?H.addClass("et-fb--email-ajax-in-progress"):H.removeClass("et-fb--email-ajax-in-progress")}},{key:"_renderAddNewAccountButton",value:function(e){var t=p()(this.props,"after[0].text","");return this.state.add_new_account_in_progress||this.state.remove_account_in_progress?"":o.a.createElement(F.a,{useWrapper:!1,isLoading:this.state.ajax_in_progress},o.a.createElement(L.a,{className:e,_onClick:this._onClickAddNewAccountButton,inverse:!0},t))}},{key:"_renderRemoveAccountButton",value:function(e){var t=this.state.remove_account_in_progress,n=p()(this.props,"after[1].attributes['data-confirm_text']",""),r=p()(this.props,"after[1].text","");return this.state.add_new_account_in_progress||this.state.fetch_lists_in_progress||this.state.no_account_selected?"":o.a.createElement(F.a,{useWrapper:!1,isLoading:this.state.remove_account_ajax},o.a.createElement(L.a,{className:e,_onClick:this._onClickRemoveAccountButton,inverse:!0},t?n:r))}},{key:"_renderFetchListsButton",value:function(e){var t=this.state.add_new_account_in_progress,n=p()(this.props,"after[2].attributes['data-cancel_text']",""),r=p()(this.props,"after[2].text","");return t||this.state.ajax_in_progress||this.state.remove_account_ajax||this.state.no_account_selected?"":o.a.createElement(F.a,{useWrapper:!1,isLoading:this.state.fetch_lists_in_progress},o.a.createElement(L.a,{className:e,_onClick:this._onClickFetchListsButton,inverse:!0},this.state.remove_account_in_progress?n:r))}},{key:"render",value:function(){var e,t=this.props.type.replace(/_/g,"-"),n=c()({"et-fb-settings-button--additional-button":!0}),r=this.state.add_new_account_in_progress&&this.state.ajax_in_progress,i=this.state.add_new_account_in_progress||this.state.remove_account_in_progress,a="";i&&this.state.add_new_account_in_progress?a=this.props.attributes["data-adding_new_account_text"]:i&&this.state.remove_account_in_progress&&(a=this.props.attributes["data-confirm_remove_text"]+" "+this.selected_account);var s=c()((B(e={},"et-fb-option--"+t,!0),B(e,"et-fb--email-add-new-in-progress-ajax",r),B(e,"et-fb--email-add-new-in-progress",this.state.add_new_account_in_progress),B(e,"et-fb--email-fetch-lists-in-progress",this.state.fetch_lists_in_progress),B(e,"et-fb--email-remove-in-progress",this.state.remove_account_in_progress),e));return o.a.createElement("div",{className:s},i?o.a.createElement("span",{className:"et-fb-form__description"},a):o.a.createElement(N.a,{name:this.props.name,value:this.props.value,className:c()("et-fb-settings-option--with-after-element"),groups:!0,options:this.props.options,module:this.props.module,readonly:this.props.readonly||!1,_onChange:this._onChange}),!this.props.readonly&&!this.props.hideAddButton&&this._renderAddNewAccountButton(n),!this.props.readonly&&!this.props.hideRemoveButton&&this._renderRemoveAccountButton(n),!this.props.readonly&&!this.props.hideFetchButton&&this._renderFetchListsButton(n))}}]),n}();t.a=W}).call(this,n(28))},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";(function(e,r){var o=n(1),i=n.n(o),a=n(6),s=n.n(a),l=n(7),u=n.n(l),c=n(4),d=n.n(c),p=n(2),f=n.n(p),h=n(297),g=n.n(h),m=(n(1235),n(691)),v=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var b=function(t){function n(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,o["PureComponent"]),v(n,[{key:"_openLinkInNewTab",value:function(t){var n=t.target.href;d()(n)||(t.preventDefault(),e.topWindow().open(n,"_blank").focus())}},{key:"componentDidMount",value:function(){this.$creditsContainer=r(this.creditsContainer),this.$creditsContainer.on("click","a",this._openLinkInNewTab)}},{key:"componentWillUnmount",value:function(){this.$creditsContainer.off("click","a",this._openLinkInNewTab)}},{key:"render",value:function(){var e=this,t=this.props,n=t.moduleTitle,r=t.moduleType,o=f()(ETBuilderBackend,"customModuleCredits."+r,!1),a=f()(ETBuilderBackend,"customModuleCredits."+r+".author","");if(!o||u()(a))return!1;var s=u()(o.module_uri)?n:'<a href="'+o.module_uri+'">'+n+"</a>",l=u()(o.author_uri)?a:'<a href="'+o.author_uri+'">'+a+"</a>";return i.a.createElement("div",{className:"et-fb-settings-modal-module-credits",dangerouslySetInnerHTML:{__html:g()(s+" by "+l)},ref:function(t){return e.creditsContainer=t}})}}]),n}(),y={moduleTitle:s.a.string,moduleType:s.a.string};m.a.propTypes=y,t.a=b}).call(this,n(0),n(28))},function(e,t,n){},function(e,t,n){"use strict";(function(e){var r=n(1),o=n.n(r),i=n(17),a=n.n(i),s=n(78),l=n.n(s),u=n(18),c=n.n(u),d=n(7),p=n.n(d),f=n(39),h=n.n(f),g=n(160),m=n.n(g),v=n(2),b=n.n(v),y=n(248),_=n.n(y),k=n(0),w=n(217),C=n(3),S=n(10),E=n(139),O=(n(1237),function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}());var T=function(t){function n(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var t=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return t.state={activeColorpicker:null,paletteColors:p()(t.getSavedPalette())?t.getDefaultPalette():t.getSavedPalette()},t._repositionColorpickerElements=t._repositionColorpickerElements.bind(t),t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,o.a.Component),O(n,[{key:"getClassName",value:function(e){return"et-fb-settings-option-colorpalette-"+e}},{key:"getDefaultPalette",value:function(){return ETBuilderBackend.pageSettingsFields.et_pb_color_palette.default.split("|")}},{key:"getSavedPalette",value:function(){return k.default.get(C.a.getPageSetting("et_pb_color_palette"),"").split("|").filter(_()(p.a))}},{key:"getPalette",value:function(){return this.state.paletteColors}},{key:"_repositionColorpickerElements",value:function(){var t=e(a.a.findDOMNode(this)).find('.et-fb-settings-option-colorpalette-colorpicker-wrap[data-index="'+this.state.activeColorpicker+'"]'),n=parseInt(t.find(".iris-square-value.ui-draggable").width()),r=parseInt(t.find(".iris-square-value.ui-draggable").css("left"))+n/2,o=parseInt(t.width());k.default.hasValue(this.props.value)&&r>o-50?t.addClass("on-right-corner"):t.removeClass("on-right-corner")}},{key:"render",value:function(){var e=this,t=this.getPalette(),n=m()(8).map(function(n){return o.a.createElement("span",{key:"overviewItem-"+n,className:e.getClassName("overview-item"),"data-index":n,"data-tip":!0,"data-for":"color-palette-tooltip-"+n,onClick:e._onOverviewClick.bind(e,n)},o.a.createElement("span",{className:"color",style:{backgroundColor:t[n]}}),o.a.createElement(l.a,{id:"color-palette-tooltip-"+n,effect:"solid"},t[n]))}),r=m()(8).map(function(n){var r={};r[""+e.getClassName("colorpicker-wrap")]=!0,r[e.getClassName("colorpicker-wrap")+"--active"]=n===e.state.activeColorpicker;var i={"et-fb-settings-option-colorpalette-input":!0};return i["et-fb-color-type-"+E.a.getColorType(t[n])]=!0,o.a.createElement("div",{className:c()(r),key:"colorpickerWrap-"+n,"data-index":n},o.a.createElement(w.a,{ref:"input-"+n,className:c()(i),name:e.getClassName("input")+"-"+n,value:t[n],_onChange:e._onChange,additional_attrs:{"data-alpha":!0}}))});return o.a.createElement("div",{className:c()({"et-fb-settings-option-inner":!0,"et-fb-settings-option-inner--colorpalette":!0}),ref:"colorpalette"},o.a.createElement("div",{className:e.getClassName("overview")},n),r)}},{key:"componentWillReceiveProps",value:function(){var e=this.getSavedPalette();h()(this.getPalette(),e)||this.setState({paletteColors:p()(e)?this.getDefaultPalette():e})}},{key:"componentDidMount",value:function(){var e=this,t=this.getPalette(),n=this.getDefaultPalette(),r=k.default.$appWindow(a.a.findDOMNode(this.refs.colorpalette)),o=void 0;r.find("."+e.getClassName("input")).each(function(r,i){var a=k.default.$appWindow(this);a.wpColorPicker({hide:!1,default:n[r],palettes:!1,change:function(n,i){var a=i.color.toString();if(t[r]=a,e.setState({paletteColors:t}),S.b.pageSettingsChange("et_pb_color_palette",t.join("|")),"square"===b()(n,"originalEvent.type")){var s=k.default.$appWindow(this).closest(".et-fb-settings-option-colorpalette-colorpicker-wrap");s.find(".button-confirm").css("backgroundColor",a),s.hasClass("is-dragging")||s.addClass("is-dragging"),clearTimeout(o),o=setTimeout(function(){e._repositionColorpickerElements(),s.find(".button-confirm").css("backgroundColor",""),s.removeClass("is-dragging")},300)}},clear:function(){var n=e.getDefaultPalette();t[r]=n[r],a.wpColorPicker("color",n[r]),S.b.pageSettingsChange("et_pb_color_palette",t.join("|"))},diviColorpicker:!0,onClose:function(){k.default.$topDocument().off("click.etClickOutsideColorpicker_"+r),e.setState({activeColorpicker:null})}}),a.next('input[type="button"]').attr({value:ETBuilderBackend.i18n.controls.colorpicker.clear}),a.closest(".wp-picker-container").find(".wp-color-result").attr("title",ETBuilderBackend.i18n.controls.colorpicker.select)})}},{key:"_onOverviewClick",value:function(e){var t=this,n=e===this.state.activeColorpicker?null:e,r=k.default.$appWindow(a.a.findDOMNode(this)).find('.et-fb-settings-option-colorpalette-colorpicker-wrap[data-index="'+n+'"]'),o=r.find("."+this.getClassName("input"));r.find(".iris-picker").show(),k.default.$topDocument().on("click.etClickOutsideColorpicker.etClickOutsideColorpicker_"+e,function(){o.wpColorPicker("close")}),this.setState({activeColorpicker:n}),setTimeout(function(){t._repositionColorpickerElements()},100)}},{key:"_onChange",value:function(){}}]),n}();t.a=T}).call(this,n(28))},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";(function(e){var r=n(1),o=n.n(r),i=n(16),a=n(18),s=n.n(a),l=n(6),u=n.n(l),c=n(7),d=n.n(c),p=(n(1244),n(10)),f=(n(3),n(35)),h=n(33),g=n(779),m=n(82),v=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var b=ETBuilderBackend.i18n,y={className:u.a.string,currentVideo:u.a.number,currentVideoList:u.a.string,modalPosition:u.a.object,modalWidth:u.a.number,modalMoving:u.a.bool},_=function(t){function n(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this));return e.state={videoHover:!1},e._handleVideoMouseEnter=e._handleVideoMouseEnter.bind(e),e._handleVideoMouseLeave=e._handleVideoMouseLeave.bind(e),e._renderUndockButton=e._renderUndockButton.bind(e),e._handleAnimation=e._handleAnimation.bind(e),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,r["Component"]),v(n,[{key:"_handleVideoMouseEnter",value:function(){this.props.modalMoving||this.setState({videoHover:!0})}},{key:"_handleVideoMouseLeave",value:function(){this.setState({videoHover:!1})}},{key:"_handleAnimation",value:function(e,t){return this.props.animate?e:t}},{key:"_renderUndockButton",value:function(){var e=this.props,t=e.helpModalState,n=e.modalPosition,r=e.modalWidth,a=e.videoOverlayStatus,s=this.state.videoHover,l=d()(t)?{width:r,position:{x:n.x,y:n.y}}:t;return o.a.createElement(i.Motion,{defaultStyle:{s:.5,o:0,x:15,y:15},style:{s:this._handleAnimation(Object(i.spring)(s?1:.5,{stiffness:300,damping:20}),s?1:.5),o:this._handleAnimation(Object(i.spring)(s?1:0,{stiffness:300,damping:20}),s?1:0),x:this._handleAnimation(Object(i.spring)(s?15:0,{stiffness:300,damping:20}),s?15:0),y:this._handleAnimation(Object(i.spring)(s?0:15,{stiffness:300,damping:20}),s?0:15)}},function(e){return o.a.createElement(f.a,{round:!0,elevate:!0,primary:!0,small:!0,__onClick:function(){p.b.setVideoOverlay(l.width,l.position.x,l.position.y,!a)},style:{opacity:e.o,transform:"translate("+e.x+"px, "+e.y+"px) scale("+e.s+")"}},o.a.createElement(h.a,{icon:"window-undock",color:"#FFFFFF"}))})}},{key:"render",value:function(){var t=this.props,n=t.className,r=t.currentVideo,i=t.currentVideoList,a=t.modalWidth,l=t.videoOverlayStatus,u=s()("et-fb-video-list",n);return o.a.createElement("div",{className:u},o.a.createElement("div",{className:"et-fb-video-list__container"},o.a.createElement("div",{className:"et-fb-video-list__header",onMouseEnter:this._handleVideoMouseEnter,onMouseLeave:this._handleVideoMouseLeave,style:{height:.5625*(a-60)}},o.a.createElement(m.a,null,this._renderUndockButton(),l?o.a.createElement("span",null,b.video.active):function(e,t){return navigator.onLine?o.a.createElement(g.a,{dividers:!0,style:{width:"100%",height:"100%"},videoId:b.videos[e][t].id}):o.a.createElement("span",null,b.video.offline)}(i,r))),o.a.createElement("ul",{className:"et-fb-video-list__menu"},o.a.createElement(m.a,null,Object.keys(b.videos[i]).map(function(t){return o.a.createElement("li",{className:s()({"et-fb-video-list__item":!0,"et-fb-video-list__item--active":r===parseInt(t,10)}),onClick:function(n){e(n.target).closest(".et-fb-tabs__panel--active").animate({scrollTop:0},300),p.b.setVideo(parseInt(t,10))},key:"video-"+t},o.a.createElement("div",{className:"et-fb-video-list__icon"}),o.a.createElement("span",null,b.videos[i][t].name))})))))}}]),n}();_.propTypes=y,_.defaultProps={currentVideo:1,currentVideoList:"et_pb_default"},t.a=_}).call(this,n(28))},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";(function(e){var r=n(1),o=n.n(r),i=n(1248),a=n.n(i),s=n(28),l=n.n(s),u=n(18),c=n.n(u),d=n(2),p=n.n(d),f=n(11),h=n.n(f),g=n(39),m=n.n(g),v=n(7),b=n.n(v),y=n(43),_=n.n(y),k=n(53),w=n.n(k),C=n(41),S=n.n(C),E=n(4),O=n.n(E),T=n(19),x=n.n(T),M=n(1105),D=n(0),P=n(218),N=n(1250),L=n(1252),F=n(10),A=n(852),j=n(3),I=n(21),R=(n(1253),function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}());var B=Object(M.a)("div"),H=function(t){function n(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,t));r.state={local_layouts:{},custom_layouts:{},account_status_error:"",account_auth_failed:!1,et_username:"",et_api_key:"",username_field_help_active:!1,api_key_field_help_active:!1,hovered_field_group:null,ajax_in_progress:!1},r.tabs=[{name:["library","Premade Layouts"],className:"modules_all"},{name:["library","Your Saved Layouts"],className:"modules_library"}],r._hasActiveAccount=function(){return"active"===r.account.status},r.onAccountStatusError=function(e){r.setState({account_status_error:e}),r.props.pageChanged(!0)},r.onAuthenticationComplete=function(e){if(r.state.account_status_error){if(r.setState({ajax_in_progress:!1}),e.authenticated)return r.account={et_username:r.state.et_username,et_api_key:r.state.et_api_key,status:e.status},r.setState({account_status_error:""}),r.library.call("retryUseLayout"),void F.b.updateETAccount(r.account);r.setState({account_auth_failed:!0})}},r.onChangeAccountFields=function(e,t){t!==r.state[e]&&r.setState(function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},e,t))},r.onClickAccountSubmit=function(){var e={et_username:r.state.et_username,et_api_key:r.state.et_api_key};r.setState({ajax_in_progress:!0}),r.library.call("authenticate",e)},r.onClickHelpButton=function(){F.b.setVideoList("et_pb_default_layouts",1,"library")},r.onDismissedAccountStatusError=function(){return r.setState({account_status_error:""})},r.onDownloadProgress=function(e){(e=Math.floor(e/2))<1&&(e=1),r.props._onChange("importProgress",e)},r.onLayoutsDataFetched=function(e,t){r.setState({local_layouts:e,custom_layouts:t})},r.onPageChanged=function(e){var t=r.current_page.previous_url;r.current_page=e,r.current_page.previous_url||(r.current_page.previous_url=t),r.props.pageChanged(e.is_layout)},r.onUseLayout=function(e){if(j.a.isProductTourActive()&&l()("body").trigger("et_fb_product_tour_element_clicked"),S()(e))var t=e.layout,n=e.replace_content;else t=e;w()(t)?(t=new L.a([t],"layout.json",{type:"application/json"}),r.props._onChange({importFile:t,importOptions:{replaceLayout:n}}),setTimeout(r.props.importLayout,150)):(n="on"===n,A.a.getLayout(t).then(function(e){F.b.insertSavedModule(e,!0,n)}))},r.account=j.a.getETAccount(),r.site_url=ETBuilderBackend.site_url,r.library=null,r.$library=l()(),r.library_url=r._getLibraryURL(),r.inside_iframe=!1,r.current_page={},A.a.addLayoutsDataFetchedListener(r.onLayoutsDataFetched),e.appWindow().onAccountStatusError=r.onAccountStatusError;var o=I.a.getLayoutsTabs();return S()(o)&&!b()(o)&&h()(o,function(e,t){return r.tabs.push({name:e,className:t})}),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,o.a.Component),R(n,[{key:"_getLibraryURL",value:function(){var e=[],t={animation:j.a.getAppPreference("builder_animation"),iframe:1};return this.props.isProductTour&&(t.product_tour=1),h()(t,function(t,n){return e.push("et_"+n+"="+t)}),"https://www.elegantthemes.com/layouts?"+(e=e.join("&"))}},{key:"_loadLibrary",value:function(){return a.a.debug=!1,new a.a({container:this.node,url:this._getLibraryURL()})}},{key:"_setLayoutsData",value:function(){if(b()(A.a.layouts_data))F.b.fetchLayoutsData();else{var e=A.a.layouts_data.local_layouts,t=A.a.layouts_data.custom_layouts;this.setState({local_layouts:e,custom_layouts:t})}}},{key:"componentWillMount",value:function(){this._setLayoutsData()}},{key:"componentDidMount",value:function(){var t=this;this.mounted=!0,Object(D.enableScrollLock)(),e.$appWindow().on("et-fb-product-tour-skip",function(e,n){t.library.call("productTourSkipStep",n)}),this._loadLibrary().then(function(e){if(t.mounted&&(t.library=e,t.$library=l()(e.frame),t.$library.height(t.props.height-96).width(t.props.width),Object(D.isIEOrEdge)()&&(t.$library.onload=function(){t.$library.contentWindow.location.reload(),t.$library.onload=null}),t.library.on("current_page_changed",t.onPageChanged),t.library.on("use_layout",t.onUseLayout),t.library.on("download_progress",t.onDownloadProgress),t.library.on("account_status_error",t.onAccountStatusError),t.library.on("authentication_complete",t.onAuthenticationComplete),t.library.on("help_button_clicked",t.onClickHelpButton),t.library.call("setAccount",{username:Object(D.sanitized_previously)(t.account.et_username),api_key:Object(D.sanitized_previously)(t.account.et_api_key)}),t.library.call("setShowLoadOptions",!t.isCurrentLayoutEmpty()),t.props.doneLoading(),t._setLayoutsData(),!O()(t.props.layoutFilters))){var n=x()(t.props.layoutFilters)?t.props.layoutFilters:[t.props.layoutFilters];t.library.call("emitSignal",{signal:"categoriesFilterChanged",data:{value:n}})}})}},{key:"componentWillReceiveProps",value:function(e){e.backToLayouts&&this.state.account_status_error&&(e.active_tab!==this.props.active_tab&&this.$library.hide(0),this.setState({account_status_error:""}),this.props.pageChanged(!0))}},{key:"componentDidUpdate",value:function(e){this.props.width!==e.width&&this.$library.width(this.props.width),this.props.height!==e.height&&this.$library.height(this.props.height-96)}},{key:"componentWillUnmount",value:function(){this.mounted=!1,this.library&&this.library.destroy(),A.a.removeLayoutsDataFetchedListener(this.onLayoutsDataFetched),Object(D.disableScrollLock)()}},{key:"isCurrentLayoutEmpty",value:function(){return 0===l()("#et_pb_root").find(".et_pb_module, .et-fb-skeleton--collapsed").length||j.a.isProductTourActive()}},{key:"shouldComponentUpdate",value:function(e,t){var n=e.active_tab!==this.props.active_tab,r=e.active_tab===this.props.active_tab&&"modules_all"===e.active_tab;if(this.library&&e.backToLayouts&&!this.state.account_status_error&&!n)this.library.call("goTo",this.current_page.previous_url);else if(this.library&&(n||!r)){var o="modules_all"===e.active_tab?{}:this.state.local_layouts;"modules_library"!==e.active_tab&&(o=p()(this.state.custom_layouts,e.active_tab,{})),_()(o,"filters.type",this.props.type),_()(o,"load_options.show",!this.isCurrentLayoutEmpty()),this.library.call("toggleLocalLayouts",o),n&&this.state.account_status_error&&this.$library.fadeIn()}return!m()(this.props,e)||!m()(this.state,t)}},{key:"_renderAccountStatusError",value:function(){return o.a.createElement(N.a,{status:this.state.account_status_error,authFailed:this.state.account_auth_failed,onClickSubmitButton:this.onClickAccountSubmit,onChangeAccountFields:this.onChangeAccountFields,ajaxInProgress:this.state.ajax_in_progress})}},{key:"render",value:function(){var e,t=this,n=c()({"et-fb-library-container":!0,"et-fb-portability__content--hidden":this.props.isLoadingLayout||this.state.account_status_error}),r=c()({"et-fb-main-settings":!0,"et-fb-main-settings--load_layout":!0,"et-fb-main-settings--error":this.state.account_status_error,"et-fb-main-settings--moving":this.props.modalMoving});return o.a.createElement("div",{className:r},(e=this.props)._renderTabs.apply(e,function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(this.tabs)),this.props.isLoadingLayout&&this.props._renderProgressBar(),this.state.account_status_error&&this._renderAccountStatusError(),o.a.createElement(P.a,{isLoading:this.props.isLoading}),o.a.createElement("div",{className:n},o.a.createElement(B,{_ref:function(e){return t.node=e}})))}}]),n}();H.displayName="ETBuilderLibraryModal",t.a=Object(M.b)(H,"download")}).call(this,n(0))},function(e,t,n){ /** * postmate - A powerful, simple, promise-based postMessage library * @version 1.1.9 * @link https://github.com/dollarshaveclub/postmate * @author Jacob Kelley <jakie8@gmail.com> * @license MIT */ e.exports=function(){"use strict";function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(){var e;d.debug&&(e=console).log.apply(e,arguments)}var n=window.navigator.userAgent.indexOf("Edge")>-1;function r(e,t){return(e.origin===t||n)&&"object"===i(e.data)&&"postmate"in e.data&&e.data.type===a&&!!{"handshake-reply":1,call:1,emit:1,reply:1,request:1}[e.data.postmate]}var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a="application/x-postmate-v1+json",s=Object.prototype.hasOwnProperty,l=0,u=function(){function n(r){var o=this;e(this,n),this.parent=r.parent,this.frame=r.frame,this.child=r.child,this.childOrigin=r.childOrigin,this.events={},t("Parent: Registering API"),t("Parent: Awaiting messages..."),this.listener=function(e){var n=((e||{}).data||{}).value||{},r=n.data,i=n.name;"emit"===e.data.postmate&&(t("Parent: Received event emission: "+i),i in o.events&&o.events[i].call(o,r))},this.parent.addEventListener("message",this.listener,!1),t("Parent: Awaiting event emissions from Child")}return o(n,[{key:"get",value:function(e){var t=this;return new d.Promise(function(n){var r=++l;t.parent.addEventListener("message",function e(o){o.data.uid===r&&"reply"===o.data.postmate&&(t.parent.removeEventListener("message",e,!1),n(o.data.value))},!1),t.child.postMessage({postmate:"request",type:a,property:e,uid:r},t.childOrigin)})}},{key:"call",value:function(e,t){this.child.postMessage({postmate:"call",type:a,property:e,data:t},this.childOrigin)}},{key:"on",value:function(e,t){this.events[e]=t}},{key:"destroy",value:function(){t("Parent: Destroying Postmate instance"),window.removeEventListener("message",this.listener,!1),this.frame.parentNode.removeChild(this.frame)}}]),n}(),c=function(){function n(o){var i=this;e(this,n),this.model=o.model,this.parent=o.parent,this.parentOrigin=o.parentOrigin,this.child=o.child,t("Child: Registering API"),t("Child: Awaiting messages..."),this.child.addEventListener("message",function(e){if(r(e,i.parentOrigin)){t("Child: Received request",e.data);var n=e.data,o=n.property,s=n.uid,l=n.data;if("call"===e.data.postmate)return void(o in i.model&&"function"==typeof i.model[o]&&i.model[o].call(i,l));(function(e,t){var n="function"==typeof e[t]?e[t]():e[t];return d.Promise.resolve(n)})(i.model,o).then(function(t){return e.source.postMessage({property:o,postmate:"reply",type:a,uid:s,value:t},e.origin)})}})}return o(n,[{key:"emit",value:function(e,n){t('Child: Emitting Event "'+e+'"',n),this.parent.postMessage({postmate:"emit",type:a,value:{name:e,data:n}},this.parentOrigin)}}]),n}(),d=function(){function n(t){e(this,n);var r=t.container,o=void 0===r?void 0!==o?o:document.body:r,i=t.model,a=t.url;return this.parent=window,this.frame=document.createElement("iframe"),o.appendChild(this.frame),this.child=this.frame.contentWindow||this.frame.contentDocument.parentWindow,this.model=i||{},this.sendHandshake(a)}return o(n,[{key:"sendHandshake",value:function(e){var o=this,i=function(e){var t=document.createElement("a");return t.href=e,t.origin||t.protocol+"//"+t.hostname}(e),s=0,l=void 0;return new n.Promise(function(n,c){o.parent.addEventListener("message",function e(a){return!!r(a,i)&&("handshake-reply"===a.data.postmate?(clearInterval(l),t("Parent: Received handshake reply from Child"),o.parent.removeEventListener("message",e,!1),o.childOrigin=a.origin,t("Parent: Saving Child origin",o.childOrigin),n(new u(o))):(t("Parent: Invalid handshake reply"),c("Failed handshake")))},!1);var d=function(){t("Parent: Sending handshake attempt "+ ++s,{childOrigin:i}),o.child.postMessage({postmate:"handshake",type:a,model:o.model},i),5===s&&clearInterval(l)},p=function(){d(),l=setInterval(d,500)};o.frame.attachEvent?o.frame.attachEvent("onload",p):o.frame.onload=p,t("Parent: Loading frame",{url:e}),o.frame.src=e})}}]),n}();return d.debug=!1,d.Promise=function(){try{return window?window.Promise:Promise}catch(e){return null}}(),d.Model=function(){function r(t){return e(this,r),this.child=window,this.model=t,this.parent=this.child.parent,this.sendHandshakeReply()}return o(r,[{key:"sendHandshakeReply",value:function(){var e=this;return new d.Promise(function(r,o){e.child.addEventListener("message",function i(l){if(l.data.postmate){if("handshake"===l.data.postmate){t("Child: Received handshake from Parent"),e.child.removeEventListener("message",i,!1),t("Child: Sending handshake reply to Parent"),l.source.postMessage({postmate:"handshake-reply",type:a},l.origin),e.parent!==l.source&&(e.parent=l.source),e.parentOrigin=n?"*":l.origin;var u=l.data.model;if(u){for(var d=Object.keys(u),p=0;p<d.length;p++)s.call(u,d[p])&&(e.model[d[p]]=u[d[p]]);t("Child: Inherited and extended model from Parent")}return t("Child: Saving Parent origin",e.parentOrigin),r(new c(e))}return o("Handshake Reply Failed")}},!1)})}}]),r}(),d}()},function(e,t,n){},function(e,t,n){"use strict";var r=n(1),o=n.n(r),i=n(18),a=n.n(i),s=n(33),l=n(35),u=n(217),c=n(259),d=(n(1251),function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}());function p(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var f=ETBuilderBackend.i18n,h=function(e){function t(){var e,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var o=arguments.length,i=Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=r=p(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(i))),r.state={username_field_help_active:!1,api_key_field_help_active:!1,hovered_field_group:null},r.onClickAccountFieldHelp=function(e){var t=e+"_field_help_active";r.setState(function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},t,!r.state[t]))},r.onMouseEnterFieldGroup=function(e){r.setState({hovered_field_group:e})},r.onMouseLeaveFieldGroup=function(e){r.state.hovered_field_group===e&&r.setState({hovered_field_group:null})},p(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.a.Component),d(t,[{key:"_renderSubmitButton",value:function(){var e=o.a.createElement(s.a,{icon:"loading",color:"#FFFFFF"});return o.a.createElement(l.a,{_onClick:this.props.onClickSubmitButton,inverse:!0},this.state.ajax_in_progress||f.library.Submit,this.state.ajax_in_progress&&e)}},{key:"_renderAPIKeyFormGroup",value:function(){return o.a.createElement(c.b,{name:"api_key",onMouseEnterGroup:this.onMouseEnterFieldGroup,onMouseLeaveGroup:this.onMouseLeaveFieldGroup},o.a.createElement(c.c,{name:"api_key",activeHelp:this.state.api_key_field_help_active,hoveredGroup:"api_key"===this.state.hovered_field_group,onClickHelp:this.onClickAccountFieldHelp},f.library["API Key"]),o.a.createElement(c.a,{active:this.state.api_key_field_help_active},f.library.$apiKeyHelp),o.a.createElement(u.a,{type:"text",value:this.props.et_api_key,name:"et_api_key",_onChange:this.props.onChangeAccountFields}))}},{key:"_renderUsernameFormGroup",value:function(){return o.a.createElement(c.b,{name:"username",onMouseEnterGroup:this.onMouseEnterFieldGroup,onMouseLeaveGroup:this.onMouseLeaveFieldGroup},o.a.createElement(c.c,{name:"username",activeHelp:this.state.username_field_help_active,hoveredGroup:"username"===this.state.hovered_field_group,onClickHelp:this.onClickAccountFieldHelp},f.library.Username),o.a.createElement(c.a,{active:this.state.username_field_help_active},f.library.$usernameHelp),o.a.createElement(u.a,{type:"text",value:this.props.et_username,name:"et_username",_onChange:this.props.onChangeAccountFields}))}},{key:"_renderExpiredAccountError",value:function(){return o.a.createElement("div",{className:"et-fb-account-status-error__content"},o.a.createElement("p",{dangerouslySetInnerHTML:{__html:f.library.$expiredAccount}}))}},{key:"_renderNoAccountError",value:function(){return o.a.createElement("div",{className:"et-fb-account-status-error__content"},o.a.createElement("p",null,f.library.$noAccount),this._renderUsernameFormGroup(),this._renderAPIKeyFormGroup(),o.a.createElement("div",null,this._renderSubmitButton()))}},{key:"render",value:function(){var e="expired"===this.props.status,t=e?f.library["Uh Oh!"]:f.library["Authentication Required"],n={"et-fb-account-status-error":!0,"et-fb-account-status-error--auth-failed":this.props.authFailed};return o.a.createElement("div",{className:a()(n)},o.a.createElement("h2",null,t),e&&this._renderExpiredAccountError(),e||this._renderNoAccountError())}}]),t}();t.a=h},function(e,t,n){},function(e,t,n){"use strict";n.d(t,"a",function(){return o});var r=navigator.userAgent.indexOf("Safari")>-1&&-1===navigator.userAgent.indexOf("Chrome");function o(e,t,n){if(!document.documentMode&&!window.StyleMedia&&!r)return new window.File(e,t,n);var o=new Blob(e,n);return o.lastModified=Date.now(),o.name=t,o}},function(e,t,n){},function(e,t,n){"use strict";var r=n(1),o=n.n(r),i=n(4),a=n.n(i),s=n(2),l=n.n(s),u=n(36),c=n.n(u),d=n(7),p=n.n(d),f=n(18),h=n.n(f),g=n(218),m=n(1101),v=n(217),b=n(687),y=n(1052),_=n(1105),k=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),w=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var C=ETBuilderBackend.i18n.tooltips,S=ETBuilderBackend.saveModuleLibraryCategories,E=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n._getFilePlaceholderClassName=function(){return h()({"et-core-portability-import-placeholder":!0,"et-fb-portability-import-placeholder--active":!p()(l()(n.props,"importFile.name",""))})},n._onChange=function(e,t){var r=t.split("|"),o=k(r,2),i={importOptions:{addToLibrary:"off",replaceLayout:o[0],importBackUp:o[1]}};n.props._onChange(i)},n.onImportLayout=function(e){e.preventDefault(),n.props.importLayout()},n.onExportLayout=function(e){e.preventDefault(),n.props.exportLayout()},n.onFileUpload=function(e){var t=l()(e,"target.files[0]",""),r=t?t.name.replace(".json",""):"";n.props._onChange({importFile:t,importLayoutName:r})},n._renderCategories=function(){return!(!S||0===S.length)&&o.a.createElement(r.Fragment,null,o.a.createElement("div",{className:"et-fb-import-categories-field"},o.a.createElement("h3",null,ETBuilderBackend.i18n.saveModuleLibraryAttrs.addToCatText,":"),o.a.createElement("div",{className:"et-fb-settings-option-container"},o.a.createElement(y.a,{value:n.props.importCategories,name:"importCategories",options:c()(S,function(e){return e.name}),shortcut_index:"import-categories",_onChange:n.props._onChange}))),o.a.createElement("div",{className:"et-fb-export-file-name-field"},o.a.createElement("h3",null,ETBuilderBackend.i18n.saveModuleLibraryAttrs.createCatText),o.a.createElement(v.a,{type:"text",value:n.props.importNewCategory,name:"importNewCategory",_onChange:n.props._onChange})))},n._renderExportTab=function(){return o.a.createElement("div",{className:n.props.tabClassName("modules_all")},o.a.createElement("div",{className:"et-fb-export-file-name-field"},o.a.createElement("h3",null,C.exportName),o.a.createElement(v.a,{type:"text",value:n.props.exportFileName,name:"exportFileName",_onChange:n.props._onChange})),o.a.createElement("div",{className:"et-fb-export-error-container"},n.props.exportError),o.a.createElement(b.a,{videoListId:"et_pb_portability",trigger:"tooltip"}),o.a.createElement("a",{href:"#",className:"et-fb-save-library-button",onClick:n.onExportLayout},C.exportButton))},n._renderImportTab=function(){var e=n.props.importOptions,t=e.replaceLayout,r=e.importBackUp,i=e.addToLibrary;return o.a.createElement("div",{className:n.props.tabClassName("modules_library")},o.a.createElement("div",{className:"et-fb-upload-file-container"},o.a.createElement("h3",null,C.chooseFile),o.a.createElement("span",{className:n._getFilePlaceholderClassName()},n.props.importFileName()),o.a.createElement("input",{type:"file",className:"et-fb-import-file",onChange:n.onFileUpload})),o.a.createElement("div",{className:"et-fb-import-error-container"},n.props.importError),o.a.createElement("div",{className:"et-fb-import-options-field"},o.a.createElement("h3",null,C.importOptions,":"),o.a.createElement(y.a,{value:t+"|"+r,name:"importOptions",options:[C.replaceLayout,C.importBackUp],shortcut_index:"import-options",_onChange:n._onChange})),"on"===i&&n._renderImportNameField(),"on"===i&&n._renderCategories(),o.a.createElement(b.a,{videoListId:"et_pb_portability",trigger:"tooltip"}),o.a.createElement("a",{href:"#",className:"et-fb-save-library-button",onClick:n.onImportLayout},C.importButton))},n._renderImportNameField=function(){return o.a.createElement("div",{className:"et-fb-export-file-name-field"},o.a.createElement("h3",null,C.layoutName),o.a.createElement(v.a,{type:"text",value:n.props.importLayoutName,default:n.props.importLayoutName,name:"importLayoutName",_onChange:n.props._onChange}))},n._renderProgress=function(){return o.a.createElement(m.a,{progress:n.props.importProgress,time_remaining:n.props.importEstimation})},n._renderModalContent=function(){return n.props.preloadingItems&&n.props.importProgress?n._renderProgress():o.a.createElement(g.a,{isLoading:n.props.preloadingItems},n._renderExportTab(),n._renderImportTab())},n.tabs=[{name:"tooltips.export",className:"modules_all"},{name:"tooltips.import",className:"modules_library"}],n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.a.Component),w(t,[{key:"render",value:function(){var e,t=!a()(this.props.maxHeight)&&this.props.maxHeight>0?{maxHeight:this.props.maxHeight}:"";return o.a.createElement("div",{className:"et-fb-main-settings et-fb-main-settings--portability"},(e=this.props)._renderTabs.apply(e,function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(this.tabs)),o.a.createElement("div",{className:"et-fb-settings-options-wrap et_fb_save_module_modal",style:t},o.a.createElement("div",{className:"et-fb-settings-options"},this._renderModalContent())))}}]),t}();E.displayName="ETBuilderPortabilityModal",t.a=Object(_.b)(E)},function(e,t,n){"use strict";var r=n(1),o=n.n(r),i=n(84),a=n.n(i),s=(n(8),n(10)),l=n(3),u=n(33),c=n(0),d=n(18),p=n.n(d),f=n(7),h=n.n(f),g=n(4),m=n.n(g),v=n(12),b=n.n(v),y=n(11),_=n.n(y),k=n(2),w=n.n(k),C=n(91);var S=new C.AllHtmlEntities,E=a()({displayName:"ETBuilderModuleItem",render:function(){if(!l.a.isAllowedAction(this.props.label))return!1;var e,t,n,r=(e={},t=""+this.props.label.replace("et_pb_","et_fb_"),n=!0,t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e),i=this.props.specialtyLayout,a="",s="",d="",f="",g="";h()(i)||(a=i.layoutFormat,s=i.layoutType.split(","),d=i.specialtyColumns,g=this.props.label,r.et_fb_specialty_layout_item=!0,f=i.columns.map(function(e,t){var n="et_pb_layout_column",r=t+e;n+=" et_pb_column_layout_"+e;var i="",a="",l="";return"1"===s[t]?(n+=" et_pb_variations et_pb_"+d+"_variations",i=o.a.createElement("div",{className:"et_pb_variation et_pb_variation_full"}),a=o.a.createElement("div",{className:"et_pb_variation_row"},o.a.createElement("div",{className:"et_pb_variation et_pb_variation_1_2"}),o.a.createElement("div",{className:"et_pb_variation et_pb_variation_1_2"})),3===d&&(l="2_3,1_3"===g||"1_3,2_3"===g?o.a.createElement("div",{className:"et_pb_variation_row"},o.a.createElement("div",{className:"et_pb_variation et_pb_variation_1_4"}),o.a.createElement("div",{className:"et_pb_variation et_pb_variation_1_4"}),o.a.createElement("div",{className:"et_pb_variation et_pb_variation_1_4"}),o.a.createElement("div",{className:"et_pb_variation et_pb_variation_1_4"})):o.a.createElement("div",{className:"et_pb_variation_row"},o.a.createElement("div",{className:"et_pb_variation et_pb_variation_1_3"}),o.a.createElement("div",{className:"et_pb_variation et_pb_variation_1_3"}),o.a.createElement("div",{className:"et_pb_variation et_pb_variation_1_3"})))):n+=" et_pb_specialty_column",o.a.createElement("div",{className:n,key:r},i,a,l)}));var m=c.default.hasValue(this.props.iconSvg)?o.a.createElement(u.a,{iconSvg:this.props.iconSvg}):"",v=o.a.createElement("span",{className:"et_module_title"}," ",S.decode(w()(this,"props.title",""))," ");return""!==f&&(v=f),this.props.itemIndex===this.props.selectedItemIndex&&(r["et-fb-selected-item"]=!0),c.default.hasValue(this.props.icon)&&(r["et-fb-has-icon"]=!0),c.default.hasValue(this.props.iconSvg)&&(r["et-fb-has-svg-icon"]=!0),r=b()(r,this.props.classnames),o.a.createElement("li",{className:p()(r),onClick:this._onClick,"data-layout":a,"data-specialty":s,"data-specialty_columns":d,onMouseEnter:this._onMouseEnter,"data-icon":this.props.icon},m,v)},_onClick:function(){(l.a.abIsMode("off")||"layout"!==w()(this,"props.label"))&&("function"==typeof this.props.onClickAction?this.props.onClickAction(this.props):this.performModuleAdding())},_onMouseEnter:function(){m()(this.props.onMouseEnter)||this.props.onMouseEnter(this.props.itemIndex)},performModuleAdding:function(){var e=this.props.specialtyLayout,t=h()(e)?this.props.label:"et_pb_specialty_layout_"+e.layoutFormat,n=h()(e)?"":e.layoutType;if(this.props.savedShortcode){var r={};return b()(r,this.props.savedShortcode[0]),""===this.props.globalID||this.props.isAddingIntoGlobal||(r=this.prepareGlobalModule(r)),"et_pb_row_inner"===this.props.label&&(r.type="et_pb_row_inner"),s.b.insertSavedModule(r),void s.b.cancelTooltip()}s.b.insertNewModule(t,"",n,this.props.fbSupport),"et_fb_specialty"!==this.props.label&&s.b.cancelTooltip()},prepareGlobalModule:function(e,t){var n=this,r=n.props.globalID;return t?e.attrs.global_parent=r:e.attrs.global_module=r,!h()(e.content)&&Array.isArray(e.content)&&_()(e.content,function(e){n.prepareGlobalModule(e,!0)}),e}});t.a=E},function(e,t,n){"use strict";(function(e){var r=n(1),o=n.n(r),i=n(17),a=n.n(i),s=n(18),l=n.n(s),u=n(10),c=n(3),d=n(217),p=n(1052),f=n(687),h=n(11),g=n.n(h),m=n(7),v=n.n(m),b=n(2),y=n.n(b),_=n(4),k=n.n(_),w=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function C(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var S=ETBuilderBackend.saveModuleLibraryCategories,E=ETBuilderBackend.i18n.saveModuleLibraryAttrs,O=function(t){function n(){var t,r,o;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);for(var i=arguments.length,s=Array(i),d=0;d<i;d++)s[d]=arguments[d];return r=o=C(this,(t=n.__proto__||Object.getPrototypeOf(n)).call.apply(t,[this].concat(s))),o.state={template_name:"",selected_cats:"",make_global:"off",new_category_name:"",name_error:"",sync_error:""},o.setFieldClass=function(){var e={},t=""!==o.state.name_error;return e["et-fb-settings-option-container"]=!0,!0===t&&(e["et-fb-settings-option-container-input-error"]=!0),l()(e)},o.isGlobalOptionSupported=function(){var e=c.a.getModuleLibrarySave();if("root"===e||c.a.isGlobalLibraryPage())return!1;var t=y()(e,"props.attrs");return!!t&&(!t.global_module&&!t.global_parent)},o.getCategoriesNamesArray=function(){var e=S,t=[];return v()(e)||g()(e,function(e){t.push(e.name)}),t},o._onInput=function(e,t){var n=t;switch(e){case"template_name":o.setState({name_error:""===t?"on":""})}o.setState(function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},e,n))},o._onSave=function(t){var n=o.state;t.preventDefault(),""===n.template_name?(o.setState({name_error:"on"}),e(a.a.findDOMNode(o)).animate({scrollTop:0},1e3,"swing"),e(a.a.findDOMNode(o)).find("#et-fb-template_name").focus()):(u.b.performLibraryModuleSaving(n),u.b.cancelTooltip())},C(o,r)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,o.a.Component),w(n,[{key:"_renderCategories",value:function(){return 0!==this.getCategoriesNamesArray().length&&o.a.createElement("div",{className:"et-fb-settings-option"},o.a.createElement("label",null,E.addToCatText,":"),o.a.createElement("div",{className:"et-fb-settings-option-container"},o.a.createElement(p.a,{value:this.state.selected_cats,name:"selected_cats",options:this.getCategoriesNamesArray(),shortcut_index:"library-categories",_onChange:this._onInput})))}},{key:"render",value:function(){var e=c.a.getModuleLibrarySave(),t="root"!==e?e.props:e,n=!k()(this.props.maxHeight)&&this.props.maxHeight>0?{maxHeight:this.props.maxHeight}:"",r="",i=void 0;return i="root"===t?E.descriptionTextLayout:E.descriptionText,this.isGlobalOptionSupported()&&(r=o.a.createElement("div",{className:"et-fb-settings-option"},o.a.createElement("label",null,E.globalTitle,":"),o.a.createElement("div",{className:"et-fb-settings-option-container"},o.a.createElement(p.a,{value:this.state.make_global,name:"make_global",options:[E.globalText],shortcut_index:"make-global",_onChange:this._onInput})))),o.a.createElement("div",{className:"et-fb-settings-options-wrap",style:n},o.a.createElement("div",{className:"et-fb-settings-options"},o.a.createElement("p",{className:"et-fb-description-text"},i),o.a.createElement("div",{className:"et-fb-settings-option"},o.a.createElement("label",null,E.templateName,":"),o.a.createElement("div",{className:this.setFieldClass()},o.a.createElement(d.a,{type:"text",value:this.state.template_name,name:"template_name",_onChange:this._onInput}))),r,this._renderCategories(),o.a.createElement("div",{className:"et-fb-settings-option"},o.a.createElement("label",null,E.createCatText,":"),o.a.createElement("div",{className:"et-fb-settings-option-container"},o.a.createElement(d.a,{type:"text",value:this.state.new_category_name,name:"new_category_name",_onChange:this._onInput})),o.a.createElement(f.a,{videoListId:"et_pb_save_to_library",trigger:"tooltip"})),o.a.createElement("a",{href:"#",className:"et-fb-save-library-button",onClick:this._onSave},E.saveText)))}}]),n}();t.a=O}).call(this,n(28))},function(e,t,n){"use strict";var r=n(1),o=n.n(r),i=n(84),a=n.n(i),s=(n(17),n(18)),l=n.n(s),u=n(32),c=n.n(u),d=(n(1258),n(10)),p=(n(45),n(4)),f=n.n(p),h=n(36),g=n.n(h),m=n(11),v=n.n(m),b=n(160),y=n.n(b),_=a()({displayName:"ETBuilderSettingsColumn",mixin:[c.a],render:function(){var e=this,t=this.props.row,n=t.props.section_parent,r=ETBuilderBackend.columnLayouts,i=f()(r[n])?[]:r[n],a="specialty"===n?"":g()(t.props.children,function(e){return e.attrs.type}).join(",");if("specialty"===n){var s=[],u=i[t.props.specialty_layout].columns;v()(y()(u),function(e){var t=[];e+=1;v()(y()(e),function(n){var r=1===e?"4_4":"1_"+e;t.push(r)}),s.push(t.join(","))}),"1_3,2_3"!==t.props.specialty_layout&&"2_3,1_3"!==t.props.specialty_layout||s.splice(2,1),i=s}this.props.setMaxItemIndex(i.length,"modules_all");var c=i.map(function(t,r){var i=t,s=g()(i.split(","),function(e){return e.split("_")}),u={};i===a&&(u["et-fb-column-layout--selected"]=!0),e.props.selectedItemIndex===r+1&&(u["et-fb-selected-item"]=!0),u["et-fb-product-tour-element"]="selectRow"===e.props.currentTourElement&&"1_3,1_3,1_3"===i;var c=s.map(function(e,t){var a={width:parseInt(e[0])/parseInt(e[1])*100+"%"};return o.a.createElement("span",{key:"blocks-"+r+"-"+t,"data-layout":i,className:"column-block-wrap",style:a},o.a.createElement("span",{className:"column-block","data-layout":i,"data-section":n},e[0],"/",e[1]))});return o.a.createElement("li",{className:l()(u),"data-layout":i,onClick:e._onClickAction,onMouseUp:e._onMouseUp,key:"column-"+r},c)});return o.a.createElement("ul",{className:"et-fb-columns-layout"},c)},_onMouseUp:function(e){this._onClickAction(e),d.b.cancelTooltip()},_onClickAction:function(e){var t=e.target.getAttribute("data-layout"),n="specialty"===this.props.row.props.section_parent?"et_pb_row_inner":"et_pb_row";f()(this.props._onClick)?this._changeStructure(e,t):this.props._onClick(t,n)},_changeStructure:function(e,t){e.target.getAttribute("data-layout");d.b.rowColumnChange(this.props.row,t)}});t.a=_},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";var r=n(1),o=n.n(r),i=n(6),a=n.n(i),s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};var l=function(e){var t=e.src,n=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["src"]);return o.a.createElement("video",s({},n,{src:t}))},u=function(e){return o.a.createElement("iframe",e)};u.propTypes={src:a.a.string.isRequired};var c=u,d=n(1093),p=n.n(d),f=n(131),h=n.n(f),g=n(688),m=n.n(g),v=n(1061),b=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};var y=h()(m.a,Object(v.b)("v")),_=function(e){var t,n=e.src,r=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["src"]);return o.a.createElement(c,b({},r,{src:(t=n,Object(v.d)(p()("v",Object(v.c)(t)),"https://www.youtube.com/embed/"+y(t)))}))},k=n(1059),w=n.n(k),C=n(686),S=n.n(C),E=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};var O=h()(w.a,S()("/"),v.a),T=function(e){var t,n=e.src,r=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["src"]);return o.a.createElement(c,E({},r,{src:(t=n,Object(v.d)(Object(v.c)(t),"https://player.vimeo.com/video/"+O(t))),frameBorder:"0"}))},x=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};var M=h()(w.a,S()("/"),v.a),D=function(e){var t,n=e.src,r=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["src"]);return o.a.createElement(c,x({},r,{src:(t=n,Object(v.d)(Object(v.c)(t),"https://www.dailymotion.com/embed/video/"+M(t))),frameBorder:"0"}))},P=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};var N=function(e){var t,n=e.src,r=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["src"]),i=function(e){return null!==e.match(/[^\/]+(\/[^\/]+)+\.[a-z|0-9]{2,5}(\?.+)?$/i)}(t=n)?l:function(e){return null!==e.match(/(https?:\/\/)?(www\.)?youtube\.com/i)}(t)?_:function(e){return null!==e.match(/(https?:\/\/)?(www\.)?vimeo\.com/i)}(t)?T:function(e){return null!==e.match(/(https?:\/\/)?(www\.)?dailymotion\.com/i)}(t)?D:c;return o.a.createElement(i,P({},r,{src:n}))};N.propTypes={src:a.a.string.isRequired};t.a=N},function(e,t,n){"use strict";var r=n(6),o=n.n(r),i=n(1),a=n.n(i),s=n(1054),l=n(8),u={MODULE:"module",MODULE_ITEM:"module_item"},c=n(35),d=n(33),p=n(10),f=n(2),h=n.n(f),g=(n(29),function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}());function m(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var v=!1,b={beginDrag:function(e){return{id:e.id}},endDrag:function(e){p.b.moduleItemDragEnd(e,v),v=!1}},y={hover:function(e,t){var n=t.getItem().id;n!==e.id&&(v=!0,e.moveItem(n,e.id))}},_={connectDragSource:o.a.func.isRequired,connectDropTarget:o.a.func.isRequired,isDragging:o.a.bool.isRequired,id:o.a.any.isRequired,title:o.a.element.isRequired,moveItem:o.a.func.isRequired,_onMouseEnterItem:o.a.oneOfType([o.a.func,o.a.bool]),_onMouseLeaveItem:o.a.oneOfType([o.a.func,o.a.bool])},k=function(e){function t(){var e,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var o=arguments.length,i=Array(o),a=0;a<o;a++)i[a]=arguments[a];return n=r=m(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(i))),r._handleMouseEnter=function(){var e=r.props._onMouseEnterItem;e&&e(r)},r._handleMouseLeave=function(){var e=r.props._onMouseLeaveItem;e&&e(r)},m(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,a.a.Component),g(t,[{key:"componentWillMount",value:function(){h()(this,"props.just_created")&&p.b.openModuleSettings(this)}},{key:"render",value:function(){var e={cursor:"move",opacity:this.props.isDragging?0:1};return this.props.connectDragSource(this.props.connectDropTarget(a.a.createElement("li",{className:"et-fb-settings-module-item",style:e,onMouseEnter:this._handleMouseEnter,onMouseLeave:this._handleMouseLeave},a.a.createElement(c.a,{buttonName:l.a.MODULE_ITEM_EDIT,editingModule:this,className:"et-fb-settings-module-item-button et-fb-settings-module-item-button--edit",small:!0,ink:!1},a.a.createElement(d.a,{icon:"setting",color:"rgb(115, 126, 137)"})),a.a.createElement(c.a,{buttonName:l.a.MODULE_ITEM_COPY,editingModule:this,className:"et-fb-settings-module-item-button et-fb-settings-module-item-button--copy",small:!0,ink:!1},a.a.createElement(d.a,{icon:"copy",color:"rgb(115, 126, 137)"})),a.a.createElement(c.a,{buttonName:l.a.MODULE_ITEM_DELETE,editingModule:this,className:"et-fb-settings-module-item-button et-fb-settings-module-item-button--delete",small:!0,ink:!1},a.a.createElement(d.a,{icon:"delete",color:"rgb(115, 126, 137)"})),a.a.createElement("span",{className:"et-fb-settings-module-item-title"},this.props.title))))}}]),t}();k.propTypes=_,k.defaultProps={_onMouseEnterItem:!1,_onMouseLeaveItem:!1};var w=Object(s.DragSource)(u.MODULE_ITEM,b,function(e,t){return{connectDragSource:e.dragSource(),isDragging:t.isDragging()}}),C=Object(s.DropTarget)(u.MODULE_ITEM,y,function(e){return{connectDropTarget:e.dropTarget()}});t.a=C(w(k))},function(e,t,n){"use strict";n.r(t);var r=n(1),o=n.n(r),i=n(9),a=n.n(i),s=n(149),l=n.n(s),u=n(12),c=n.n(u),d=n(2),p=n.n(d),f=n(89),h=n.n(f),g=n(4),m=n.n(g),v=n(87),b=n.n(v),y=(n(1107),n(0)),_=n(10),k=n(8),w=n(40),C=n(35),S=n(70),E=n(259),O=n(296),T=n(33),x=n(684),M=n(1051),D=n(1049),P=n(3),N=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},L=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var F=y.default.isLimitedMode(),A=y.default.topWindow(),j=ETBuilderBackend.i18n.app.modal,I=520,R=y.default.condition("is_bfb"),B=y.default.condition("is_rtl"),H=R?30:10;function W(e,t){return t[e]?"#5C6978":"#BEC9D6"}function V(e,t){if(t)switch(e){case"hover":return 0;case"click":return 1;case"grid":return 2;default:return 0}else switch(parseInt(e)){case 0:return"hover";case 1:return"click";case 2:return"grid";default:return"hover"}}function G(){return y.default.condition("is_bfb")?"wireframe":"desktop"}function U(e,t){if(t)switch(parseInt(e)){case 1:return 0;case 10:return 1;case 20:return 2;case 30:return 3;case 40:return 4;default:return 0}else switch(parseInt(e)){case 0:return 1;case 1:return 10;case 2:return 20;case 3:return 30;case 4:return 40;default:return 1}}function z(e,t){if(t)switch(e){case"default":return 0;case"minimum":return 1;case"fullscreen":return 2;case"left":return 3;case"right":return 4;case"bottom":return 5;case"top":return 6;default:return 0}else switch(parseInt(e)){case 0:return"default";case 1:return"minimum";case 2:return"fullscreen";case 3:return"left";case 4:return"right";case 5:return"bottom";case 6:return"top";default:return"default"}}function q(e,t){if(t)switch(e){case"default":return 0;case"build_from_scratch":return 1;case"choose_premade_layout":return 2;case"clone_existing_page":return 3;default:return 0}else switch(parseInt(e)){case 0:return"default";case 1:return"build_from_scratch";case 2:return"choose_premade_layout";case 3:return"clone_existing_page";default:return"default"}}var K=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.state={height:635,width:A.innerWidth<I?A.innerWidth-w.a.pageSettingsBar-30:400},e._getPosition=e._getPosition.bind(e),e._handleAnimationChange=e._handleAnimationChange.bind(e),e._handleAllModalSettings=e._handleAllModalSettings.bind(e),e._handleDummyContent=e._handleDummyContent.bind(e),e._handleDisabledModules=e._handleDisabledModules.bind(e),e._handleShortcuts=e._handleShortcuts.bind(e),e._handleResize=e._handleResize.bind(e),e._handleScroll=e._handleScroll.bind(e),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r["Component"]),L(t,[{key:"componentWillMount",value:function(){this._handleResize(),R&&(this.throttleScroll=b()(this._handleScroll,100),A.addEventListener("scroll",this.throttleScroll),y.default.$topWindow().on("et-preview-animation-complete",this._handleResize)),A.addEventListener("resize",this._handleResize)}},{key:"componentDidMount",value:function(){y.default.topDocument().addEventListener("keydown",this._handleShortcuts)}},{key:"componentWillUnmount",value:function(){y.default.topDocument().removeEventListener("keydown",this._handleShortcuts),A.removeEventListener("resize",this._handleResize),R&&(A.removeEventListener("scroll",this.throttleScroll),y.default.$topWindow().off("et-preview-animation-complete",this._handleResize))}},{key:"_getModalOptions",value:function(){return R?h()(j.modal_default_select,[0,1,2,4]):F?j.modal_default_select.slice(0,-3):j.modal_default_select}},{key:"_getPosition",value:function(e){var t=this.props.pageSettingsBarLocation,n=a()(["top-left","top-right"],t),r="top"===t,o="right"===t,i="left"===t,s=a()(["top-right","bottom-right"],t),l=w.a.responsive.phone>A.innerWidth,u=l?0:w.a.pageSettingsBar,c=l?0:30,d=!!R&&y.default.$topWindow("#et_pb_layout");if("top"===e){if(R&&d){var f=y.default.$topWindow().scrollTop();return p()(d.offset(),"top",0)+d.find("h2.hndle").outerHeight()+H-f}return i||o?w.a.topbar.desktop+c:r?u+w.a.topbar.desktop:n?u+w.a.topbar.desktop:"auto"}return"bottom"===e?R?"auto":r||n||i||o?"auto":u:"right"===e?R?B?"auto;":y.default.$topWindow().width()-(p()(d.offset(),"left",0)+d.width())+10:s||o?u:i?"auto":!!y.default.condition("is_rtl")&&c:"left"===e?R?B?p()(d.offset(),"left",0)+10:"auto":i?u:s||o?"auto":n?u:!(!r&&y.default.condition("is_rtl"))&&c:void 0}},{key:"_handleScroll",value:function(){this._handleResize()}},{key:"_handleShortcuts",value:function(e){27===e.keyCode&&_.b.buttonClick({props:{buttonName:k.a.MODAL_APP_BUTTON_CLOSE}})}},{key:"_handleResize",value:function(){var e=R?y.default.$topWindow("#et_pb_layout").offset().top:0,t=R?y.default.$topWindow().scrollTop():0,n=R?96:146;A.innerHeight<940+n+(e-t)+30?A.innerHeight<200?this.setState({height:100}):this.setState({height:A.innerHeight-n-30-e+t}):this.setState({height:940})}},{key:"_handleAnimationChange",value:function(){var e=this.props.builderAnimation;_.b.preferencesChange({builder_animation:!e})}},{key:"_handleDisabledModules",value:function(){var e=this.props.builderHideDisabledModules;_.b.preferencesChange({hide_disabled_modules:!e})}},{key:"_handleAllModalSettings",value:function(){var e=this.props.builderDisplayModalSettings;_.b.preferencesChange({builder_display_modal_settings:!e})}},{key:"_handleDummyContent",value:function(){var e=this.props.builderEnableDummyContent;_.b.preferencesChange({builder_enable_dummy_content:!e})}},{key:"_handleEventModeChange",value:function(e,t){_.b.preferencesChange({event_mode:V(t)})}},{key:"_handleViewModeChange",value:function(e,t){var n=m()(t)?G():t;_.b.preferencesChange({view_mode:n})}},{key:"_handleHistoryChange",value:function(e,t){_.b.preferencesChange({history_intervals:U(t)})}},{key:"_handlePageCreationFlowChange",value:function(e,t){_.b.preferencesChange({page_creation_flow:q(t)})}},{key:"_handleModalChange",value:function(e,t){_.b.preferencesChange({modal_preference:z(t)})}},{key:"_handleReset",value:function(e,t,n){return e!==t&&o.a.createElement(C.a,{__onClick:n},o.a.createElement(T.a,{icon:"reset"}))}},{key:"_getViewModesList",value:function(){var e=y.default.condition("is_bfb"),t=j.view_mode_select;if(e){var n=t.wireframe;l()(t.wireframe),t=c()({wireframe:n},t)}return t}},{key:"render",value:function(){var e=this.props,t=e.builderAnimation,n=e.builderDisplayModalSettings,r=e.builderEnableDummyContent,i=e.builderEventMode,s=e.builderViewMode,l=e.builderHideDisabledModules,u=e.builderModalPreference,c=e.builderPageCreationFlow,d=e.historyIntervals,f=e.toolbarButtons,h=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["builderAnimation","builderDisplayModalSettings","builderEnableDummyContent","builderEventMode","builderViewMode","builderHideDisabledModules","builderModalPreference","builderPageCreationFlow","historyIntervals","toolbarButtons"]),g=this.state,m=g.height,v=g.width,b=P.a.getAppPreferences();return o.a.createElement(x.a,N({className:"et-fb-modal--app",forceUpdate:!0,headerButtons:[o.a.createElement(C.a,{buttonName:k.a.MODAL_APP_BUTTON_CLOSE,inverse:!0,tooltip:ETBuilderBackend.i18n.tooltip.modal.cancel},o.a.createElement(T.a,{icon:"exit",color:"#FFFFFF"}))],label:j.title,measurement:{height:m,width:v},style:{top:this._getPosition("top"),bottom:this._getPosition("bottom"),left:this._getPosition("left"),right:this._getPosition("right")}},h),o.a.createElement(O.c,{selected:!0},o.a.createElement("div",{className:"et-fb-form"},o.a.createElement(E.b,null,o.a.createElement(E.c,null,j.labels.toolbar),o.a.createElement(S.a,null,o.a.createElement(C.a,{additionalAttrs:{toolbarButton:"wireframe"},buttonName:k.a.TOGGLE_TOOLBAR_BUTTON,stopPropagation:!0,style:{background:"#F2F6F9"}},o.a.createElement(T.a,{color:W("wireframe",f),icon:"wireframe"})),o.a.createElement(C.a,{additionalAttrs:{toolbarButton:"zoom"},buttonName:k.a.TOGGLE_TOOLBAR_BUTTON,stopPropagation:!0,style:{background:"#F2F6F9"}},o.a.createElement(T.a,{color:W("zoom",f),icon:"zoom-in"})),o.a.createElement(C.a,{additionalAttrs:{toolbarButton:"desktop"},buttonName:k.a.TOGGLE_TOOLBAR_BUTTON,style:{background:"#F2F6F9"}},o.a.createElement(T.a,{color:W("desktop",f),icon:"desktop"})),o.a.createElement(C.a,{additionalAttrs:{toolbarButton:"tablet"},buttonName:k.a.TOGGLE_TOOLBAR_BUTTON,style:{background:"#F2F6F9"}},o.a.createElement(T.a,{color:W("tablet",f),icon:"tablet"})),o.a.createElement(C.a,{additionalAttrs:{toolbarButton:"phone"},buttonName:k.a.TOGGLE_TOOLBAR_BUTTON,style:{background:"#F2F6F9"}},o.a.createElement(T.a,{color:W("phone",f),icon:"phone"}))),o.a.createElement(S.a,{style:y.default.condition("is_rtl")?{marginRight:3}:{marginLeft:3}},o.a.createElement(C.a,{additionalAttrs:{toolbarButton:"hover"},buttonName:k.a.TOGGLE_TOOLBAR_BUTTON,style:{background:"#F2F6F9"}},o.a.createElement(T.a,{color:W("hover",f),icon:"hover"})),o.a.createElement(C.a,{additionalAttrs:{toolbarButton:"click"},buttonName:k.a.TOGGLE_TOOLBAR_BUTTON,style:{background:"#F2F6F9"}},o.a.createElement(T.a,{color:W("click",f),icon:"click"})),o.a.createElement(C.a,{additionalAttrs:{toolbarButton:"grid"},buttonName:k.a.TOGGLE_TOOLBAR_BUTTON,style:{background:"#F2F6F9"}},o.a.createElement(T.a,{color:W("grid",f),icon:"grid"})))),o.a.createElement(E.b,null,o.a.createElement(E.c,null,j.labels.view_mode),o.a.createElement("div",{className:"et-fb-settings-option"},o.a.createElement("div",{className:"et-fb-settings-option-container"},o.a.createElement(M.a,{name:"builder_view_mode",value:s,options:this._getViewModesList(),_onChange:this._handleViewModeChange}),s!==G()&&""!==s&&o.a.createElement(C.a,{className:"et-fb-button--reset",__onClick:this._handleViewModeChange,small:!0},o.a.createElement(T.a,{icon:"reset"}))))),o.a.createElement(E.b,null,o.a.createElement(E.c,null,j.labels.interaction_mode),o.a.createElement("div",{className:"et-fb-settings-option"},o.a.createElement("div",{className:"et-fb-settings-option-container"},o.a.createElement(M.a,{name:"view_mode",value:V(i,!0),options:j.interaction_mode_select,_onChange:this._handleEventModeChange}),!a()(["","hover","default"],i)&&o.a.createElement(C.a,{className:"et-fb-button--reset",__onClick:this._handleEventModeChange,small:!0},o.a.createElement(T.a,{icon:"reset"}))))),o.a.createElement(E.b,null,o.a.createElement(E.c,null,j.labels.history),o.a.createElement("div",{className:"et-fb-settings-option"},o.a.createElement("div",{className:"et-fb-settings-option-container"},o.a.createElement(M.a,{name:"history",value:U(d,!0),options:j.history_intervals_select,_onChange:this._handleHistoryChange}),1!==d&&o.a.createElement(C.a,{className:"et-fb-button--reset",__onClick:this._handleHistoryChange,small:!0},o.a.createElement(T.a,{icon:"reset"}))))),o.a.createElement(E.b,null,o.a.createElement(E.c,null,j.labels.modal_position),o.a.createElement("div",{className:"et-fb-settings-option"},o.a.createElement("div",{className:"et-fb-settings-option-container"},o.a.createElement(M.a,{name:"modal_position",value:z(u,!0),options:this._getModalOptions(),_onChange:this._handleModalChange}),"default"!==u&&o.a.createElement(C.a,{className:"et-fb-button--reset",__onClick:this._handleModalChange,small:!0},o.a.createElement(T.a,{icon:"reset"}))))),o.a.createElement(E.b,null,o.a.createElement(E.c,null,j.labels.page_creation_flow),o.a.createElement("div",{className:"et-fb-settings-option"},o.a.createElement("div",{className:"et-fb-settings-option-container"},o.a.createElement(M.a,{name:"page_creation",value:q(c,!0),options:j.page_creation_flow_select,_onChange:this._handlePageCreationFlowChange}),"default"!==c&&o.a.createElement(C.a,{className:"et-fb-button--reset",__onClick:this._handlePageCreationFlowChange,small:!0},o.a.createElement(T.a,{icon:"reset"}))))),o.a.createElement(E.b,null,o.a.createElement(E.c,null,j.labels.animation),o.a.createElement("div",{className:"et-fb-settings-option"},o.a.createElement("div",{className:"et-fb-settings-option-container"},o.a.createElement(D.a,{onClick:this._handleAnimationChange,options:{on:j.builder_animation_toggle.on,off:j.builder_animation_toggle.off},value:t?"on":"off"}),t!==p()(b,"builder_animation.default")&&o.a.createElement(C.a,{className:"et-fb-button--reset",__onClick:this._handleAnimationChange,small:!0},o.a.createElement(T.a,{icon:"reset"}))))),o.a.createElement(E.b,null,o.a.createElement(E.c,null,j.labels.disabled_modules),o.a.createElement("div",{className:"et-fb-settings-option"},o.a.createElement("div",{className:"et-fb-settings-option-container"},o.a.createElement(D.a,{onClick:this._handleDisabledModules,options:{on:j.hide_disabled_module_toggle.on,off:j.hide_disabled_module_toggle.off},value:l?"off":"on"}),l!==p()(b,"hide_disabled_modules.default")&&o.a.createElement(C.a,{className:"et-fb-button--reset",__onClick:this._handleDisabledModules,small:!0},o.a.createElement(T.a,{icon:"reset"}))))),o.a.createElement(E.b,null,o.a.createElement(E.c,null,j.labels.group_settings),o.a.createElement("div",{className:"et-fb-settings-option"},o.a.createElement("div",{className:"et-fb-settings-option-container"},o.a.createElement(D.a,{onClick:this._handleAllModalSettings,options:{on:j.display_modal_settings.on,off:j.display_modal_settings.off},value:n?"off":"on"}),n!==p()(b,"builder_display_modal_settings.default")&&o.a.createElement(C.a,{className:"et-fb-button--reset",__onClick:this._handleAllModalSettings,small:!0},o.a.createElement(T.a,{icon:"reset"}))))),o.a.createElement(E.b,null,o.a.createElement(E.c,null,j.labels.dummy_content),o.a.createElement("div",{className:"et-fb-settings-option"},o.a.createElement("div",{className:"et-fb-settings-option-container"},o.a.createElement(D.a,{onClick:this._handleDummyContent,options:{on:j.enable_dummy_content.on,off:j.enable_dummy_content.off},value:r?"on":"off"}),r!==p()(b,"builder_enable_dummy_content.default")&&o.a.createElement(C.a,{className:"et-fb-button--reset",__onClick:this._handleDummyContent,small:!0},o.a.createElement(T.a,{icon:"reset"}))))))))}}]),t}();K.propTypes={},K.defaultProps={toolbarButtons:{}},t.default=K},function(e,t,n){"use strict";n.r(t),function(e){var r=n(1),o=n.n(r),i=n(6),a=n.n(i),s=n(17),l=n(18),u=n.n(l),c=n(61),d=n.n(c),p=n(36),f=n.n(p),h=n(210),g=n.n(h),m=n(101),v=n.n(m),b=n(31),y=n.n(b),_=(n(57),n(38),n(11)),k=n.n(_),w=n(7),C=n.n(w),S=n(39),E=n.n(S),O=n(95),T=n.n(O),x=n(76),M=n.n(x),D=n(9),P=n.n(D),N=n(4),L=n.n(N),F=n(250),A=n.n(F),j=n(19),I=n.n(j),R=n(41),B=n.n(R),H=n(53),W=n.n(H),V=n(45),G=n.n(V),U=n(50),z=n.n(U),q=n(2),K=n.n(q),$=(n(89),n(12)),X=n.n($),Y=n(30),J=n.n(Y),Q=n(71),Z=n.n(Q),ee=n(96),te=n.n(ee),ne=(n(47),n(74)),re=n.n(ne),oe=n(43),ie=n.n(oe),ae=n(72),se=n.n(ae),le=n(44),ue=n.n(le),ce=n(83),de=n.n(ce),pe=n(297),fe=n.n(pe),he=n(185),ge=n.n(he),me=n(80),ve=n.n(me),be=n(67),ye=n.n(be),_e=(n(125),n(27),n(77),n(512)),ke=n.n(_e),we=n(355),Ce=n.n(we),Se=n(219),Ee=n.n(Se),Oe=n(174),Te=n.n(Oe),xe=n(249),Me=n.n(xe),De=(n(48),n(0)),Pe=n(15),Ne=n(8),Le=n(40),Fe=n(10),Ae=n(3),je=n(21),Ie=n(687),Re=n(684),Be=n(33),He=n(692),We=n(35),Ve=n(1065),Ge=n(296),Ue=n(259),ze=n(1110),qe=n(1112),Ke=n(1050),$e=n(1234),Xe=n(82),Ye=n(16),Je=n(1103),Qe=n(140),Ze=n(694),et=n(695),tt=n(20),nt=n(63),rt=n(1053),ot=n(24),it=(n(81),function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}()),at=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},st=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function lt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ut(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var ct=e(".et_fb_preview_container"),dt=ue()(function(){ct.removeClass("et_fb_preview_container__disable_animations")},1500),pt=je.a.getBackgroundFieldsNames(),ft=function(e){var t=Pe.a.getFieldBaseName(e).split("_");return"padding"===t[0]&&T()(parseInt(t[1]))&&2===t.length},ht=function(e){return ft(e)?Pe.a.getFieldBaseName(e).split("_")[1]:NaN},gt=function(e){return["padding_top_"+e,"padding_right_"+e,"padding_bottom_"+e,"padding_left_"+e]},mt=function(e,t){var n=t[e+"_last_edited"],r=L()(n)?["off","desktop"]:n.split("|");return!L()(r[0])&&"on"===r[0]},vt=new(function(){function e(){ut(this,e),this.reset()}return st(e,[{key:"reset",value:function(){this.type="",this.data={},this.elementsType="",this.elementsData={}}},{key:"has",value:function(e,t){return e===this.type&&y()(this.data,t)}},{key:"get",value:function(e,t){return e===this.type?K()(this.data,t):void 0}},{key:"set",value:function(e,t,n){return e!==this.type&&(this.data={},this.type=e),ie()(this.data,t,n),!1}},{key:"hasElements",value:function(e,t){return e===this.elementsType&&y()(this.elementsData,t)}},{key:"getElements",value:function(e,t){return e===this.elementsType&&K()(this.elementsData,t)}},{key:"setElements",value:function(e,t,n){return e!==this.elementsType&&(this.elementsData={},this.elementsType=e),ie()(this.elementsData,t,n),!1}}]),e}());function bt(e,t){var n=t?"general_fields__"+t:e;if(vt.has(e,n))return vt.get(e,n);var r=Ae.a.filterUserFields(je.a.getComponentFields(t||e));return vt.set(e,n,r),r}function yt(e){if(vt.has(e,"advanced_fields"))return vt.get(e,"advanced_fields");var t=Ae.a.filterUserFields(je.a.getComponentAdvancedFields(e));return vt.set(e,"advanced_fields",t),t}function _t(e){if(vt.has(e,"css_fields"))return vt.get(e,"css_fields");var t=Ae.a.filterUserFields(je.a.getComponentCSSFields(e));return vt.set(e,"css_fields",t),t}function kt(){return Ae.a.getAppPreference("modal_snap")}function wt(){return Ae.a.getAppPreference("modal_snap_location")}var Ct=function(e,t,n){var r=K()(n,e,"");return C()(r)||r===K()(t,"default","")},St={isVisible:a.a.oneOfType([a.a.array,a.a.bool,a.a.object]),module:a.a.oneOfType([a.a.array,a.a.object,a.a.bool]),onModalChange:a.a.func},Et=je.a.shouldInheritParentDefaults,Ot=je.a.inheritParentDefaults,Tt=function(t){function n(e){ut(this,n);var t=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));if(t._onComponentFieldDefinitionsChange=function(e,n){vt.reset(),e===K()(t,"props.module.type")?t.setState({generalFields:n}):t.forceUpdate()},t._isDescriptionVisible=function(e){return t.state.activeDescription===e},t.optionsWithContext=Te()(function(){return function e(t){return g()(t,function(t,n,r){switch(n.type){case"composite":return g()(K()(n,"composite_structure",{}),function(t,n){return at({},t,e(K()(n,"controls",{})))},t);default:return n.context?at({},t,lt({},r,n.context)):t}},{})}(at({},K()(t.state,"advancedFields",{}),K()(t.state,"cssFields",{}),K()(t.state,"generalFields",{})))}),t.optionContext=function(e){return K()(t.optionsWithContext(),e)},t._isHoveredGroup=function(e){var n=Me()(t.state.hoveredGroup).filter(De.default.hasValue).map(Pe.a.getFieldBaseName),r=Pe.a.getFieldBaseName(e);return!!P()(n,r)||!!n.map(t.optionContext).find(function(e){return Pe.a.getFieldBaseName(e)===r})},t._onChangeCacheReset=function(){return vt.reset()},t._onMouseEnterGroup=function(e,n,r,o,i){t.hoverStarted=(new Date).getTime(),De.default.appWindow().clearTimeout(De.default.appWindow().ETBuilderFormGroupMouseEnterTimeout),De.default.appWindow().clearTimeout(t.mouseLeaveTimeout),De.default.appWindow().ETBuilderFormGroupMouseEnterTimeout=setTimeout(function(){t.setState({hoveredGroup:e})},200);var a=Qe.a.getHelper("option").preparePayload(e,n,r,t.props.module,o,i);t._setHoveredElement("option",e,a)},t._onMouseLeaveGroup=function(e,n){if(De.default.appWindow().clearTimeout(De.default.appWindow().ETBuilderFormGroupMouseEnterTimeout),De.default.appWindow().clearTimeout(t.mouseLeaveTimeout),t.state.hoveredGroup===e){(new Date).getTime()-t.hoverStarted>600?t.mouseLeaveTimeout=setTimeout(function(){return t.setState({hoveredGroup:null})},300):t.setState({hoveredGroup:null})}t._setHoveredElement(!1)},t._onMouseEnterTitle=function(){var e=t.props.module;Fe.b.setHoveredModuleElement(e)},t._onMouseLeaveTitle=function(){Fe.b.setHoveredElement(!1)},t._onClickHelp=function(e){e=Pe.a.getFieldBaseName(e);var n=t.state.activeDescription===e?null:e;t.setState({activeDescription:n})},t._onSwitchTab=function(e,n,r){var o=t.state.toggleTabs,i=[e,n];K()(o,i)!==r&&t.setState({toggleTabs:ie()(at({},o),i,r)})},t._setHoveredElement=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Fe.b.setHoveredElement(e,t,n)},t.module_type=K()(e,"module.props.type",null),t.state=X()({activeDescription:null,activeHover:null,activeHoverField:null,hoveredGroup:null,openedToggle:"main_content",openedGeneralGroup:"main_content",openedDesignGroup:"",openedCSSGroup:"",advancedFields:t.module_type&&yt(t.module_type),generalFields:t.module_type&&bt(t.module_type),cssFields:t.module_type&&_t(t.module_type),filterOptions:e.filterOptions||"",filterSelected:e.filterSelected,filterNotice:!1,toggleTabs:{}},t.getCustomTabsFields(t.module_type)),t.setting_resolver=new Ze.a(t.props.module,{},"props.attrs."),!K()(t,"props.module.props.is_official_module")){var r=t.maybeGetFirstOpenedToggle();r&&(t.state.openedToggle=r,t.state.openedGeneralGroup=r)}return t._hasColumnsFields=t._hasColumnsFields.bind(t),t._onChange=t._onChange.bind(t),t._resetOption=t._resetOption.bind(t),t._isResetActive=t._isResetActive.bind(t),t._onClickHelp=t._onClickHelp.bind(t),t._onClickHover=t._onClickHover.bind(t),t._onClickResponsive=t._onClickResponsive.bind(t),t._onClickReset=t._onClickReset.bind(t),t._onMouseEnterGroup=t._onMouseEnterGroup.bind(t),t._onMouseLeaveGroup=t._onMouseLeaveGroup.bind(t),t._onClickToggle=t._onClickToggle.bind(t),t._handleFormSubmission=t._handleFormSubmission.bind(t),t._unsyncGlobalSetting=t._unsyncGlobalSetting.bind(t),t._unsyncGlobalContent=t._unsyncGlobalContent.bind(t),t._onFilterInput=t._onFilterInput.bind(t),t._onFilterSelect=t._onFilterSelect.bind(t),t._onFilterDropdownToggle=t._onFilterDropdownToggle.bind(t),t._onFilterReset=t._onFilterReset.bind(t),t._onFilterResetAll=t._onFilterResetAll.bind(t),t._onGoToOption=t._onGoToOption.bind(t),t._isOptionMatchesFilter=t._isOptionMatchesFilter.bind(t),t._setSearchFocus=t._setSearchFocus.bind(t),t._handleShortcuts=t._handleShortcuts.bind(t),t._onComponentAdvancedFieldDefinitionChange=t._onComponentAdvancedFieldDefinitionChange.bind(t),t._onComponentFieldDefinitionChange=t._onComponentFieldDefinitionChange.bind(t),t._onComponentCSSFieldDefinitionChange=t._onComponentCSSFieldDefinitionChange.bind(t),t._getOptionsFields=t._getOptionsFields.bind(t),t.getTabsCount=t.getTabsCount.bind(t),t.maybeGetFirstOpenedToggle=t.maybeGetFirstOpenedToggle.bind(t),t._onQuickAccessActive=t._onQuickAccessActive.bind(t),t._setHoveredToggleElement=t._setHoveredToggleElement.bind(t),t._setHoveredSubToggleElement=t._setHoveredSubToggleElement.bind(t),t.productTourOptionToggle=!1,t.builder_display_modal_settings=Ae.a.getAppPreference("builder_display_modal_settings"),t.updatedAttrs={},t.mouseLeaveTimeout=0,t.hoverStarted=0,t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,r["Component"]),st(n,[{key:"componentWillMount",value:function(){vt.reset(),je.a.addComponentAdvancedFieldDefinitionChangeListener(this._onComponentAdvancedFieldDefinitionChange),je.a.addComponentFieldDefinitionChangeListener(this._onComponentFieldDefinitionChange),je.a.addComponentFieldDefinitionsChangeListener(this._onComponentFieldDefinitionsChange),je.a.addComponentCSSFieldDefinitionChangeListener(this._onComponentCSSFieldDefinitionChange),Ae.a.addGoToOptionListener(this._onGoToOption),Ae.a.addQuickAccessActiveListener(this._onQuickAccessActive),this._onChangeCacheReset=ue()(this._onChangeCacheReset,400,{leading:!0,trailing:!1})}},{key:"componentDidMount",value:function(){De.default.topWindow().document.addEventListener("keydown",this._handleShortcuts),this.setState({tabsCount:this.getTabsCount()}),this.searchField=e(Object(s.findDOMNode)(this)).find(".et-fb-options-filter input"),this._setSearchFocus()}},{key:"componentDidUpdate",value:function(e,t){var n=this.props;if(K()(n,"module.props.address","")!==K()(e,"module.props.address","")){var r=K()(e,"module.props.is_module_child"),o=this.maybeGetFirstOpenedToggle(r);o&&this.setState({openedToggle:o})}n.isVisible&&!e.isVisible&&(this.setState({filterOptions:"",openedToggle:"main_content",filterSelected:void 0,filterDropdownActive:!1,filterNotice:!1}),this.productTourOptionToggle=!1,this._setSearchFocus()),this.maybeShowFilterNotice()}},{key:"componentWillReceiveProps",value:function(e){C()(e.optionsFilter)||vt.reset();var t=K()(e,"module.props.type");if(e.module&&this.props.module.type!==t&&!E()(this.props,e)){var n=yt(e.module.props.type),r=bt(e.module.props.type),o=_t(e.module.props.type),i=this.getCustomTabsFields(e.module.props.type);this.setState(at({advancedFields:n,generalFields:r,cssFields:o},i)),this.setting_resolver.source_object=t}}},{key:"componentWillUpdate",value:function(e){if(!E()(K()(this,"props.isVisible"),K()(e,"isVisible"))){var t=Ae.a.getAppPreference("builder_display_modal_settings"),n=K()(e,"module.props.type");if(t&&!L()(n)){var r=Z()(je.a.getComponentFieldsByTypes(n,["custom_margin","custom_padding","range"]));Fe.b.setListenerQuotaForGroup("settings-modal",r)}}}},{key:"componentWillUnmount",value:function(){Fe.b.settingFieldFocused(!1),De.default.appWindow().clearTimeout(De.default.appWindow().ETBuilderFormGroupMouseEnterTimeout),De.default.appWindow().clearTimeout(this.mouseLeaveTimeout),dt.flush(),je.a.removeComponentAdvancedFieldDefinitionChangedListener(this._onComponentAdvancedFieldDefinitionChange),je.a.removeComponentFieldDefinitionChangedListener(this._onComponentFieldDefinitionChange),je.a.removeComponentFieldDefinitionsChangedListener(this._onComponentFieldDefinitionsChange),je.a.removeComponentCSSFieldDefinitionChangedListener(this._onComponentCSSFieldDefinitionChange),Ae.a.removeQuickAccessActiveListener(this._onQuickAccessActive),De.default.topWindow().document.removeEventListener("keydown",this._handleShortcuts),clearTimeout(this.focusTimer),clearTimeout(this.filterNoticeTimer),clearTimeout(this.filterTimer),clearTimeout(this.goToOptionTimer),clearTimeout(this.quickAccessScrollUp),clearTimeout(this.quickAccessOpenToggle),Ae.a.removeGoToOptionListener(this._onGoToOption)}},{key:"maybeGetFirstOpenedToggle",value:function(e){var t=this.props.module,n=K()(t,"props.type"),r=this._getNonEmptyToggles(n,"general.toggles","general"),o=K()(r,"toggles"),i=K()(o,this.state.openedToggle);if(e){var a=K()(t,"props.module_items_config",{}),s=K()(a,"toggle_slug");if(s)return s;if(!i)return"main_content"}if(i)return!1;if(!o)return!1;var l=f()(o,function(e,t){var n=B()(e)?e:{title:e,priority:10};return n.name=t,n}),u=ge()(l,"priority","asc");return K()(ve()(u),"name","main_content")}},{key:"_handleShortcuts",value:function(e){var t=this,n=e.metaKey,r=e.altKey,o=e.ctrlKey,i=27===e.keyCode,a=e.shiftKey,l=32===e.keyCode,u=De.default.$topWindow(Object(s.findDOMNode)(this)).find(".et-fb-options-filter input"),c=u.length>0&&u.is(":focus");if(!(c&&a&&l))return i&&""!==this.state.filterOptions||i&&De.default.hasValue(this.state.filterSelected)?(e.preventDefault(),this.filterTimer=setTimeout(function(){t.setState({filterOptions:"",filterSelected:void 0,filterDropdownActive:!1,filterNotice:!1})},300),!1):void(!c||n||r||o||27===e.keyCode||e.stopPropagation());e.preventDefault()}},{key:"_onComponentAdvancedFieldDefinitionChange",value:function(e,t,n){var r=X()({},this.state.advancedFields);ie()(r,[e,t],n),this.setState({advancedFields:r})}},{key:"_onComponentFieldDefinitionChange",value:function(e,t,n){var r=X()({},this.state.generalFields);ie()(r,[e,t],n),vt.reset(),this.setState({generalFields:r})}},{key:"_onComponentCSSFieldDefinitionChange",value:function(e,t,n){var r=X()({},this.state.cssFields);ie()(r,[e,t],n),this.setState({cssFields:r})}},{key:"getCustomTabsList",value:function(){var e=function(e){if(vt.has(e,"module_custom_tabs"))return vt.get(e,"module_custom_tabs");var t=je.a.getComponentCustomTabs(e);return vt.set(e,"module_custom_tabs",t),t}(this.props.module.props.type);return!C()(e)&&e}},{key:"getCustomTabsFields",value:function(e){var t=this.getCustomTabsList();if(!t)return!1;var n={};return k()(t,function(t,r){n[r+"Fields"]=function(e,t){if(vt.has(e,"custom_tab-"+t))return vt.get(e,"custom_tab-"+t);var n=Ae.a.filterUserFields(je.a.getComponentCustomTabFields(e,t));return vt.set(e,"custom_tab-"+t,n),n}(e,r)}),n}},{key:"getModule",value:function(){return this.props.module}},{key:"getBulk",value:function(){var e=this.getModule(),t=K()(e,"props.address");return C()(e)?{}:Ae.a.isMultiItemSelected(t)?Ae.a.getMultiSelectItemsData():lt({},t,e)}},{key:"_isVisible",value:function(e,t){var n=this,r=this.props.module,o=[];return k()(e.depends_on,function(i){var a=Pe.a.isEnabled(i,r.props.attrs),s=Ae.a.getHoverMode(),l=i;i=!0===a&&!0===s?Pe.a.getHoverField(i):i;var u=K()(t[i],"type","");if(K()(t[i],"depends_on",!1)&&!n._isVisible(t[i],t))return!1;var c=K()(r.props.attrs,i,K()(t[i],"default",""));if(a&&s&&L()(c)&&(c=K()(t[l],"default",K()(t[l],"shortcode_default"))),"upload"!==u&&"text"!==u||""===c||(c="on"),L()(e.depends_show_if)||c!==e.depends_show_if||o.push(i),!L()(e.depends_show_if_not)){var d=e.depends_show_if_not;if(y()(e,"depends_on_responsive")&&P()(e.depends_on_responsive,i)){var p=K()(r,["props","attrs",i],""),f=K()(r,["props","attrs",i+"_tablet"],""),h=K()(r,["props","attrs",i+"_phone"],"");De.default.getResponsiveStatus(K()(r,["props","attrs",i+"_last_edited"]))?P()(d,p)&&P()(d,f)&&P()(d,h)||o.push(i):P()(d,p)||o.push(i)}else{(I()(d)?!P()(d,c):c!==d)&&o.push(i)}}}),!C()(o)}},{key:"_isModuleItemSettings",value:function(){return!L()(this.props.module.isModuleItem)}},{key:"_isModalExpanded",value:function(){var e=wt(),t=kt(),n=Ae.a.getAppPreference("modal_dimension_width"),r=P()(["top","bottom"],e),o=De.default.topWindow().innerWidth<Le.a.responsive.phone;return(t&&r&&De.default.topWindow().innerWidth>1200||n>1200)&&!o}},{key:"_isToggleOpened",value:function(e,t){var n="general"===t,r="design"===t,o="css"===t,i=this._isModalExpanded();if(t&&i){if(n)return this.state.openedGeneralGroup===e;if(r)return this.state.openedDesignGroup===e;if(o)return this.state.openedCSSGroup===e}return this.state.openedToggle===e}},{key:"_hasColumnsFields",value:function(){var e=this.props.module.props.type,t=this.props.module.props.attrs,n=De.default.isOn(t.specialty)&&"et_pb_section"===e;return P()(["et_pb_row","et_pb_row_inner"],e)||n}},{key:"_hasModuleItem",value:function(){return!G()(this.props.module.props.child_slug)&&!L()(this.props.module.props.child_slug)}},{key:"exitHoverMode",value:function(){Ae.a.getHoverMode()&&(Fe.b.toggleModuleHover(!1),Fe.b.moduleSettingsChange(this.props.module,"hover_enabled",0))}},{key:"_onChange",value:function(e,t,n,r,o){this._onChangeCacheReset(),this.updatedAttrs[e]=t;var i=K()(this.props.module,"props.address"),a=Ae.a.isMultiItemSelected(i);if("raw_content"===e)return this.exitHoverMode(),void(a?Fe.b.multiSelectContentChange(this.props.module,t):Fe.b.moduleContentChange(this.props.module,t));var s=e.split("_"),l="padding_mobile"!==e&&"padding"===s[0]&&2===s.length;if(r)!L()(this.props.module)&&this.props.module&&(this.exitHoverMode(),a?Fe.b.multiSelectContentChange(this.props.module,t):Fe.b.moduleContentChange(this.props.module,t));else{L()(this.props.module)||L()(this.props.module.props)||"et_pb_social_media_follow_network"!==this.props.module.props.type||"social_network"!==e||(a?Fe.b.multiSelectContentChange(this.props.module,t):Fe.b.moduleContentChange(this.props.module,t));var u=P()(["custom_css_before","custom_css_main_element","custom_css_after"],e)?e.replace("custom_css_",""):e,c=this.getModule(),d=K()(c,"props.attrs"),p=Ae.a.getHoverMode(),h=this._getAllOptionsFields()[u],g=L()(h)||L()(h.depends_on)?e:h.depends_on[0],m=!L()(h)&&!!h.hover&&(Pe.a.isEnabled(e,d)||Pe.a.isEnabled(g,d)),v=!0===p&&!0===m?Pe.a.hoverSuffix():"",b=K()(this,"props.module.props.type"),_=K()(this,"props.module.props.attrs."+e);if(z()(b,"et_pb_signup")){var k=ETBuilderBackend.emailPredefinedCustomFields,w=K()(this,"props.module"),C=K()(w,"props.attrs"),S=K()(w,"parentModule.props.attrs"),E=bt("et_pb_signup"),O=K()(E,"provider.default"),T=K()(C,"provider",K()(S,"provider",O)),x=K()(C,T+"_list",K()(S,T+"_list","")).split("|"),M=it(x,2),D=M[0],N=M[1];if("et_pb_signup"===b){var F=y()(k,[T,D,N]),A=!1;"provider"===e&&t!==_?A=!0:F&&T+"_list"===e&&t!==_&&(A=!0),A&&Fe.b.deleteModuleChildren(K()(this,"props.module.props.address"))}else if("et_pb_signup_custom_field"===b&&z()(e,"predefined_field_")&&t!==_){a?Fe.b.multiSelectSettingsChange(w,"predefined_field",t):Fe.b.moduleSettingsChange(w,"predefined_field",t);var j=[T,D];y()(k,[T,D,"custom_fields"])?j.push("custom_fields"):j.push(N),j.push(t);var I=K()(k,j);if(I){if(I.field_id!==C.field_id&&(a?Fe.b.multiSelectSettingsChange(w,"field_id",I.field_id.toString()):Fe.b.moduleSettingsChange(w,"field_id",I.field_id.toString())),I.name!==C.field_title&&(a?Fe.b.multiSelectSettingsChange(w,"field_title",I.name):Fe.b.moduleSettingsChange(w,"field_title",I.name)),!L()(I.hidden)||"on"===K()(w,"props.attrs.hidden")){var R=I.hidden?"on":"off";R!==C.hidden&&(a?Fe.b.multiSelectSettingsChange(w,"hidden",R):Fe.b.moduleSettingsChange(w,"hidden",R))}if("any"!==I.type&&I.type!==C.field_type&&(a?Fe.b.multiSelectSettingsChange(w,"field_type",I.type):Fe.b.moduleSettingsChange(w,"field_type",I.type),I.options)){var B=f()(I.options,function(e,t){return{checked:0,value:e,id:t}});a?Fe.b.multiSelectSettingsChange(w,I.type+"_options",JSON.stringify(B)):Fe.b.moduleSettingsChange(w,I.type+"_options",JSON.stringify(B))}}}}if(l){var H=s[1],V=W()(t)?t.split("|"):["","","","","",""],G=L()(V[0])?"":V[0],U=L()(V[1])?"":V[1],q=L()(V[2])?"":V[2],$=L()(V[3])?"":V[3],X=L()(V[4])?"":V[4],Y=L()(V[5])?"":V[5];a?(Fe.b.multiSelectSettingsChange(this.props.module,"padding_top_"+H+v,G,null,n),Fe.b.multiSelectSettingsChange(this.props.module,"padding_right_"+H+v,U,null,n),Fe.b.multiSelectSettingsChange(this.props.module,"padding_bottom_"+H+v,q,null,n),Fe.b.multiSelectSettingsChange(this.props.module,"padding_left_"+H+v,$,null,n),Fe.b.multiSelectSettingsChange(this.props.module,"padding_top_bottom_link_"+H+v,X,null,n),Fe.b.multiSelectSettingsChange(this.props.module,"padding_left_right_link_"+H+v,Y,null,n)):(Fe.b.moduleSettingsChange(this.props.module,"padding_top_"+H+v,G,null,n),Fe.b.moduleSettingsChange(this.props.module,"padding_right_"+H+v,U,null,n),Fe.b.moduleSettingsChange(this.props.module,"padding_bottom_"+H+v,q,null,n),Fe.b.moduleSettingsChange(this.props.module,"padding_left_"+H+v,$,null,n),Fe.b.moduleSettingsChange(this.props.module,"padding_top_bottom_link_"+H+v,X,null,n),Fe.b.moduleSettingsChange(this.props.module,"padding_left_right_link_"+H+v,Y,null,n))}else 0===e.indexOf("custom_css")&&(ct.addClass("et_fb_preview_container__disable_animations"),dt()),a?Fe.b.multiSelectSettingsChange(this.props.module,""+e+v,t,null,n,o):Fe.b.moduleSettingsChange(this.props.module,""+e+v,t,null,n,o)}}},{key:"_resetOption",value:function(e){L()(e)||""===e||Fe.b.moduleSettingsChange(this.props.module,e,"")}},{key:"_onClickHover",value:function(e){var t=Pe.a.isEnabled(e,K()(this.getModule(),"props.attrs"))?"":"on",n=this.getModule(),r=Pe.a.getFieldBaseName(e);if(n){var o=K()(n,"props.address"),i=Ae.a.isMultiItemSelected(o);if(i?Fe.b.multiSelectSettingsChange(n,Pe.a.getHoverEnabledField(r),t):Fe.b.moduleSettingsChange(n,Pe.a.getHoverEnabledField(r),t),"on"===t)return;Fe.b.toggleModuleHover(!1),i?Fe.b.multiSelectSettingsChange(n,"hover_enabled",0):Fe.b.moduleSettingsChange(n,"hover_enabled",0)}}},{key:"_onClickResponsive",value:function(e){var t=this,n=Pe.a.getFieldBaseName(e),r=this.getModule(),o=K()(this.getModule(),"props.attrs."+n+"_last_edited","off|desktop");if(r){var i=K()(r,"props.address"),a=[De.default.getResponsiveStatus(o)?"off":"on",De.default.getResponsiveLastMode(o)].join("|");Ae.a.isMultiItemSelected(i)?Fe.b.multiSelectSettingsChange(r,n+"_last_edited",a):(Fe.b.moduleSettingsChange(r,n+"_last_edited",a),setTimeout(function(){t.forceUpdate()},0))}}},{key:"_onClickReset",value:function(e){if(!1!==K()(e,"props.name",!1)){var t=this._getAllOptionsFields()[e.props.name],n=De.default.get(K()(e,"props.default_on_front"),De.default.get(K()(e,"props.defaultValue"),K()(t,"default",""))),r=this.getModule(),o=K()(r,"props.address"),i=Ae.a.isMultiItemSelected(o),a=K()(r,"props.attrs"),s=Pe.a.getFieldBaseName(K()(e,"props.name",""));K()(e,"props.hasHoverOptions",!1)&&Pe.a.isEnabled(s,K()(r,"props.attrs"))&&Pe.a.isHoverMode()&&(s=Pe.a.getHoverField(s));var l=Ae.a.getPreviewMode(),u=K()(e,"props.hasResponsiveOptions",!1),c=K()(e,"props.isResponsiveEnabled",!1),d=P()(["phone","tablet"],l);if(u&&c&&d&&(s=s+"_"+l),r){var p=K()(e,"props.backgroundFields",!1);if(p)return void k()(p,function(e,t){var n=Ae.a.getHoverMode()?Pe.a.hoverSuffix():"";Ct("props.attrs."+t+n,e,r)||(i?Fe.b.multiSelectSettingsChange(r,""+t+n,K()(e,"default","")):Fe.b.moduleSettingsChange(r,""+t+n,K()(e,"default","")))});if("content"===s)i?Fe.b.multiSelectContentChange(r,n):Fe.b.moduleContentChange(r,n);else if(ft(s)){var f=gt(ht(s));i?f.map(function(e){return Fe.b.multiSelectSettingsChange(r,Pe.a.getCompositeFieldOnHover(e,s,a),"")}):f.map(function(e){return Fe.b.moduleSettingsChange(r,Pe.a.getCompositeFieldOnHover(e,s,a),"")})}else i?Fe.b.multiSelectSettingsChange(r,s,n):Fe.b.moduleSettingsChange(r,s,n)}}}},{key:"_isResetActive",value:function(e){if(!1===K()(e,"name",!1))return!1;var t=this.getModule(),n=K()(t,"props.attrs");if(!B()(t))return!1;var r=K()(e,"backgroundFields",!1);if(r){var o=Ae.a.getHoverMode()?Pe.a.hoverSuffix():"";return ye()(r,function(e,n){return!Ct("props.attrs."+n+o,e,t)})}var i=this._getAllOptionsFields(),a=Pe.a.getFieldBaseName(K()(e,"name","")),s=i[a],l=De.default.get(K()(e,"default"),K()(s,"default"));"font"===e.type&&""===l&&(l="||||||||"),Pe.a.doesSupport(e)&&Pe.a.isEnabled(a,K()(t,"props.attrs"))&&Pe.a.isHoverMode()&&(a=Pe.a.getHoverField(a));var u=Ae.a.getPreviewMode(),c=!1!==K()(e,"mobile_options",!1),d=P()(["phone","tablet"],u),p=De.default.getResponsiveStatus(K()(t,"props.attrs."+a+"_last_edited",""));c&&d&&p&&(a=a+"_"+u);var f="content"===K()(e,"name")?"props.content":"props.attrs."+a,h=K()(t,f);return ft(a)&&(h=gt(ht(a)).map(function(e){return K()(t,"props.attrs."+Pe.a.getCompositeFieldOnHover(e,a,n))}).join("|"),l="|||"),"tiny_mce"!==e.type||"<br />\n"!==h||!A()(l)&&""!==l||(h=""),l!==De.default.get(h,l)}},{key:"_onClickToggle",value:function(e,t,n,r){if(!Ae.a.getAppPreference("builder_display_modal_settings")){var o=this._isModalExpanded(),i=o?Le.a.topbar.mobile:10,a="general"===n,l="design"===n,u="css"===n;if(this._isToggleOpened(e,n)&&L()(r)){if(a)return this.setState({openedGeneralGroup:"",openedToggle:""});if(l)return this._setHoveredToggleElement(e,!1,!0),this.setState({openedDesignGroup:"",openedToggle:""});if(u)return this.setState({openedCSSGroup:"",openedToggle:""})}if(!this._isToggleOpened(e)||(this.setState({openedToggle:""}),!L()(r))){var c="design"===n?"advanced":n,d=".et-fb-tabs__panel--"+c+" .et-fb-form__toggle[data-name='"+e+"']",p=De.default.$topWindow(d).prevAll(".et-fb-form__toggle").length+1,f=1===p?0:61*p-i,h=".et-fb-tabs__panel--"+c+" .et-fb-settings-module-items-wrap";"general"===c&&De.default.$topWindow(h).length&&(1===p&&(f+=De.default.$topWindow(".et-fb-options-filter-input-wrap").height()),f+=De.default.$topWindow(h).outerHeight()+30),o?De.default.$topWindow(Object(s.findDOMNode)(this)).find(".et-fb-tabs__panel--"+c).animate({scrollTop:f},300):De.default.$topWindow(Object(s.findDOMNode)(this)).find(".et-fb-tabs__panel--active").animate({scrollTop:f},300),this.setState({openedToggle:e,openedGeneralGroup:"general"===n?e:this.state.openedGeneralGroup,openedDesignGroup:"design"===n?e:this.state.openedDesignGroup,openedCSSGroup:"css"===n?e:this.state.openedCSSGroup}),l&&this._setHoveredToggleElement(e,!0,!0)}}}},{key:"_onQuickAccessActive",value:function(){var e=this,t=Ae.a.getActiveQuickAccess().clickedToggle,n=t.toggleId,r=t.toggleGroupId,o=this._isModalExpanded(),i=Ae.a.getAppPreference("builder_display_modal_settings"),a=o||i?Le.a.topbar.mobile:10,l="design"===r?"advanced":r,u=".et-fb-tabs__panel--"+l+" .et-fb-form__toggle[data-name='"+n+"']";if(i)return clearTimeout(this.quickAccessScrollUp),void(this.quickAccessScrollUp=setTimeout(function(){var t=De.default.$topWindow(Object(s.findDOMNode)(e)).find(".et-fb-tabs__panel--"+l),n=De.default.$topWindow(u);if(0!==n.length){var r=n[0].offsetTop;t.animate({scrollTop:r},300)}},0));var c=De.default.$topWindow(u).prevAll(".et-fb-form__toggle").length+1,d=1===c?0:61*c-a;o?(De.default.$topWindow(Object(s.findDOMNode)(this)).find(".et-fb-tabs__panel--"+l).animate({scrollTop:d},300),this.setState({openedToggle:n,openedGeneralGroup:"general"===r?n:this.state.openedGeneralGroup,openedDesignGroup:"design"===r?n:this.state.openedDesignGroup,openedCSSGroup:"css"===r?n:this.state.openedCSSGroup,filterOptions:"",filterSelected:void 0,filterDropdownActive:!1,filterNotice:!1})):(clearTimeout(this.quickAccessScrollUp),this.quickAccessScrollUp=setTimeout(function(){De.default.$topWindow(Object(s.findDOMNode)(e)).find(".et-fb-tabs__panel--active").animate({scrollTop:d},300)},0),clearTimeout(this.quickAccessOpenToggle),this.quickAccessOpenToggle=setTimeout(function(){e.setState({openedToggle:n,openedGeneralGroup:"general"===r?n:e.state.openedGeneralGroup,openedDesignGroup:"design"===r?n:e.state.openedDesignGroup,openedCSSGroup:"css"===r?n:e.state.openedCSSGroup,filterOptions:"",filterSelected:void 0,filterDropdownActive:!1,filterNotice:!1})},300))}},{key:"_setHoveredToggleElement",value:function(e,t,n){var r=this.props.module,o=K()(r,"props.type"),i=K()(r,"props.address");if(!L()(tt.h[o])){var a=tt.h[o];if(!L()(a[e])){var s={moduleAddress:i,toggleId:e,elementAddress:i,elementOrder:10,elementKey:null,elementOuter:null,toggleSubId:0,isChild:!L()(r.isModuleItem),src:"settings",isOpened:t,hovered:n,isSubOpened:!1,subHovered:!1};Fe.b.quickAccessHighlight(s)}}}},{key:"_setHoveredSubToggleElement",value:function(e,t,n,r){var o=this.props.module,i=K()(o,"props.address");if(!L()(tt.f[e])){var a=tt.f[e],s=Ce()(a);if(!L()(s[t])){var l={moduleAddress:i,toggleId:e,elementAddress:i,elementOrder:10,elementKey:null,elementOuter:null,toggleSubId:t,isChild:!L()(o.isModuleItem),src:"settings",isOpened:!0,hovered:!1,isSubOpened:n,subHovered:r};Fe.b.quickAccessHighlight(l)}}}},{key:"_unsyncGlobalContent",value:function(){this._unsyncGlobalSetting("et_pb_content_field",!0)}},{key:"_unsyncGlobalSetting",value:function(e,t){Fe.b.unsyncGlobalSetting(e,this.props.module,t)}},{key:"_handleFormSubmission",value:function(t){if(t.preventDefault(),(L()(K()(this,"props.module.props.loading"))||!this.props.module.props.loading)&&!e(Object(s.findDOMNode)(this)).find(":focus").hasClass("wp-color-picker")){var n=this,r=this.props.module;k()(this.state.generalFields,function(e){"text"===e.type&&(L()(e.name)||-1===e.name.indexOf("url")&&-1===e.name.indexOf("alt")&&-1===e.name.indexOf("link")&&n._onChange(e.name,De.default.decodeHtmlEntities(r.props.attrs[e.name])))}),Fe.b.closeSettings(this._isModuleItemSettings())}}},{key:"_handleFieldConditionalDefaults",value:function(e,t,n){return I()(e.default)&&!C()(e.default)?at({},e,{conditionalDefaults:e.default,default:n&&!C()(K()(t,e.name))?K()(t,e.name):De.default.getConditionalDefault(e.default,t,!1,n)}):at({},e)}},{key:"isGlobalModuleOpened",value:function(e){var t=this.props.module,n=K()(t,"props.attrs.global_parent",""),r=K()(t,"props.attrs.global_module","");if(Ae.a.isLibraryPostType()&&"global"===ETBuilderBackend.layoutScope){if(e){var o="et_pb_"+ETBuilderBackend.layoutType,i=P()(["et_pb_section","et_pb_row","et_pb_row_inner"],K()(t,"props.type",""))?K()(t,"props.type",""):"et_pb_module";return!K()(t,"isModuleItem")&&o===i}return!0}var a=K()(t,"props.address").split(".");if(!e&&a.length>1){var s=!1,l=J()(a).map(function(e){return Ee()(a,parseInt(e,10)+1)});return k()(l,function(e){var t=d()(Ae.a.getSectionsFlattened(),{address:e.join(".")});if(""!==K()(t,"attrs.global_module",""))return s=!0,!1}),s}return!e&&""!==n||(""!==r||!L()(t.props.libraryModuleScope)&&"global"===t.props.libraryModuleScope)}},{key:"getGlobalTabClass",value:function(){if(this.isGlobalModuleOpened())return"et-fb-tabs__item__global"}},{key:"getGlobalModalClass",value:function(e){var t=L()(e)?"":e;if(this.isGlobalModuleOpened())return t+"__global"}},{key:"isGlobalOptionSynced",value:function(e){if(!this.isGlobalModuleOpened())return!0;var t=K()(this.props.module,"props.unsyncedGlobalSettings",[]);return!P()(t,e)}},{key:"isSelectiveSyncAvailable",value:function(e){return!K()(e,"hide_sync",!1)&&(this.isGlobalModuleOpened(!0)&&!P()(["et_pb_section","et_pb_row","et_pb_row_inner"],this.props.module.props.type))}},{key:"_onFilterInput",value:function(e,t){Fe.b.setOptionsFilter({filterOptions:t,filterSelected:this.state.filterSelected}),this.setState({filterOptions:t,filterNotice:!1})}},{key:"_onFilterSelect",value:function(e){Fe.b.setOptionsFilter({filterOptions:this.state.filterOptions,filterSelected:e}),this.setState({filterSelected:e,filterDropdownActive:!1,filterNotice:!1})}},{key:"_onFilterDropdownToggle",value:function(){this.setState({filterDropdownActive:!this.state.filterDropdownActive})}},{key:"_onFilterReset",value:function(){Fe.b.setOptionsFilter(),this.setState({filterSelected:void 0,filterDropdownActive:!1,filterNotice:!1})}},{key:"_onFilterResetAll",value:function(){Fe.b.setOptionsFilter(),this.setState({filterOptions:"",filterSelected:void 0,filterDropdownActive:!1,filterNotice:!1})}},{key:"_onGoToOption",value:function(t){var n=this;if(!C()(t)){z()(t.elementId,"transform_")&&(t.elementId="transform_styles");var r=this.props.module,o=[{slug:"general",toggleGroupId:"general"},{slug:"advanced",toggleGroupId:"design"},{slug:"css",toggleGroupId:"css"}],i=this.getCustomTabsList();i&&k()(i,function(e,t){o.push({slug:t,toggleGroupId:t})});var a={};k()(o,function(e,o){var i=n._getNonEmptyToggles(r.props.type,e.slug+".toggles",e.slug).toggles;if("option"===K()(t,"type")){var s=n._getOptionsFields(e.slug);if(k()(s,function(n,r){var i=L()(n.name)?r:n.name;I()(t.elementId)&&P()(t.elementId,i)?a={tabSlug:e.slug,toggleGroupId:e.toggleGroupId,keyCompare:i,fieldData:n,tabSeledtedIndex:o}:W()(t.elementId)&&t.elementId===i&&(a={tabSlug:e.slug,toggleGroupId:e.toggleGroupId,keyCompare:i,fieldData:n,tabSeledtedIndex:o})}),!C()(a)){var l=0;return void k()(i,function(e,t){if(l++,t===a.fieldData.toggle_slug)return a.toggleId=t,void(a.toggleOrder=l)})}}else if(e.toggleGroupId===K()(t,"payload.toggleGroupId")){a={tabSlug:e.slug,toggleGroupId:e.toggleGroupId,tabSeledtedIndex:o};var u=0;return void k()(i,function(e,n){if(u++,n===K()(t,"payload.toggleId"))return a.toggleId=n,void(a.toggleOrder=u)})}}),C()(a)||L()(a.toggleId)||L()(a.toggleOrder)?this.setState({filterOptions:"",filterSelected:void 0,filterDropdownActive:!1,filterNotice:!1}):(this.setState({tabSeledtedIndex:a.tabSeledtedIndex,filterOptions:"",filterSelected:void 0,filterDropdownActive:!1,filterNotice:!1}),clearTimeout(this.goToOptionTimer),this.goToOptionTimer=setTimeout(function(){e(Object(s.findDOMNode)(n)).find(".et-fb-tabs__item").each(function(t,n){t===a.tabSeledtedIndex&&e(n).trigger("click")}),n._onClickToggle(a.toggleId,a.toggleOrder,a.toggleGroupId,!0)},100))}}},{key:"_setSearchFocus",value:function(){var t=this;clearTimeout(this.focusTimer),this.focusTimer=setTimeout(function(){var n=e(Object(s.findDOMNode)(t)).find(".et-fb-options-filter input");n.length>0&&n.focus()},200)}},{key:"_getNonEmptyToggles",value:function(e,t,n){var r="css.toggles"===t?"custom_css.toggles":t,o=r+"_"+n+"_toggles",i=K()(this.props,"module.props.address"),a=Ae.a.isMultiItemSelected(i),s=Ae.a.getMultiSelectElementsType();if(vt.has(e,o)&&!a)return vt.get(e,o);var l={};if(a){if(vt.hasElements(s,o))return vt.getElements(s,o);l=nt.a.generateSelectedToggles(r)}var u=C()(l)?X()({unclassified:{title:"",priority:10}},K()(je.a.getOptionsToggles(e),r,{})):l,c=this._getOptionsFields(n),d=this.getBackgroundFieldsNames(),p={},f={};k()(c,function(e){var t=e.toggle_slug,n=e.name,r=e.depends_on,o=e.show_if,i=e.show_if_not,a=e.type;P()(["skip","computed"],a)||L()(n)||(t=L()(t)?"unclassified":t,ie()(p,t,!0),r||o||i||P()(d,n)||ie()(f,t,!0))});var h={toggles:se()(u,function(e,t){return y()(p,t)}),safe:f};return a?vt.setElements(s,o,h):vt.set(e,o,h),h}},{key:"_isFieldValueModified",value:function(e,t,n,r){var o=this,i=!1,a=L()(e.name)?void 0:t[e.name],s=e.default;if(L()(a)&&"content"===e.name&&!L()(this.props.module.props.content)&&(a=K()(this,"props.module.props.content")),!L()(e.default_from)){var l=e.default_from.split(".").pop();!l||L()(r[l])||L()(r[l].default)||(s=r[l].default)}switch(!C()(a)&&W()(a)&&(a=a.toLowerCase()),!C()(s)&&W()(s)&&(s=s.toLowerCase()),e.type){case"font":i=!C()(a)&&"||||||||"!==a&&a!==s;break;case"custom_padding":case"custom_margin":!C()(a)&&W()(a)&&(a=a.replace(/false|\|/g,"")),i=!C()(a)&&a!==s;break;case"border-radius":i=!C()(a)&&"||||"!==a&&"on||||"!==a&&a!==s;break;case"multiple_checkboxes":i=!(C()(a)||W()(a)&&-1===a.indexOf("on"))&&a!==s;break;case"tiny_mce":i=!(C()(a)||W()(a)&&!a.replace(/(?:<br ?\/?>|\n)/g,"").length)&&a!==s;break;case"range":var u=e.default_unit;if(!L()(e.default_from)){var c=e.default_from.split(".").pop();L()(r[c])||L()(r[c].default_unit)||(u=r[c].default_unit)}I()(s)&&(s=s[1][t[s[0]]]),u&&(a&&-1===a.indexOf(u)&&(a=""+a+u),s&&-1===s.indexOf(u)&&(s=""+s+u)),i=!C()(a)&&a!==s;break;case"color-alpha":i=!C()(a)&&s!==a;break;case"yes_no_button":i=!C()(a)&&"off"!==a&&s!==a;break;case"select":i=!(!De.default.hasValue(a)||B()(e.options)&&!C()(e.options)&&Object.keys(e.options)[0]===a)&&s!==a;break;case"composite":L()(e.composite_structure)||k()(e.composite_structure,function(e){L()(e.controls)||k()(e.controls,function(a,s){var l=at({},a,{name:s}),u=Object.assign({},r,e.controls);!o._isFieldDependencyExcluded(l,u)&&o._isFieldValueModified(l,t,n,u)&&(i=!0)})});break;case"background":if(!(i=(!W()(a)||!C()(a))&&s!==a)&&!C()(e.backgroundFields)){var d=e.name.split("_").slice(-1).pop();d&&k()(["background_color_%s","use_background_color_gradient_%s","bg_img_%s","background_video_mp4_%s","background_video_webm_%s"],function(e){var n=e.replace("%s",d);C()(t[n])||"off"===t[n]||(i=!0)})}break;default:i=!(!T()(a)&&!ke()(a)&&C()(a))&&s!==a}if(!i&&this._isOptionMatchesStylesResponsive(e,t)){var p=at({},e,{name:e.name+"_tablet",default:y()(e,"default_tablet")?e.default_tablet:s,mobile_options:void 0});if(this._isFieldValueModified(p,t,n,r)&&(i=!0),!i){var f=at({},e,{name:e.name+"_phone",default:y()(e,"default_phone")?e.default_tablet:p.default,mobile_options:void 0});this._isFieldValueModified(f,t,n,r)&&(i=!0)}}return i}},{key:"_isOptionMatchesStylesModified",value:function(e,t,n,r){var o=this;if("general"===n&&!L()(e.toggle_slug)&&"background"!==e.toggle_slug)return!1;if(!P()(["general","advanced","css"],n)&&P()(["text","textarea","tiny_mce","date_picker"],e.type))return!1;var i=this._isFieldValueModified(e,t,n,r);return i||"background_color"!==e.name||k()(pt,function(e){L()(r[e])||!o._isFieldValueModified(r[e],t,n,r)||(i=!0)}),i}},{key:"_isOptionMatchesStylesResponsive",value:function(e,t){if(L()(e.mobile_options))return!1;var n=t[e.name+"_last_edited"],r=L()(n)?["off","desktop"]:n.split("|");return!L()(r[0])&&"on"===r[0]}},{key:"_isOptionMatchesStylesHover",value:function(e,t){var n="background_color"===e.name?"background":e.name;return Pe.a.isEnabled(n,t)}},{key:"_isOptionMatchesActiveContent",value:function(e,t,n,r){return!("general"===n&&!L()(e.toggle_slug)&&"background"===e.toggle_slug)&&(!P()(["advanced","css"],n)&&(!(!P()(["general","advanced","css"],n)&&!P()(["text","textarea","tiny_mce","date_picker"],e.type))&&this._isFieldValueModified(e,t,n,r)))}},{key:"_isFieldDependencyExcluded",value:function(e,t){return!L()(e.depends_on)&&!this._isVisible(e,t)||!(L()(e.show_if)&&L()(e.show_if_not)||Object(et.a)(e,this.setting_resolver))}},{key:"_getFilteredFields",value:function(e){var t=this,n=this._getOptionsFields(e),r=this.state.filterOptions,o=this.state.filterSelected;if(""===r&&!De.default.hasValue(o))return n;var i=this.props.module.props.type,a=e+"_filter";if(vt.has(i,a)){var s=vt.get(i,a);if(s.search===r&&s.filterSelected===o)return s.filtered}var l=K()(this,"props.module.props.attrs",{}),u=K()(this,"props.module.props.content"),c={};k()(n,function(e){var t=e.type,n=e.name,r=e.is_fb_content;if("codemirror"===t||n&&0===n.indexOf("custom_css_")){var o=r?u:l[n];o&&(c[n]=o)}});var d=se()(n,function(e){var n=e.type,r=e.label,o=e.description,i=e.name;return"composite"===n||t._isOptionMatchesFilter(r,o,c[i])});return De.default.hasValue(o)?(d=this._isOptionMatchesFilterSelected(d,e),vt.set(i,a,{search:r,filterSelected:o,filtered:d}),d):(vt.set(i,a,{search:r,filterSelected:o,filtered:d}),d)}},{key:"_getFilteredToggleFields",value:function(e,t,n){var r=this.state.filterOptions,o=this.state.filterSelected;if(""===r&&!De.default.hasValue(o))return t;var i=this.props.module.props.type,a=n+"_"+e+"_filter_toggle";if(vt.has(i,a)){var s=vt.get(i,a);if(s.search===r&&s.filterSelected===o)return s.filtered}return this._isOptionMatchesFilter(e)&&(t=this._getOptionsFields(n)),De.default.hasValue(o)?(t=this._isOptionMatchesFilterSelected(t,n),vt.set(i,a,{search:r,filterSelected:o,filtered:t}),t):(vt.set(i,a,{search:r,filterSelected:o,filtered:t}),t)}},{key:"_isOptionMatchesFilterSelected",value:function(e,t){var n=this,r=this._getOptionsFields(t),o=K()(this,"props.module.props.attrs",{});return se()(e,function(e){if(n._isFieldDependencyExcluded(e,r))return!1;switch(n.state.filterSelected){case"styles_modified":return n._isOptionMatchesStylesModified(e,o,t,r);case"styles_responsive":return n._isOptionMatchesStylesResponsive(e,o);case"styles_hover":return n._isOptionMatchesStylesHover(e,o);case"active_content":return n._isOptionMatchesActiveContent(e,o,t,r);default:return!1}})}},{key:"_isOptionMatchesFilter",value:function(){for(var e=this.state.filterOptions.toLowerCase(),t=!1,n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];return k()(r,function(n){return L()(n)||-1===n.toLowerCase().indexOf(e)||(t=!0),!t}),t}},{key:"_getOptionsFields",value:function(e){var t=this,n=this.props.module,r=n.props.type,o=Ae.a.isMultiItemSelected(n.props.address);if(vt.has(r,e)&&!o)return vt.get(r,e);var i=this,a=X()({},this.state[e+"Fields"]),s=Ae.a.getMultiSelectElementsName(),l=Ae.a.getMultiSelectElementsType();if(o){if(vt.hasElements(l,e))return vt.getElements(l,e);var u={};k()(s,function(t){var n={};"general"===e?n=bt(t):"advanced"===e?n=yt(t):"css"===e&&(n=_t(t)),u=nt.a.generateSelectedFieldsItem(u,n)}),a=C()(u)?a:u}if((P()(["et_pb_row","et_pb_row_inner"],n.props.type)||De.default.isOn(n.props.attrs.specialty)&&"et_pb_section"===n.props.type)&&function(){for(var r=y()(n.props,"children")&&!C()(n.props.children)?n.props.children:n.props.content,o=r.length,s=function(n){var s=Ae.a.getColumnSettingFields(e),l={},u={};k()(s,function(e,t){var s=t.replace("%s",n),c={label:K()(e,"label","").replace("%s",1!==o?n:""),name:s,sub_toggle:K()(e,"sub_toggle","").replace("%s",n),isColumnField:!0,columnIndex:n-1,columnType:r[n-1].type};L()(e.affects)||C()(e.affects)||(c.affects=f()(e.affects,function(e){return e.replace("%s",n)})),I()(e.presets)&&(c.presets=e.presets.map(function(e){return at({},e,{fields:e.fields||{}})}).map(function(e){return at({},e,{fields:J()(e.fields).map(function(t){return lt({},t.replace("%s",n),e.fields[t])})})}).map(function(e){return at({},e,{fields:e.fields.reduce(function(e,t){return at({},e,t)},{})})})),L()(e.depends_on)||C()(e.depends_on)||(c.depends_on=f()(e.depends_on,function(e){return e.replace("%s",n)}));var d=X()(De.default.intentionallyClone(e),c);"background_color_%s"===t&&(l=De.default.intentionallyClone(d)),P()(i.getColumnBackgroundFieldsNames(),t)?u[s]=d:a[s]=d}),"general"!==e||C()(s)||(l.label=ETBuilderBackend.i18n.modules.column.backgroundColor.replace("%s",n),l.type="background",l.backgroundFields=u,l.isColumnBackground=!0,l.columnIndex=n,l._onChange=t._onChange,l.onMouseEnterGroup=t._onMouseEnterGroup,l.onMouseLeaveGroup=t._onMouseLeaveGroup,l.isDescriptionVisible=t._isDescriptionVisible,l.isHoveredGroup=t._isHoveredGroup,l.onClickHelp=t._onClickHelp,a["background_color_"+n]=l)},l=1;l<=o;l++)s(l)}(),"css"===e){var c=["before","main_element","after"];k()(a,function(e,t){var n=De.default.intentionallyClone(e),r=!0;k()(["module_id","module_class"],function(e){z()(t,e)&&(r=!1)}),r&&L()(e.selector)&&(n.selector=""),L()(e.isColumnField)&&(P()(["module_id","module_class"],t)||!L()(e.type)?n.name=t:n.name=!L()(e.selector)||L()(e.name)||P()(c,t)?"custom_css_"+t:t),a[t]=n})}return o?vt.setElements(l,e,a):vt.set(r,e,a),a}},{key:"_getAllOptionsFields",value:function(){var e=this.props.module.props.type;if(vt.has(e,"all"))return vt.get(e,"all");var t=this._getOptionsFields("general"),n=this._getOptionsFields("advanced"),r=this._getOptionsFields("css"),o=this.getCustomTabsFields(e),i=te()({},t,n,r);return o&&k()(o,function(e){i=te()(i,e)}),vt.set(e,"all",i),i}},{key:"getBackgroundFieldsNames",value:function(){return je.a.getBackgroundFieldsNames()}},{key:"getColumnBackgroundFieldsNames",value:function(){return J()(ETBuilderBackend.columnSettingFields.general)}},{key:"getModuleFields",value:function(e){return X()({},bt(e),yt(e))}},{key:"_renderModuleItems",value:function(){var e=this;if(""!==this.state.filterOptions||De.default.hasValue(this.state.filterSelected))return!1;var t="";this._hasModuleItem()&&I()(this.props.module.props.content)&&!C()(this.props.module.props.content)&&(t=o.a.createElement(qe.a,{module:this.props.module,_v:this.props.module.props._v,setHoveredElement:this._setHoveredElement}));var n="";if(this._hasModuleItem()){var r=!1;if(this.isSelectiveSyncAvailable()){var i=this.isGlobalOptionSynced("et_pb_content_field")?"#97D000":"#EF5555";r=o.a.createElement("div",{className:"et-fb-form__global-sync",onClick:this._unsyncGlobalContent},o.a.createElement(Be.a,{icon:"sync",color:i}))}var a=!!Ae.a.getModuleItemDragEndWaiting()&&o.a.createElement("div",{className:"et-fb-settings-module-items--waiting"}),s=ETBuilderBackend.i18n,l=K()(s,"modules."+this.props.module.props.type+".addNew")||s.controls.moduleItem.addNew;n=this._isModuleItemSettings()?"":o.a.createElement("div",{className:"et-fb-settings-module-items-wrap"},t,r,o.a.createElement("span",{className:"et-fb-item-button-wrap--add"},o.a.createElement(Ye.Motion,{defaultStyle:{size:0,opacity:0},style:{size:this.props.options.animate?Object(Ye.spring)(1,{stiffness:300,damping:20}):1,opacity:this.props.options.animate?Object(Ye.spring)(1,{stiffness:300,damping:20}):1}},function(t){return o.a.createElement(He.a,{buttonName:Ne.a.MODULE_ITEM_ADD,editingModule:e,style:{opacity:t.opacity,transform:"scale( "+t.size+" )"},title:l})})),a)}return n}},{key:"renderToggleFields",value:function(e,t){return!!Ae.a.isProductTourActive()||(!!this.builder_display_modal_settings||(!(""===this.state.filterOptions&&!De.default.hasValue(this.state.filterSelected))||this._isToggleOpened(e,t)))}},{key:"_isValidProductTourToggle",value:function(e,t){return!("et_pb_row"===K()(this.props,"module.props.type")&&!C()(t.background)&&"background"!==e)}},{key:"_maybeRenderHelpButton",value:function(e){var t=this.props.module,n=e||t.props.type;if(L()(ETBuilderBackend.i18n.videos[n]))return!1;if(this.state.filterNotice)return!1;var r=this.props.address,i=Ae.a.isMultiItemSelected(r),a=1===Ae.a.getMultiSelectElementsName().length;return i&&!a&&(n="et_pb_default"),o.a.createElement(Ie.a,{videoListId:n})}},{key:"_renderTabOptionsPanel",value:function(e,t){var n=this,i="advanced"===e?"design":e,a=P()(["general","advanced","css"],e)?e+"_settings":e;if(a="css"===e?"custom_css_settings":a,!Ae.a.isAllowedAction(a))return!1;var s=this,l=s.props.module,c=Ae.a.isMultiItemSelected(l.props.address),p=[],h=!(!l.isModuleItem||L()(l.parentModule.props.type))&&l.parentModule.props.type,g=this._getAllOptionsFields(),m=this._getFilteredFields(e),b=this.getModuleFields(l.props.type),_=J()(b).reduce(function(e,t){return e||!!t.match(/background_color(_[0-9])?$/)},!1),w=this._getNonEmptyToggles(l.props.type,e+".toggles",e),S=w.safe,O=w.toggles,x=c?nt.a.generateSelectedAttrs(l.props.type,l.props.attrs,this.updatedAttrs):l.props.attrs;this.setting_resolver.source_object=this.props.module,this.setting_resolver.property_definitions=g,"et_pb_signup_custom_field"===K()(l,"props.child_slug")&&(this.setting_resolver.child_property_definitions=bt(l.props.type,"et_pb_signup_custom_field")),"et_pb_signup_custom_field"===K()(l,"props.type")&&(this.setting_resolver.property_definitions.parentModule=bt("et_pb_signup"));var D=0,N=e!==t,F="general"===e&&!c&&this._renderModuleItems(),A=K()(l,"props.module_items_config",{}),j=K()(A,"toggle_slug"),I=K()(A,"location"),R=C()(A)||Object(et.a)(A,this.setting_resolver),H="";if(P()(["et_pb_section","et_pb_row","et_pb_row_inner","et_pb_column"],l.props.type))H=d()(ETBuilderBackend.structureModules,{slug:l.props.type}).name;else{var V=d()(ETBuilderBackend.modules,{label:l.props.type});L()(V)||L()(V.title)||(H=V.title)}var G=Ae.a.getActiveQuickAccess().clickedToggle,U=G.toggleId,z=G.toggleSubId,q=Ae.a.getAppPreference("modal_dimension_width"),$=K()(this.state.toggleTabs,i,{});return o.a.createElement(Ge.c,{key:"et-fb-tabs__panel--"+i,className:"et-fb-tabs__panel--"+e,slug:e,isModuleItemSettings:this._isModuleItemSettings(),displayFilter:!0,filterValue:this.state.filterOptions,_onFilterInput:this._onFilterInput,tabsCount:this.state.tabsCount,filterItems:ETBuilderBackend.searchFilterItems,filterGroups:{show_only:ETBuilderBackend.i18n.modals.show_only},filterDropdownActive:this.state.filterDropdownActive,filterSelected:this.state.filterSelected,filterNotice:this.state.filterNotice,_onFilterSelect:this._onFilterSelect,_onFilterDropdownToggle:this._onFilterDropdownToggle,_onFilterReset:this._onFilterReset,_onFilterResetAll:this._onFilterResetAll},o.a.createElement(Ue.e,{onSubmit:this._handleFormSubmission},o.a.createElement("input",{type:"submit",className:"et-fb-hide"}),R&&L()(j)&&F,f()(O,function(t,a){D++;var d=B()(t)?t.title:t,w=B()(t)?t.sub_toggles:{},A=!C()(w)&&K()(t,"tabbed_subtoggles",!1),V=n._getFilteredToggleFields(d,m,e),G=y()(S,a)&&"unclassified"!==a,Y=!G||n.renderToggleFields(a,i),Q=n._isToggleOpened(a,i)||!N&&n._isValidProductTourToggle(a,O)||n.productTourOptionToggle===a,ee=Z()(O)===D;De.default.hasValue(d)||"unclassified"!==a||(d=H);var te=U===a?z:0,ne=!!w&&J()(w)[0],oe={};return o.a.createElement(Ue.d,{fields:V,key:a,title:d,nonDefaultOptions:oe,toggleId:a,toggleGroupId:i,toggleSubId:te,_onClickToggle:n._onClickToggle,_onSwitchTab:n._onSwitchTab,setHoveredToggleElement:n._setHoveredToggleElement,setHoveredSubToggleElement:n._setHoveredSubToggleElement,isToggleOpened:Q,toggleOrder:D,isLastToggle:ee,isFilterActive:""!==n.state.filterOptions||De.default.hasValue(n.state.filterSelected),isGroupActive:!n.builder_display_modal_settings,showEmpty:G,subToggles:w,tabbedSubtoggles:A,setHoveredElement:function(e,t){if(e){var r=t.props.toggleId,o=Qe.a.getHelper(e);if(o){var i=o.preparePayload(t,n.props.module);n._setHoveredElement(e,r,i)}}}},R&&a===j&&"top"===I&&F,!!Y&&f()(V,function(t,d){var f=t,m=K()(f,"toggle_slug","unclassified"),w=L()(f.type)&&"css"===e?"codemirror":f.type;if(m!==a||L()(w))return!1;if(!L()(f.specialty_only)&&"yes"===f.specialty_only&&(L()(l.props.attrs.specialty)||"on"!==l.props.attrs.specialty))return!1;"sortable_list"===(f="composite"===t.type?De.default.intentionallyCloneDeep(t):De.default.intentionallyClone(t)).type&&(f.useAddNewButton=!0);var S=x,D="et_pb_counter"===n.props.module.props.type&&"content"===f.name,F=u()("et-fb-settings-options","et-fb-option--"+w.replace("_","-")),j="",I="",R="",B=x.content||(c?nt.a.generateSelectedContent(l.props.content,n.updatedAttrs):l.props.content),V={},G=h?d+"_child":d,U="",z=K()(f,"default",""),Y=void 0;if("categories"===w&&(f.categories_list={},f.taxonomy_name=L()(f.taxonomy_name)?"category":f.taxonomy_name),"select_sidebar"===w&&(f.sidebars_list={}),"text"===w&&"et_pb_signup"===l.props.type&&P()(f.option_class,"--last-field")&&(w="text_api_key"),"background_color"===f.name)f.backgroundFields={},f.onMouseEnterGroup=s._onMouseEnterGroup,f.onMouseLeaveGroup=s._onMouseLeaveGroup,f.isDescriptionVisible=s._isDescriptionVisible,f.isHoveredGroup=s._isHoveredGroup,f.onClickHelp=s._onClickHelp,k()(pt,function(e){var t=K()(b,e,!1);t&&(f.backgroundFields[e]=t,f.backgroundFields[e]._unsyncGlobalSetting=s._unsyncGlobalSetting,f.backgroundFields[e].isGlobalOptionSynced=s.isGlobalOptionSynced(e),f.backgroundFields[e].isSelectiveSyncAvailable=s.isSelectiveSyncAvailable(),f.backgroundFields[e].isGlobalOptionSynced=s.isGlobalOptionSynced(e))}),Z()(f.backgroundFields)>1&&(f.name="background",f.label=ETBuilderBackend.i18n.modules.background.label,f.type="background",w="background",f._onChange=s._onChange,f._unsyncGlobalSetting=s._unsyncGlobalSetting,L()(f.is_toggleable)&&delete f.depends_on,delete f.additional_code,delete f.depends_show_if,delete f.description);else if(_&&P()(pt,Pe.a.getFieldBaseName(K()(f,"name",""))))return!1;("background-field"===f.type&&(f.onMouseEnterGroup=s._onMouseEnterGroup,f.onMouseLeaveGroup=s._onMouseLeaveGroup,f.isDescriptionVisible=s._isDescriptionVisible,f.isHoveredGroup=s._isHoveredGroup,f.onClickHelp=s._onClickHelp,f.background_fields=v()(f.background_fields,function(e,t){return e._unsyncGlobalSetting=s._unsyncGlobalSetting,e.isGlobalOptionSynced=s.isGlobalOptionSynced(t),e.isSelectiveSyncAvailable=s.isSelectiveSyncAvailable(),e.isGlobalOptionSynced=s.isGlobalOptionSynced(t),e})),h&&Et(f))&&(f=Ot(f,l,"general"===e?"":e));var J="tabs"===K()(f,"hover",!1),Q=!1!==K()(f,"hover",!1)||void 0,ee=Pe.a.isHoverMode(),te=!1!==K()(f,"depends_on[0]",!1)&&K()(f,"depends_on[0]",!1),ae=te&&Pe.a.isEnabled(te,S),se=Pe.a.isHoverMode()&&Pe.a.doesSupport(f)&&(Pe.a.isEnabled(f.name,S)||ae)?Pe.a.getHoverField(f.name||""):f.name||"",le=Pe.a.getFieldBaseName(se),ue=ee&&J&&Pe.a.isEnabled(f.name,S);if("custom_padding"===w&&n._hasColumnsFields()&&"custom_padding"!==le){var ce=!0===ee?Pe.a.hoverSuffix():"",de=f.name.replace("padding_",""),pe=De.default.hasValue(S["padding_"+de+"_last_edited"])?S["padding_"+de+"_last_edited"].split("|"):[],fe=(K()(S,"padding_top_"+de+ce,"")||"").trim()+"|"+(K()(S,"padding_right_"+de+ce,"")||"").trim()+"|"+(K()(S,"padding_bottom_"+de+ce,"")||"").trim()+"|"+(K()(S,"padding_left_"+de+ce,"")||"").trim()+"|"+(K()(S,"padding_top_bottom_link_"+de,"")||"").trim()+"|"+(K()(S,"padding_left_right_link_"+de,"")||"").trim();if(j={desktop:fe,tablet:K()(S,"padding_"+de+"_tablet",""),phone:K()(S,"padding_"+de+"_phone",""),isResponsive:!L()(pe[0])&&"on"===pe[0],activeTab:L()(pe[1])?"desktop":pe[1]},ee)I=K()(S,"padding_top_"+de,"").trim()+"|"+K()(S,"padding_right_"+de,"").trim()+"|"+K()(S,"padding_bottom_"+de,"").trim()+"|"+K()(S,"padding_left_"+de,"").trim();U=fe}else if(P()(["range","custom_margin","custom_padding","text","number"],w)&&f.mobile_options){var he=S[f.name+"_last_edited"],ge=L()(he)?["off","desktop"]:he.split("|"),me=K()(s,"props.module.props.is_module_child",!1)&&(y()(f,"default_tablet")||y()(f,"default_phone")),ve=K()(S,se,""),be=K()(S,f.name,""),ye=K()(S,f.name+"_tablet",""),_e=K()(S,f.name+"_phone","");if(R=Ae.a.getPreviewMode(),!me&&K()(f,"default_value_depends",!1)){var ke=f.default_value_depends,we=f.default_values_mapping;V.getDefaultFrom=K()(l.props.attrs,ke,!1),be=De.default.hasValue(S[f.name])&&f.default!==S[f.name]?S[f.name]:K()(we,V.getDefaultFrom,f.default),ve=De.default.hasValue(S[se])&&f.default!==S[se]?S[se]:be}ye&&!y()(f,"default_phone")&&(f.default_phone=ye),!ye&&y()(f,"default_tablet")&&(f.default_phone=f.default_tablet),ve&&!y()(f,"default_tablet")&&(f.default_tablet=ve),ve&&!y()(f,"default_phone")&&(f.default_phone=ve),I=be,j={desktop:ve,tablet:ye,phone:_e,isResponsive:mt(f.name,S),activeTab:ge[1]},U=ve||K()(f,"default","")}else D?j=L()(l.props.attrs.content)?l.props.content:l.props.attrs.content:"codemirror"===w?(I=K()(S,f.name,K()(f,"default","")),j=K()(S,se,K()(f,"default",""))):"composite"!==w&&(f=n._handleFieldConditionalDefaults(f,S,f.name!==se),I=K()(S,f.name,K()(f,"default","")),j=K()(S,se,ue?I:K()(f,"default","")),T()(j)&&(j=""+j),T()(I)&&(I=""+I),j||(j=""),I||(I=""),U=De.default.hasValue(j)?j:K()(f,"default",""));if("font"===w&&(U=L()(U)||C()(re()(U.split("|")))?"":U,z=L()(z)?"":z),"select_with_option_groups"===w&&De.default.hasValue(j)&&-1!==j.indexOf("|")&&(j=W()(j)?j.split("|")[1]:j),"select_with_option_groups"===w&&De.default.hasValue(I)&&-1!==I.indexOf("|")&&(I=W()(I)?I.split("|")[1]:I),L()(f.depends_default)&&L()(f.depends_show_if)&&L()(f.depends_show_if_not)||(F=u()("et-fb-option--depends-on",F)),"select_with_option_groups"===w&&f.groups&&(F=u()("et-fb-option--select-with-option-groups",F)),"text"===w&&(Y=u()("et-fb-settings-option-input--block",Y)),"color-alpha"===w&&"et_pb_section"===K()(l,"props.type")&&"background_color"===K()(f,"name")&&(f.default=Ae.a.getPageSetting("et_pb_section_background_color")||Ae.a.getPageSettingField("et_pb_section_background_color").default),"admin_label"===d&&(f.default=H),L()(f.readonly_if)&&L()(f.readonly_if_not)||!Object(et.b)(f,n.setting_resolver)||(f.readonly=!0,f.useAddNewButton=!1),L()(w)||!Ke.a.getControl(w))return!1;if("warning"===w&&f.display_if!==f.value)return!1;if(!L()(f.depends_on)&&L()(f.show_if_not)&&L()(f.show_if)&&!n._isVisible(f,g))return p.push(f.name),!1;if(!(L()(f.show_if)&&L()(f.show_if_not)||Object(et.a)(f,n.setting_resolver)))return p.push(f.name),!1;if(!L()(f.depends_on)&&E()(f.depends_on,M()(f.depends_on,p)))return!1;if("composite"===w)return Je.a.createControl(f,{uniqueKey:G,module:s,_onChange:s._onChange.bind(s),onClickHelp:s._onClickHelp,activeHover:Pe.a.isEnabled(le,S),onClickHover:s._onClickHover,onClickReset:s._onClickReset,onClickResponsive:s._onClickResponsive,hasHoverOptions:Q,isDescriptionVisible:s._isDescriptionVisible,isHoveredGroup:s._isHoveredGroup,onMouseEnterGroup:s._onMouseEnterGroup,onMouseLeaveGroup:s._onMouseLeaveGroup,isSelectiveSyncAvailable:s.isSelectiveSyncAvailable.bind(s),isGlobalOptionSynced:s.isGlobalOptionSynced.bind(s),_unsyncGlobalSetting:s._unsyncGlobalSetting.bind(s),isResetActive:s._isResetActive,setting_resolver:s.setting_resolver,animate:s.props.options.animate,rightClickOpened:s.props.rightClickOpened,toggleGroupId:i,isSettingsModal:!0,_isOptionMatchesFilter:s._isOptionMatchesFilter,isResponsiveEnabled:mt,toggleId:a});var Ce=!L()(f.description)&&""!==f.description,Se=P()(["content","raw_content"],d)||!L()(f.is_fb_content)&&f.is_fb_content,Ee=Se?"et_pb_content_field":f.name,Oe=L()(f.priority)?10:f.priority,Te=!!L()(f.vb_support)||f.vb_support?"":o.a.createElement("span",{className:"et-fb-no-vb-support-warning"},ETBuilderBackend.i18n.modals.moduleSettings.noSupport),xe=z===U,Me=f,Ne=Me.sub_toggle,Le=Me.toggle_slug;if(!Ne||!A||Ne===K()($,Le,ne)){var Fe=Ce?f.description:"",je={},Ie=f.label,Re="",Be=L()(f.additional_button_type)?"":o.a.createElement(ze.a,{type:f.additional_button_type,name:f.name,attrs:f.additional_button_attrs,module:l,_onChange:n._onChange});if("css"===e){var He=!L()(f.isColumnField)&&f.isColumnField,We="."+(He?f.columnType:l.props.type)+"_"+(He?f.columnIndex:l.props.shortcode_index),Ge=!L()(f.selector)&&!Ce&&f.selector;if(!1!==Ge){if(-1!==Ge.indexOf("%%order_class%%"))Ge=Ge.replace(/%%order_class%%/g,We);else Ge=We+(!L()(f.no_space_before_selector)&&f.no_space_before_selector?"":" ")+Ge;Ce=!0,Fe=Ge}"custom_css"===f.toggle_slug&&(De.default.hasValue(n.state.filterOptions)||De.default.hasValue(n.state.filterSelected))&&(Ie=f.label+" "+ETBuilderBackend.i18n.controls.cssText)}var qe=f.default_on_front||f.defaultValue||f.default,$e=Pe.a.isEnabled(le,S);je.activeHover=$e,je.isHoverTab=ee;var Ye=L()(f.label)||""===f.label?"":o.a.createElement(Ue.c,{name:se,backgroundFields:f.backgroundFields,defaultValue:qe,activeHelp:s._isDescriptionVisible(le),activeHover:$e,hoveredGroup:s._isHoveredGroup(le),key:e+"-form-label-"+f.name,onClickHelp:!!Ce&&s._onClickHelp,onClickHover:!!J&&s._onClickHover,onClickResponsive:s._onClickResponsive,onClickReset:s._onClickReset,isResetActive:s._isResetActive(f),hasResponsiveOptions:f.mobile_options,hasHoverOptions:Q,isResponsiveEnabled:mt(f.name,S)},Ie),Qe=Ce?o.a.createElement(Ue.a,{active:s._isDescriptionVisible(f.name),key:e+"-form-description-"+f.name},Fe):"",Ze=J&&Pe.a.isEnabled(le,S)?o.a.createElement(Xe.a,null,o.a.createElement(Ve.a,{module:n.props.module,isResponsiveEnabled:mt(f.name,S),isHover:ee,fieldName:le})):"";if(N||f.isColumnBackground||!n._isValidProductTourToggle(a,O)||(Re="et-fb-product-tour-element","text"===w?Re+=" et-fb-product-tour-element-text":"background"===w&&(Re+=" et-fb-product-tour-element-background"),n.productTourOptionToggle=a,N=!0),"codemirror"===w&&(je.search=n.state.filterOptions),"font"===w&&(je.formLabel=Ye,je.formDescription=Qe),"tiny_mce"===w&&"content"!==f.name&&(B=j),K()(f,"attributes.data-old-option-ref",!1)){var tt=f.attributes["data-old-option-ref"];V.oldOptionValue=K()(l.props.attrs,tt,!1)}f.name=Pe.a.getHoverFieldOnHover(f.name,S),ue&&""!==I&&(f.default=I);var it=K()(f,"data_type",!1),at=w+(it?"_"+it:""),st=Object(r.createElement)(Ke.a.getControl(w),X()({processedKey:G,value:j,className:Y,module:s,content:B,resetValue:!1,previewMode:R,_onChange:n._onChange,_resetOption:n._resetOption,visible:!0,additionalAttrs:V,filterSelected:n.state.filterSelected,animate:n.props.options.animate,rightClickOpened:n.props.rightClickOpened,isSettingsModal:!0,isItemSelected:c},je,f));return o.a.createElement(Ue.b,{name:f.name,key:e+"-form-group-"+G,onMouseEnterGroup:function(){n._onMouseEnterGroup(f.name,Ie,at,a,i)},onMouseLeaveGroup:function(){n._onMouseLeaveGroup(f.name,Ie)},forceUseOnMouseOver:"tiny_mce"===w,isSelectiveSyncAvailable:n.isSelectiveSyncAvailable(f),isGlobalOptionSynced:n.isGlobalOptionSynced(Ee),_unsyncGlobalSetting:n._unsyncGlobalSetting,optionSubToggle:f.sub_toggle,globalName:Ee,className:Re,priority:Oe,isDefaultValue:xe},!P()(["font"],w)&&Ye,Ze,!P()(["font"],w)&&Qe,o.a.createElement("div",{className:F,key:"et-fb-option-"+e+"_"+G},o.a.createElement("div",{className:"et-fb-option-container",key:"et-fb-option-container-"+G},o.a.createElement(Xe.a,{componentName:f.name},f.dynamic_content?o.a.createElement(rt.a,{type:f.dynamic_content,fieldName:f.name,fieldType:w,isContentField:!D&&Se,value:Se?B:j,dynamicAttributes:Object(ot.e)(l.props.attrs),onChange:function(){D&&n._onChange(f.name,"",w,!0),n._onChange.apply(n,arguments)},onReset:n._resetOption,modalWidth:q},st):st),Be,Te)))}ie()(oe,Ne,K()(oe,Ne)||!xe)}),R&&a===j&&"bottom"===I&&F)}),o.a.createElement("div",{className:"et-fb-modal__tab-footer"},""!==this.state.filterOptions||De.default.hasValue(this.state.filterSelected)||this.renderSupportNotice(K()(this,"props.module.props.vb_support","off")),this._maybeRenderHelpButton(h),""!==this.state.filterOptions||De.default.hasValue(this.state.filterSelected)||o.a.createElement($e.a,{moduleTitle:this._getModuleTitle(),moduleType:l.props.type}))))}},{key:"_maybeRenderCustomTabsOptionsPanel",value:function(){var e=this,t=this.getCustomTabsList();return!!t&&f()(t,function(t,n){return!!Ae.a.isAllowedAction(n)&&(!!e.hasOptionTab(n)&&e._renderTabOptionsPanel(n))})}},{key:"maybeRenderCustomTabs",value:function(){var e=this,t=this.getCustomTabsList();if(!t)return!1;var n=Qe.a.getHelper("modal_tab");return f()(t,function(t,r){if(!Ae.a.isAllowedAction(r))return!1;if(!e.hasOptionTab(r))return!1;var i=K()(t,"name");if(!i)return!1;return o.a.createElement(Ge.a,{key:r,className:e.getGlobalTabClass(),panelId:i,setHoveredElement:function(t){if(t){var o=e._getNonEmptyToggles(e.props.module.props.type,r+".toggles",r),a=e._getOptionsFields(r),s=n.preparePayload(r,i,o,a,e.props.module);e._setHoveredElement(t,r,s)}else e._setHoveredElement(!1)}},i)})}},{key:"getTabsCount",value:function(){var e=this.props.module,t=!L()(yt(e.props.type))&&!C()(yt(e.props.type)),n=!C()(_t(e.props.type)),r=this.hasOptionTab("general"),o=this.maybeRenderCustomTabs();return re()([t,n,r]).length+re()(o).length}},{key:"hasOptionTab",value:function(e,t){var n=t?this._getOptionsFields(e):this._getFilteredFields(e),r=!C()(de()(n,["toggles_"+e+"_toggles","_builder_version"])),o=!1;return"general"===e&&(o=this._hasModuleItem()),r||o}},{key:"renderSupportNotice",value:function(e){if(De.default.isOn(e))return"";var t=P()(["off","partial"],e)?e:"off";return o.a.createElement("div",{className:"et-fb-modal__support-notice",dangerouslySetInnerHTML:{__html:fe()(K()(ETBuilderBackend,["i18n","vbSupport","modalSupportNotices",t],""))}})}},{key:"_getModuleTitle",value:function(){var e=this.props.module;if(Ae.a.isMultiItemSelected(e.props.address))return ETBuilderBackend.i18n.controls.element;var t="";if(P()(["et_pb_section","et_pb_row","et_pb_row_inner","et_pb_column"],e.props.type))t=d()(ETBuilderBackend.structureModules,{slug:e.props.type}).name;else{var n=d()(ETBuilderBackend.modules,{label:e.props.type});L()(n)||L()(n.title)||(t=n.title)}return t}},{key:"maybeShowFilterNotice",value:function(){var t=e(Object(s.findDOMNode)(this)).find(".et-fb-tabs__panel--filter-active"),n=!C()(this.state.filterOptions)||!C()(this.state.filterSelected);t.length&&t.each(function(t,r){De.default.hasValue(e(r).find(".et-fb-form__group:not(:empty)").text())&&(n=!1)}),n!==this.state.filterNotice&&this.setState({filterNotice:n})}},{key:"render",value:function(){var e=this,t=this.props,n=t.isVisible,r=t.module,i="wireframe"===Ae.a.getPreviewMode(),a=this.isGlobalModuleOpened()?430:400;if(!n)return!1;if(L()(r.props))return!1;var s=this._getModuleTitle(),l=K()(this.props,"module.props.loading",!1),c={"et-fb-product-tour-element":"saveModule"===this.props.currentTourElement},d={"et-fb-product-tour-element":"saveModule"===this.props.currentTourElement||"saveRow"===this.props.currentTourElement},p="saveModule"===this.props.currentTourElement?r:{},f=l&&!i,h=[o.a.createElement(We.a,{block:!0,danger:!0,buttonName:Ne.a.MODAL_SETTINGS_BUTTON_CLOSE,tooltip:ETBuilderBackend.i18n.tooltip.modal.cancel,disableClick:f,className:c,editingModule:p,additionalAttrs:{skipReset:wt()&&kt()}},o.a.createElement(Be.a,{icon:"exit",color:"#FFFFFF"})),o.a.createElement(We.a,{block:!0,primary:!0,alt:!0,buttonName:Ne.a.MODAL_SETTINGS_BUTTON_UNDO,tooltip:ETBuilderBackend.i18n.tooltip.modal.undo,disableClick:f},o.a.createElement(Be.a,{icon:"undo",color:"#FFFFFF"})),o.a.createElement(We.a,{block:!0,info:!0,buttonName:Ne.a.MODAL_SETTINGS_BUTTON_REDO,tooltip:ETBuilderBackend.i18n.tooltip.modal.redo,disableClick:f},o.a.createElement(Be.a,{icon:"redo",color:"#FFFFFF"})),o.a.createElement(We.a,{block:!0,success:!0,buttonName:this._isModuleItemSettings()?Ne.a.MODULE_ITEM_BACK_TO_PARENT:Ne.a.MODAL_SETTINGS_BUTTON_SAVE,tooltip:ETBuilderBackend.i18n.tooltip.modal.save,disableClick:f,className:d,editingModule:p,additionalAttrs:{skipReset:wt()&&kt()}},o.a.createElement(Be.a,{icon:"check",color:"#FFFFFF"}))],g=!L()(yt(r.props.type))&&!C()(yt(r.props.type)),m=!C()(_t(r.props.type)),v=this.hasOptionTab("general",!0),b=Qe.a.getHelper("modal_tab"),y=function(t,n){if(t){var r=K()(ETBuilderBackend.i18n.controls.tabs,n),o=e._getNonEmptyToggles(e.props.module.props.type,n+".toggles",n),i=e._getOptionsFields(n),a=b.preparePayload(n,r,o,i,e.props.module);e._setHoveredElement(t,n,a)}else e._setHoveredElement(!1)},_=!(!Ae.a.isAllowedAction("general_settings")||!v)&&o.a.createElement(Ge.a,{className:this.getGlobalTabClass(),panelId:"general",setHoveredElement:y},ETBuilderBackend.i18n.controls.tabs.general),k=!(!Ae.a.isAllowedAction("advanced_settings")||!g)&&o.a.createElement(Ge.a,{className:this.getGlobalTabClass(),panelId:"advanced",setHoveredElement:y},ETBuilderBackend.i18n.controls.tabs.design),w=!(!Ae.a.isAllowedAction("custom_css_settings")||!m)&&o.a.createElement(Ge.a,{className:this.getGlobalTabClass(),panelId:"css",setHoveredElement:y},ETBuilderBackend.i18n.controls.tabs.css),S=u()({"et-fb-modal__module-settings":!0,"et-fb-modal__filter-active":""!==this.state.filterOptions||De.default.hasValue(this.state.filterSelected),"et-fb-modal__selective-sync":this.isSelectiveSyncAvailable()},this.getGlobalModalClass("et-fb-modal")),E="configureModule"===this.props.currentTourElement&&Ae.a.getProductTourModuleName()===r.props.type||"editRow"===this.props.currentTourElement&&"et_pb_row"===r.props.type,O=E?"general":"";!E||v&&_||(O=g&&k?"advanced":"css");var T=this.maybeRenderCustomTabs(),x=Ae.a.getAppPreference("modal_fullscreen"),M=Ae.a.getAppPreference("modal_dimension_width"),D=Ae.a.getAppPreference("modal_snap_location");return o.a.createElement(Re.a,at({className:S,disableEscShortcut:""!==this.state.filterOptions||De.default.hasValue(this.state.filterSelected),footerButtons:h,fullscreen:x,globalUpdate:!0,isModuleItemSettings:this._isModuleItemSettings(),label:ETBuilderBackend.i18n.modals.moduleSettings.title.replace("%s",s),modalMinimalWidth:a,measurement:{height:Ae.a.getAppPreference("modal_dimension_height"),width:M},onModalChange:this.props.onModalChange,position:{x:Ae.a.getAppPreference("modal_position_x"),y:Ae.a.getAppPreference("modal_position_y")},snapLocation:D,tabsCount:this.state.tabsCount,onMouseEnterTitle:this._onMouseEnterTitle,onMouseLeaveTitle:this._onMouseLeaveTitle},this.props),o.a.createElement(Ge.d,{selectedIndex:this.state.tabSeledtedIndex,module:this.props.module,onSelect:this._setSearchFocus},o.a.createElement(Ge.b,{className:this.getGlobalModalClass("et-fb-tabs__list"),modalWidth:M,snapLocation:D,fullscreen:x,showScroll:!De.default.hasValue(this.state.filterOptions)&&!De.default.hasValue(this.state.filterSelected)},_,k,w,T),v&&this._renderTabOptionsPanel("general",O),g&&this._renderTabOptionsPanel("advanced",O),m&&this._renderTabOptionsPanel("css",O),this._maybeRenderCustomTabsOptionsPanel()))}}]),n}();Tt.propTypes=St,Tt.defaultProps={},t.default=Tt}.call(this,n(28))},function(e,t,n){"use strict";n.r(t),function(e){var r=n(1),o=n.n(r),i=n(17),a=n(18),s=n.n(a),l=n(6),u=n.n(l),c=n(4),d=n.n(c),p=n(11),f=n.n(p),h=n(7),g=n.n(h),m=n(9),v=n.n(m),b=n(39),y=n.n(b),_=n(76),k=n.n(_),w=n(36),C=n.n(w),S=n(31),E=n.n(S),O=n(43),T=n.n(O),x=n(138),M=n.n(x),D=n(12),P=n.n(D),N=n(75),L=n.n(N),F=n(72),A=n.n(F),j=n(41),I=n.n(j),R=n(71),B=n.n(R),H=n(2),W=n.n(H),V=n(27),G=n.n(V),U=n(21),z=n(8),q=n(40),K=n(10),$=n(35),X=n(687),Y=n(33),J=n(684),Q=n(3),Z=n(296),ee=n(259),te=n(0),ne=n(685),re=n(217),oe=n(1087),ie=n(1088),ae=n(850),se=n(1236),le=n(1049),ue=n(1062),ce=n(1060),de=n(1086),pe=(n(1073),Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}),fe=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var he={isVisible:u.a.bool,onModalChange:u.a.func},ge={select:ne.a,text:re.a,textarea:oe.a,codemirror:ie.a,number:re.a,color:ae.a,"color-alpha":ae.a,yes_no_button:le.a,range:ue.a,colorpalette:se.a,button:$.a,upload:ce.a,categories:de.a};function me(){return Q.a.getAppPreference("modal_dimension_width")}function ve(){return Q.a.getAppPreference("modal_snap")}function be(){return Q.a.getAppPreference("modal_snap_location")}var ye=void 0,_e=function(t){function n(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var t=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return ke.call(t),t.fields=U.a.pageSettings,t.state={activeDescription:null,hoveredGroup:null,openedToggle:e.openedToggle||"main_content",openedContentGroup:"",openedDesignGroup:"",openedAdvancedGroup:"",filterOptions:"",filterSelected:void 0,filterDropdownActive:!1},t.tabs=P()({},ETBuilderBackend.i18n.modals.pageSettings.tabs),t.toggles=P()({},ETBuilderBackend.i18n.modals.pageSettings.toggles),t._handleFormSubmission=t._handleFormSubmission.bind(t),t._onChange=t._onChange.bind(t),t._renderPageSettingsPanel=t._renderPageSettingsPanel.bind(t),t._renderTab=t._renderTab.bind(t),t.isVisible=t.isVisible.bind(t),t._isDescriptionVisible=t._isDescriptionVisible.bind(t),t._isHoveredGroup=t._isHoveredGroup.bind(t),t._onClickHelp=t._onClickHelp.bind(t),t._onMouseEnterGroup=t._onMouseEnterGroup.bind(t),t._onMouseLeaveGroup=t._onMouseLeaveGroup.bind(t),t._onFilterInput=t._onFilterInput.bind(t),t._onFilterSelect=t._onFilterSelect.bind(t),t._onFilterDropdownToggle=t._onFilterDropdownToggle.bind(t),t._onFilterReset=t._onFilterReset.bind(t),t._onFilterResetAll=t._onFilterResetAll.bind(t),t._isOptionMatchesFilter=t._isOptionMatchesFilter.bind(t),t._setSearchFocus=t._setSearchFocus.bind(t),t._onClickToggle=t._onClickToggle.bind(t),t._handleShortcuts=t._handleShortcuts.bind(t),t.builder_display_modal_settings=Q.a.getAppPreference("builder_display_modal_settings"),t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,o.a.Component),fe(n,[{key:"componentDidMount",value:function(){te.default.topDocument().addEventListener("keydown",this._handleShortcuts),Q.a.getDroploaderPayloadCss()&&this.setState({filterOptions:""+ETBuilderBackend.i18n.modules.customCss.label})}},{key:"componentDidUpdate",value:function(e,t){this.props.isVisible&&!e.isVisible&&(this.setState({filterOptions:"",openedToggle:"main_content",filterSelected:void 0,filterDropdownActive:!1,filterNotice:!1}),this._setSearchFocus()),this.maybeShowFilterNotice()}},{key:"componentWillUnmount",value:function(){K.b.settingFieldFocused(!1),clearTimeout(ye),te.default.topDocument().removeEventListener("keydown",this._handleShortcuts)}},{key:"_handleShortcuts",value:function(e){var t=this;if(27===e.keyCode){if(e.preventDefault(),te.default.hasValue(this.state.filterOptions)||te.default.hasValue(this.state.filterSelected))return void setTimeout(function(){t.setState({filterOptions:"",filterSelected:void 0,filterDropdownActive:!1})},100);K.b.pageSettingsClose()}}},{key:"isVisible",value:function(e,t){var n=[];return f()(e.depends_on,function(r){if(E()(t,r)){var o=d()(Q.a.getPageSetting(r))?"":Q.a.getPageSetting(r);d()(e.depends_show_if)||o!==e.depends_show_if||n.push(r)}}),!g()(n)}},{key:"_isDescriptionVisible",value:function(e){return this.state.activeDescription===e}},{key:"_isHoveredGroup",value:function(e){return this.state.hoveredGroup===e}},{key:"_isToggleOpened",value:function(e,t){var n="content"===t,r="design"===t,o="advanced"===t,i=be(),a=ve(),s=me(),l=v()(["top","bottom"],i),u=te.default.topWindow().innerWidth<q.a.responsive.phone,c=(a&&l&&te.default.topWindow().innerWidth>1200||s>1200)&&!u;if(t&&c){if(n)return this.state.openedContentGroup===e;if(r)return this.state.openedDesignGroup===e;if(o)return this.state.openedAdvancedGroup===e}return this.state.openedToggle===e}},{key:"_onMouseEnterGroup",value:function(e){this.setState({hoveredGroup:e})}},{key:"_onMouseLeaveGroup",value:function(e){this.state.hoveredGroup===e&&this.setState({hoveredGroup:null})}},{key:"_onClickHelp",value:function(e){var t=this.state.activeDescription===e?null:e;this.setState({activeDescription:t})}},{key:"_onClickToggle",value:function(t,n,r){var o=be(),a=ve(),s=me(),l=v()(["top","bottom"],o),u=te.default.topWindow().innerWidth<q.a.responsive.phone,c=(a&&l&&te.default.topWindow().innerWidth>1200||s>1200)&&!u,d="content"===r,p="design"===r,f="advanced"===r;if(this._isToggleOpened(t,r)&&c){if(d)return this.setState({openedContentGroup:"",openedToggle:""});if(p)return this.setState({openedDesignGroup:"",openedToggle:""});if(f)return this.setState({openedAdvancedGroup:"",openedToggle:""})}if(this._isToggleOpened(t))this.setState({openedToggle:""});else{var h=1===n?0:61*n-10;c?e(Object(i.findDOMNode)(this)).find(".et-fb-tabs__panel--"+r).animate({scrollTop:h},300):e(Object(i.findDOMNode)(this)).find(".et-fb-tabs__panel--active").animate({scrollTop:h},300),this.setState({openedToggle:t,openedContentGroup:"content"===r?t:this.state.openedContentGroup,openedDesignGroup:"design"===r?t:this.state.openedDesignGroup,openedAdvancedGroup:"advanced"===r?t:this.state.openedAdvancedGroup})}}},{key:"_onFilterInput",value:function(e,t){this.setState({filterOptions:t,filterNotice:!1})}},{key:"_onFilterSelect",value:function(e){this.setState({filterSelected:e,filterDropdownActive:!1,filterNotice:!1})}},{key:"_onFilterDropdownToggle",value:function(){this.setState({filterDropdownActive:!this.state.filterDropdownActive})}},{key:"_onFilterReset",value:function(){this.setState({filterSelected:void 0,filterDropdownActive:!1,filterNotice:!1})}},{key:"_onFilterResetAll",value:function(){this.setState({filterOptions:"",filterSelected:void 0,filterDropdownActive:!1,filterNotice:!1})}},{key:"_setSearchFocus",value:function(){var t=this;setTimeout(function(){var n=e(Object(i.findDOMNode)(t)).find(".et-fb-options-filter input");n.length>0&&n.focus()},200)}},{key:"_isOptionMatchesFilter",value:function(e,t,n){var r=this.state.filterOptions,o=[e.label,e.description,t,n],i=this.state.filterSelected;if(""===r&&g()(i))return!0;var a=!1;if(r&&f()(o,function(e){d()(e)||-1===e.toLowerCase().indexOf(r.toLowerCase())||(a=!0)}),"styles_modified"===i){if("content"===e.tab_slug&&"background"!==e.toggle_slug)return!1;var s=this._isOptionDefaultValue(e);a=r?a&&!s:!s}return a}},{key:"_isOptionDefaultValue",value:function(e){var t=!0,n=e.default,r=Q.a.getPageSetting(e.id);if(!d()(e.depends_on)&&!this.isVisible(e,this.fields))return!0;if(d()(e.readonly)&&"readonly"===e.readonly)return!0;switch(e.type){case"yes_no_button":t=!(!g()(n)||"off"!==r)||n===r;break;default:t=!(!g()(n)||!g()(r))||n===r}return t}},{key:"renderToggleFields",value:function(e,t){return!!this.builder_display_modal_settings||(!(""===this.state.filterOptions&&!te.default.hasValue(this.state.filterSelected))||this._isToggleOpened(e,t))}},{key:"_getTogglesForTab",value:function(e){var t={};return f()(this.fields,function(n){var r=n.tab_slug,o=n.toggle_slug,i=n.hide_on_fb,a=n.type;r!==e||i||"hidden"===a||T()(t,o,!0)}),A()(this.toggles,function(e,n){return E()(t,n)||"unclassified"===n})}},{key:"_renderTab",value:function(e){var t=this,n=[],r=0,i=this._getTogglesForTab(e);return C()(i,function(i,a){r++;var l=I()(i)?i.title:i,u=I()(i)?i.sub_toggles:{};return o.a.createElement(ee.d,{key:a,title:l,toggleId:a,toggleGroupId:e,_onClickToggle:t._onClickToggle,isToggleOpened:t._isToggleOpened(a,e),toggleOrder:r,isLastToggle:B()(t.toggles)-1===r,isFilterActive:""!==t.state.filterOptions||te.default.hasValue(t.state.filterSelected),subToggles:u},!!t.renderToggleFields(a,e)&&C()(L()(M()(t.fields),["index"]),function(r,i){i=r.id;var u=void 0;if(r.name&&r.name.indexOf("custom_css")>=0&&(u=Q.a.getPageSetting(r.id)),!t._isOptionMatchesFilter(r,l,u))return!1;if(r.tab_slug!==e)return"";if(r.toggle_slug!==a)return!1;if(r.hide_on_fb)return"";if(d()(r.name)&&(r.name=r.id),"categories"===r.type&&(r.categories_list={},r.taxonomy_name=d()(r.taxonomy_name)?"category":r.taxonomy_name),"select_sidebar"===r.type&&(r.sidebars_list={}),d()(ge[r.type]))return!1;var c={isPageSetting:!0};if("codemirror"===r.type&&(c.search=t.state.filterOptions),!d()(r.depends_on_post_type)&&-1===r.depends_on_post_type.indexOf(ETBuilderBackend.postType))return n.push(r.name),!1;if(!d()(r.depends_on)&&!t.isVisible(r,t.fields))return n.push(r.name),!1;if(!d()(r.depends_on)&&y()(r.depends_on,k()(r.depends_on,n)))return!1;var p={"et-fb-settings-options":!0};p["et-fb-option--"+r.type.replace("_","-")]=!0,d()(r.depends_show_if)||(p[" et-fb-settings-option--depends-on"]=!0);var f="",h="",g=!d()(r.description)&&""!==r.description,m=G()(function(e){return te.default.get(W()(e,"default_on_front"),te.default.get(W()(e,"defaultValue"),te.default.get(W()(e,"default"),"")))}(r)),v=G()(Q.a.getPageSetting(r.id)),b=m===v?"":v;return d()(r.label)||""===r.label||(f=o.a.createElement(ee.c,{name:r.name,activeHelp:t._isDescriptionVisible(r.name),hoveredGroup:t._isHoveredGroup(r.name),isResetActive:te.default.get(b,m)!==m,onClickReset:t._onClickReset,key:"et-fb-settings-option-label-"+i,onClickHelp:!!g&&t._onClickHelp},r.label)),g&&(h=o.a.createElement(ee.a,{active:t._isDescriptionVisible(r.name),key:"et-fb-settings-option-description-"+i},r.description)),o.a.createElement(ee.b,{name:r.name,key:"et-fb-settings-option-form-group-"+i,onMouseEnterGroup:t._onMouseEnterGroup,onMouseLeaveGroup:t._onMouseLeaveGroup},f,h,o.a.createElement("div",{className:s()(p),key:"et-fb-settings-option-"+i},o.a.createElement("div",{className:"et-fb-settings-option-container",key:"et-fb-settings-option-container-"+i},o.a.createElement(ge[r.type],P()({key:r.id,value:b,name:r.id,content:b,_onChange:t._onChange,animate:t.props.options.animate,defaultValue:m},c,r)))))}))})}},{key:"_handleFormSubmission",value:function(e){e.preventDefault(),K.b.pageSettingsClose()}},{key:"maybeShowFilterNotice",value:function(){var t=this;this.state.filterNotice||g()(this.state.filterOptions)&&g()(this.state.filterSelected)||(clearTimeout(ye),ye=setTimeout(function(){e(Object(i.findDOMNode)(t)).find(".et-fb-form__group").length||(e(Object(i.findDOMNode)(t)).find(".et-fb-options-filter input").blur(),t.setState({filterNotice:!0}))},300))}},{key:"_renderPageSettingsPanel",value:function(e){var t={},n=["styles_modified"];return f()(ETBuilderBackend.searchFilterItems,function(e,r){d()(t[r])&&(t[r]={}),f()(e,function(e,o){n.includes(o)&&(t[r][o]=e)})}),o.a.createElement(Z.c,{className:"et-fb-tabs__panel--"+e,key:"et-fb-tabs__panel--"+e,displayFilter:!0,filterValue:this.state.filterOptions,_onFilterInput:this._onFilterInput,filterItems:t,filterGroups:{show_only:ETBuilderBackend.i18n.modals.show_only},filterDropdownActive:this.state.filterDropdownActive,filterSelected:this.state.filterSelected,filterNotice:this.state.filterNotice,_onFilterSelect:this._onFilterSelect,_onFilterDropdownToggle:this._onFilterDropdownToggle,_onFilterReset:this._onFilterReset,_onFilterResetAll:this._onFilterResetAll},o.a.createElement(ee.e,{onSubmit:this._handleFormSubmission},o.a.createElement("input",{type:"submit",className:"et-fb-hide"}),this._renderTab(e),!(this.state.filterNotice||(this.state.filterOptions||this.state.filterSelected)&&v()(["content","design"],e))&&o.a.createElement(X.a,{id:"et_pb_default"})))}},{key:"render",value:function(){var e=this,t=this.props,n=t.onModalChange,r=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(t,["onModalChange"]),i=ETBuilderBackend.i18n.modals.pageSettings.tabs,a=[o.a.createElement($.a,{block:!0,danger:!0,buttonName:z.a.PAGE_SETTINGS_CLOSE,tooltip:ETBuilderBackend.i18n.tooltip.modal.cancel},o.a.createElement(Y.a,{icon:"exit",color:"#FFFFFF"})),o.a.createElement($.a,{block:!0,primary:!0,alt:!0,buttonName:z.a.PAGE_SETTINGS_BUTTON_UNDO,tooltip:ETBuilderBackend.i18n.tooltip.modal.undo},o.a.createElement(Y.a,{icon:"undo",color:"#FFFFFF"})),o.a.createElement($.a,{block:!0,info:!0,buttonName:z.a.PAGE_SETTINGS_BUTTON_REDO,tooltip:ETBuilderBackend.i18n.tooltip.modal.redo},o.a.createElement(Y.a,{icon:"redo",color:"#FFFFFF"})),o.a.createElement($.a,{block:!0,success:!0,buttonName:z.a.PAGE_SETTINGS_EDIT,tooltip:ETBuilderBackend.i18n.tooltip.modal.save},o.a.createElement(Y.a,{icon:"check",color:"#FFFFFF"}))],l=s()({"et-fb-modal__module-settings":!0,"et-fb-modal__filter-active":""!==this.state.filterOptions||te.default.hasValue(this.state.filterSelected)}),u=this.props.activeTab||0;return o.a.createElement(J.a,pe({className:l,footerButtons:a,fullscreen:Q.a.getAppPreference("modal_fullscreen"),globalUpdate:!0,label:ETBuilderBackend.i18n.modals.pageSettings.title,measurement:{height:Q.a.getAppPreference("modal_dimension_height"),width:Q.a.getAppPreference("modal_dimension_width")},onModalChange:n,position:{x:Q.a.getAppPreference("modal_position_x"),y:Q.a.getAppPreference("modal_position_y")},snapLocation:Q.a.getAppPreference("modal_snap_location")},r),o.a.createElement(Z.d,{selectedIndex:u},o.a.createElement(Z.b,null,C()(i,function(e,t){return o.a.createElement(Z.a,{key:"et-fb-modal--builder-settings-"+t},e)})),C()(i,function(t,n){return e._renderPageSettingsPanel(n)})))}},{key:"_onChange",value:function(e,t){"et_pb_enable_ab_testing"===e&&te.default.isOff(t)&&Q.a.abIsMode("on")?K.b.abDisable():K.b.pageSettingsChange(e,t)}}]),n}(),ke=function(){var e=this;this._onClickReset=function(t){var n=t.props;return e._onChange(n.name,"")}};_e.propTypes=he,t.default=_e}.call(this,n(28))},function(e,t,n){"use strict";n.r(t);var r=n(1),o=n.n(r),i=n(18),a=n.n(i),s=n(91),l=n(12),u=n.n(l),c=n(61),d=n.n(c),p=n(11),f=n.n(p),h=n(2),g=n.n(h),m=n(31),v=n.n(m),b=n(80),y=n.n(b),_=n(9),k=n.n(_),w=n(19),C=n.n(w),S=n(41),E=n.n(S),O=n(53),T=n.n(O),x=n(7),M=n.n(x),D=n(4),P=n.n(D),N=n(30),L=n.n(N),F=n(101),A=n.n(F),j=n(48),I=n.n(j),R=n(89),B=n.n(R),H=n(72),W=n.n(H),V=n(43),G=n.n(V),U=n(149),z=n.n(U),q=n(219),K=n.n(q),$=n(27),X=n.n($),Y=n(35),J=n(1053),Q=n(24),Z=n(33),ee=n(1050),te=n(82),ne=n(684),re=n(296),oe=n(259),ie=n(10),ae=n(3),se=n(698),le=n(0),ue=n(139),ce=n(15),de=(n(1238),n(21)),pe=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fe=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function he(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ge=new se.a,me=new s.AllHtmlEntities,ve=ETBuilderBackend.i18n.findReplace.modal,be=ETBuilderBackend.i18n.fonts,ye=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),r=n._getSelectedFieldValue();return n.state={find:r,replace:n._getSelectedFieldValue(),within:"this_page",throughout:"this_page",all:"off",buttonState:!1},n.tabSlug="find-replace",n.isDynamic=Object(Q.g)(r),n._onKeyDown=n._onKeyDown.bind(n),n._onClose=n._onClose.bind(n),n._onMouseEnterGroup=n._onMouseEnterGroup.bind(n),n._onMouseLeaveGroup=n._onMouseLeaveGroup.bind(n),n._onClickHelp=n._onClickHelp.bind(n),n._onChangeMap=n._onChangeMap.bind(n),n._onChangeField=n._onChangeField.bind(n),n._onChangeFieldWithin=n._onChangeFieldWithin.bind(n),n._onChangeFieldThroughout=n._onChangeFieldThroughout.bind(n),n._onFindReplace=n._onFindReplace.bind(n),n._resetOption=n._resetOption.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.a.PureComponent),fe(t,[{key:"componentDidMount",value:function(){ge.reset(),Object(le.appWindow)().addEventListener("keydown",this._onKeyDown),Object(le.topWindow)().addEventListener("keydown",this._onKeyDown)}},{key:"componentWillUnmount",value:function(){ge.reset(),Object(le.appWindow)().removeEventListener("keydown",this._onKeyDown),Object(le.topWindow)().removeEventListener("keydown",this._onKeyDown)}},{key:"_getEditedModule",value:function(e,t){var n=g()(this.props,"module");return P()(e)?n:g()(n,e,t)}},{key:"_getEditedModuleType",value:function(){return this._getEditedModule("props.type")}},{key:"_getModuleStructure",value:function(e){switch(e||this._getEditedModuleType()){case"et_pb_section":return"section";case"et_pb_row":case"et_pb_row_inner":return"row";case"et_pb_column":case"et_pb_column_inner":return"column";default:return"module"}}},{key:"_getModuleTitle",value:function(e){var t=e||this._getEditedModuleType();return ge.has("getModuleTitle",t)?ge.get("getModuleTitle",t):ge.set(ae.a.getModuleTitle(t),"getModuleTitle",t)}},{key:"_getModuleSectionType",value:function(e){var t=y()(g()(e,"address").split(".")),n=d()(ae.a.getSections(),{address:t});return!!n&&(Object(le.isOn)(g()(n,"attrs.fullwidth"))?"fullwidth":Object(le.isOn)(g()(n,"attrs.specialty"))?"specialty":"regular")}},{key:"_getModuleAncestorAddress",value:function(e,t){switch(this._getModuleSectionType(t)){case"fullwidth":return this._getModuleAncestorAddressFullwidth(e,t);case"specialty":return this._getModuleAncestorAddressSpecialty(e,t);default:return this._getModuleAncestorAddressRegular(e,t)}}},{key:"_getModuleAncestorAddressFullwidth",value:function(e,t){var n=g()(t,"address","").split(".");switch(e){case"column":return K()(n,2).join(".");default:return K()(n,1).join(".")}}},{key:"_getModuleAncestorAddressSpecialty",value:function(e,t){var n=this.getModuleStructure(g()(t,"type")),r=g()(t,"address","").split(".");switch(e){case"column":return"module"===n&&r.length>4?K()(r,4).join("."):K()(r,2).join(".");case"row":return"module"===n&&r.length>4?K()(r,3).join("."):K()(r,2).join(".");default:return K()(r,1).join(".")}}},{key:"_getModuleAncestorAddressRegular",value:function(e,t){var n=g()(t,"address","").split(".");switch(e){case"column":return K()(n,3).join(".");case"row":return K()(n,2).join(".");default:return K()(n,1).join(".")}}},{key:"_getModuleFields",value:function(e){var t=e||this._getEditedModuleType();if(ge.has("getModuleFields",t))return ge.get("getModuleFields",t);var n=ae.a.getModuleFields(t),r=g()(this._getEditedModule("props"),"attrs"),o={};return f()(n,function(e,t){var n=Object(ce.b)(t);v()(r,n)&&G()(o,n,e)}),ge.set(u()({},n,o),"getModuleFields",t)}},{key:"_getHoveredElement",value:function(e){var t=P()(e)?"element":"element."+e;return g()(this.props,t)}},{key:"_getHoveredElementId",value:function(){return this._getHoveredElement("elementId")}},{key:"_getHoveredElementSubId",value:function(){return this._getHoveredElement("subElementId")}},{key:"_getSelectedField",value:function(){var e=this._getHoveredElement("elementId"),t=this._getHoveredElement("payload.toggleGroupId"),n=this._getHoveredElement("payload.toggleId"),r=this._getEditedModuleType(),o=d()(ae.a.getModuleFields(r),{name:e,tab_slug:t,toggle_slug:n}),i=u()({},{name:e,type:this._getHoveredElement("payload.option_family"),label:this._getHoveredElement("payload.optionTitle"),subField:this._getHoveredElement("subElementId")},o);if("categories"===i.type&&(i=u()({},i,{categories_list:{},taxonomy_name:P()(i.taxonomy_name)?"category":i.taxonomy_name})),"conditional_logic"===i.type&&(i=u()({},i,{hideAddButton:!0,hideDeleteButton:!0})),"select"===i.type&&P()(i.default)&&!M()(i.options)){var a=C()(i.options)?[]:{};f()(i.options,function(e,t){E()(e)||C()(e)?f()(e,function(e,t){a[t]=e}):a[t]=e}),a&&(i=u()({},i,{default:C()(a)?a[0]:y()(L()(a))}))}return"center_map"===i.type&&(i=u()({},i,{disableAction:!0,hideUpdateButton:!0})),i}},{key:"_getSelectedFieldType",value:function(){return g()(this._getSelectedField(),"type","text")}},{key:"_getSelectedFieldLabel",value:function(){var e=this._getSelectedField(),t=g()(e,"label","");if("font"===e.type){var n=g()(this._getSelectedField(),"group_label",""),r=this._getHoveredElementSubId(),o=(this._getSelectedFieldValue()||"||||||||").split("|"),i={family:g()(o,0,""),weight:g()(o,1,""),italic:g()(o,2,""),uppercase:g()(o,3,""),underline:g()(o,4,""),capitalize:g()(o,5,""),strikethrough:g()(o,6,""),line_style:g()(o,7,""),line_color:g()(o,8,"")},a=Object(le.isOn)(g()(i,"underline"));switch(r){case"weight":t=be.fontWeight;break;case"style":t=be.fontStyle;break;case"line_color":t=(a?be.underline:be.strikethrough)+" "+be.color;break;case"line_style":t=(a?be.underline:be.strikethrough)+" "+be.style;break;default:t=g()(be,r,"")}return P()(n)?t:n+" "+t}return t}},{key:"_getSelectedFieldValue",value:function(){var e=g()(this._getSelectedField(),"name");if(Object(ce.c)()){var t=g()(this._getEditedModule("props"),"attrs"),n=Object(ce.b)(e);v()(t,n)&&(e=n)}return this._getFieldValue(e)}},{key:"_getFieldValue",value:function(e,t,n){var r=P()(e)?g()(this._getSelectedField(),"name"):e,o=P()(t)?this._getSelectedField():t,i=P()(n)?this._getEditedModule("props"):n,a=i.attrs||{};if(!(M()(o)||P()(r)||P()(o.type))){var s=void 0;if(("content"===r||g()(o,"is_fb_content",!1))&&(s=g()(i,"content")),"custom_padding"===o.type&&"custom_padding"!==r&&this._isModuleHasColumn(i)){var l=r.replace("padding_",""),u=Object(le.hasValue)(a["padding_"+l+"_last_edited"])?a["padding_"+l+"_last_edited"].split("|"):[],c=(g()(a,"padding_top_"+l,"")||"").trim()+"|"+(g()(a,"padding_right_"+l,"")||"").trim()+"|"+(g()(a,"padding_bottom_"+l,"")||"").trim()+"|"+(g()(a,"padding_left_"+l,"")||"").trim()+"|"+(g()(a,"padding_top_bottom_link_"+l,"")||"").trim()+"|"+(g()(a,"padding_left_right_link_"+l,"")||"").trim();switch(P()(u[1])?"desktop":u[1]){case"phone":s=g()(a,"padding_"+l+"_phone","");break;case"tablet":s=g()(a,"padding_"+l+"_tablet","");break;default:s=c}}if("center_map"===o.type)switch(i.type){case"et_pb_map_pin":s=JSON.stringify(B()(a,["pin_address","pin_address_lat","pin_address_lng","zoom_level"]));break;default:s=JSON.stringify(B()(a,["address_lat","address_lng","zoom_level"]))}if(g()(o,"mobile_options",!1)){var d=g()(a,r+"_last_edited","off|desktop").split("|");Object(le.isOn)(g()(d,0,"off"))&&"desktop"!==g()(d,1,"desktop")&&(s=g()(a,r+"_"+g()(d,1)))}return P()(s)&&(s=g()(a,r,g()(o,"default"))),s}}},{key:"_getWithinOptions",value:function(){var e=this,t={};return f()(ETBuilderBackend.findReplace.within,function(n,r){T()(n)?t[r]=n.replace("%s",e._getModuleTitle()):(C()(n)||E()(n))&&(t[r]=A()(W()(n,function(t,n){switch(e._getModuleStructure()){case"section":return!k()(["this_row","this_column","all_rows","all_modules"],n);case"row":return!k()(["this_column","all_modules"],n);case"column":return!1;default:return!k()(["all_rows"],n)}}),function(t){return t.replace("%s",e._getModuleTitle())}))}),t}},{key:"_getThroughoutOptions",value:function(){var e=this;return A()(W()(ETBuilderBackend.findReplace.throughout,function(t,n){switch(e._getModuleStructure()){case"section":return!1;case"row":return!k()(["this_row","this_column"],n);case"column":return!1;default:return!0}}),function(t){return t.replace("%s",e._getModuleTitle())})}},{key:"_isReplaceValueValid",value:function(e,t){var n=e||this.state.replace,r=t||this._getSelectedField();if(!g()(r,"required",!1)&&!Object(le.hasValue)(n))return!0;switch(g()(r,"type")){case"color":case"color-alpha":return ue.a.isHex(n)||ue.a.isRgb(n)||ue.a.isHsl(n);case"range":var o=/^-?\d*\.?\d+$/,i=g()(r,"default_unit",g()(r,"fixed_unit",!1)),a=i?o.test(n.replace(i,"")):o.test(n);if(a&&g()(r,"fixed_range",!1)){var s=r.range_settings||{min:0,max:100,step:1},l=g()(r,"fixed_unit",g()(r,"default_unit",!1)),u=l?parseFloat(n.replace(l,"")):parseFloat(n);a=u>=g()(s,"min",0)&&u<=g()(s,"max",100)}return a;case"font":return 9===X()(n).split("|").length;case"center_map":return Object(le.isJson)(n);default:return!0}}},{key:"_isFieldTypeMatch",value:function(e,t){var n=!1;switch(t.type){case"upload":var r=g()(t,"data_type","image"),o=g()(this._getSelectedField(),"data_type","image");(n=t.type===this._getSelectedFieldType()&&r===o)&&"video"===o&&(n=g()(t,"field_template",!0)===g()(this._getSelectedField(),"field_template",!1));break;default:(n=t.type===this._getSelectedFieldType())||k()(this._getHoveredElement("payload.option"),e)}return n}},{key:"_isFieldNameMatch",value:function(e,t){if(Object(le.isOn)(this.state.all))return!0;var n={moduleType:this._getEditedModuleType(),field:this._getSelectedField(),value:this._getSelectedFieldValue()},r={moduleType:t.type,field:e,value:this._getFieldValue(g()(e,"name"),e,t)};return ae.a.getModuleFieldsMapping(n,r)}},{key:"_isButtonEnabled",value:function(){return X()(this.state.find)!==X()(this.state.replace)&&(!M()(this.state.within)&&((!this._isThroughoutEnabled()||!M()(this.state.throughout))&&!!this._isReplaceValueValid()))}},{key:"_isThroughoutEnabled",value:function(){switch(this._getModuleStructure()){case"section":return!1;case"row":return k()(["all_rows","all_same_type"],this.state.within);case"column":return!1;default:return k()(["all_modules","all_same_type"],this.state.within)}}},{key:"_isDescriptionVisible",value:function(e){return this.state.activeDescription===e}},{key:"_isModuleHasColumn",value:function(e){var t=e||this._getModuleEdited("props"),n=k()(["et_pb_row","et_pb_row_inner"],t.type),r=Object(le.isOn)(g()(t,"attrs.specialty")&&"et_pb_section"===g()(t,"type"));return n||r}},{key:"_isModuleLocked",value:function(e){var t=g()(e,"address");if(ge.has("isModuleLocked",t))return ge.get("isModuleLocked",t);var n=Object(le.isOn)(g()(e,"attrs.locked"))||g()(e,"lockedParent");if(!n){var r=t.split("."),o=L()(r).map(function(e){return K()(r,parseInt(e,10)+1)});f()(o,function(e){var t=d()(ae.a.getSectionsFlattened(),{address:e.join(".")});if(Object(le.isOn)(g()(t,"attrs.locked"))||g()(t,"lockedParent"))return n=!0,!1})}return ge.set(n,"isModuleLocked",t)}},{key:"_isModuleAddressAffected",value:function(e){var t=this.state.within.replace("this_",""),n=this.state.throughout.replace("this_",""),r=g()(e,"address"),o=r.split("."),i=this._getModuleStructure(e.type),a=this._getEditedModule("props"),s=!1;switch(this.state.within){case"this_section":case"this_row":case"this_column":var l=this._getModuleAncestorAddress(t,a).split(".");s=!0,f()(l,function(e,t){if(g()(o,t)!==e)return s=!1,!1});break;case"this_module":if(e.is_module_child){var u=this._getModuleAncestorAddress("column",a).split(".");s=!0,f()(u,function(e,t){if(g()(o,t)!==e)return s=!1,!1})}else s=r===this._getEditedModule("props.address")||g()(e,"parent_address")===this._getEditedModule("props.address");break;case"all_modules":if("module"===i)switch(this.state.throughout){case"this_section":case"this_row":case"this_column":var c=this._getModuleAncestorAddress(n,a).split(".");s=!0,f()(c,function(e,t){if(g()(o,t)!==e)return s=!1,!1});break;default:s=!0}break;case"all_rows":if(k()(["row","column","module"],i))switch(this.state.throughout){case"this_section":var d=this._getModuleAncestorAddress(n,a).split(".");s=!0,f()(d,function(e,t){if(g()(o,t)!==e)return s=!1,!1});break;default:s=!0}break;case"all_same_type":if(k()([this._getEditedModuleType(),this._getEditedModule("props.child_slug")],g()(a,"type")))switch(this.state.throughout){case"this_section":case"this_row":case"this_column":var p=this._getModuleAncestorAddress(n,a).split(".");s=!0,f()(p,function(e,t){if(g()(o,t)!==e)return s=!1,!1});break;default:s=!0}break;default:s=!0}return s}},{key:"_onKeyDown",value:function(e){27===e.keyCode&&this._onClose()}},{key:"_onClose",value:function(){ie.b.findReplaceModalClose(this._getEditedModule(),this._getHoveredElement())}},{key:"_onMouseEnterGroup",value:function(e){this.setState({hoveredGroup:e})}},{key:"_onMouseLeaveGroup",value:function(){this.setState({hoveredGroup:!1})}},{key:"_onClickHelp",value:function(e){this.setState({activeDescription:this.state.activeDescription!==e&&e})}},{key:"_onChangeMap",value:function(e,t){try{this.setState({replace:JSON.stringify(G()(JSON.parse(this.state.replace),e,t))})}catch(n){this.setState(he({},e,t))}}},{key:"_onChangeField",value:function(e,t){e!==g()(this._getSelectedField(),"name")?this.setState(he({},e,t)):this.setState({replace:t})}},{key:"_onChangeFieldWithin",value:function(e){this.setState({within:e})}},{key:"_onChangeFieldThroughout",value:function(e){this.setState({throughout:e})}},{key:"_onFindReplace",value:function(){var e=this;this.setState({buttonState:"loading"}),new Promise(function(t){setTimeout(function(){var n=ae.a.getSectionsFlattened().filter(function(t){return!!e._isModuleAddressAffected(t)&&!e._isModuleLocked(t)});return M()(n)||f()(n,function(t){var n={},r=e._getModuleFields(t.type);if(f()(r,function(r,o){var i=e._getFindReplaceData(o,r,t);M()(i)||f()(i,function(e,r){var o=k()(["content","raw_content"],r)&&"et_pb_counter"!==g()(t,"type");Object(Q.g)(e)&&!Object(Q.h)(g()(t,"type"),r)||G()(n,r,{value:e,isContent:o})})}),!M()(n)){var o=t.address===e._getEditedModule("props.address");ie.b.findReplaceModuleUpdate(t.address,n,o)}}),t(!0)},0)}).then(function(){e._onClose()})}},{key:"_getFindReplaceData",value:function(e,t,n){var r=X()(this.state.find),o=X()(this.state.replace),i=X()(this._getFieldValue(e,t,n)),a={};try{if(!this._isFieldTypeMatch(e,t))throw new Error(ve.error.field_type_not_match);if(!this._isFieldNameMatch(t,n))throw new Error(ve.error.field_name_not_match);if(!this._isReplaceValueValid(o,t))throw new Error(ve.error.replace_value_not_valid);switch(g()(t,"type")){case"skip":case"hidden":break;case"font":var s=this._getFindReplaceDataFont(r,i,o);s&&G()(a,e,s);break;case"center_map":r.toLowerCase()===i.toLowerCase()&&f()(JSON.parse(o),function(e,t){G()(a,t,e)});break;default:r.toLowerCase()===i.toLowerCase()&&G()(a,e,o)}if(M()(a)&&e!==this._getHoveredElementId()&&k()(this._getHoveredElement("payload.option"),e)){var l=this._getSelectedField(),u=X()(this._getFieldValue(e,l,n));if(r.toLowerCase()===u.toLowerCase()&&k()(["padding_1","padding_2"],l.name)){var c=g()(n,"attrs."+l.name+"_last_edited","off|desktop").split("|");if(Object(le.isOn)(g()(c,0,"off"))&&"desktop"!==g()(c,1,"desktop"))G()(a,l.name+"_"+g()(c,1),o);else{var d=l.name.replace("padding_",""),p=o.split("|");e==="padding_top_"+d?G()(a,e,g()(p,0,"")):e==="padding_right_"+d?G()(a,e,g()(p,1,"")):e==="padding_bottom_"+d?G()(a,e,g()(p,2,"")):e==="padding_left_"+d?G()(a,e,g()(p,3,"")):e==="padding_top_bottom_link_"+d?G()(a,e,g()(p,4,"")):e==="padding_left_right_link_"+d&&G()(a,e,g()(p,5,""))}}}if(M()(a))throw new Error(ve.error.replace_value_not_match);if(g()(t,"mobile_options",!1)){var h=g()(n,"attrs."+e+"_last_edited","off|desktop").split("|");Object(le.isOn)(g()(h,0,"off"))&&"desktop"!==g()(h,1,"desktop")&&(z()(a,e),G()(a,e+"_"+g()(h,1),this.state.replace))}if(g()(t,"presets",!1)){var m=t.presets.filter(function(e){return g()(e,"value")===o});f()(m,function(e){var t=g()(e,"fields",!1);t&&f()(t,function(e,t){G()(a,t,e)})})}return a}catch(e){return!1}}},{key:"_getFindReplaceDataFont",value:function(e,t,n){var r=!1,o=X()(e).split("|");9!==o.length&&(o="||||||||".split("|"));var i=g()(o,0,""),a=g()(o,1,""),s=g()(o,2,""),l=g()(o,3,""),u=g()(o,4,""),c=g()(o,5,""),d=g()(o,6,""),p=g()(o,7,""),f=g()(o,8,""),h=X()(t).split("|");9!==h.length&&(h="||||||||".split("|"));var m={family:g()(h,0,""),weight:g()(h,1,""),italic:g()(h,2,""),uppercase:g()(h,3,""),capitalize:g()(h,4,""),underline:g()(h,5,""),linethrough:g()(h,6,""),line_color:g()(h,7,""),line_style:g()(h,8,"")},v=X()(n).split("|");9!==v.length&&(v="||||||||".split("|"));var b={family:g()(v,0,""),weight:g()(v,1,""),italic:g()(v,2,""),uppercase:g()(v,3,""),capitalize:g()(v,4,""),underline:g()(v,5,""),linethrough:g()(v,6,""),line_color:g()(v,7,""),line_style:g()(v,8,"")},y=L()(ETBuilderBackend.allFontWeights).map(function(e){return X()(e)});if(!M()(m.family)&&"Default"!==m.family){var _=g()(ETBuilderBackend.googleFonts,m.family,!1);_&&(y=_.styles.split(",").map(function(e){return"regular"===e?"400":X()(e)}).filter(function(e){return k()(y,e)}));var w=g()(ETBuilderBackend.customFonts,m.family,!1);_||M()(w)||(y=w.styles.split(",").map(function(e){return"regular"===e?"400":X()(e)}).filter(function(e){return k()(y,e)})),k()(y,"400")||y.push("400"),k()(y,"700")||y.push("700")}switch(this._getHoveredElementSubId()){case"weight":a===m.weight&&(k()(y,b.weight)||M()(b.weight))&&(h[1]=b.weight,r=!0);break;case"style":s===m.italic&&(h[2]=b.italic,r=!0),l===m.uppercase&&(h[3]=b.uppercase,r=!0),u===m.capitalize&&(h[4]=b.capitalize,r=!0),c===m.underline&&(h[5]=b.underline,r=!0),d===m.linethrough&&(h[6]=b.linethrough,r=!0);break;case"line_color":p===m.line_color&&(h[7]=b.line_color,r=!0);break;case"line_style":f===m.line_style&&(h[8]=b.line_style,r=!0);break;default:i===m.family&&(h[0]=b.family,r=!0)}return!!r&&h.join("|")}},{key:"_resetOption",value:function(){this.setState({replace:""})}},{key:"_renderField",value:function(e,t,n){var i=this,s=this._getEditedModule(),l=!(!s.isModuleItem||P()(s.parentModule.props.type))&&s.parentModule.props.type?e.name+"_child":e.name;e.findReplaceModalFind?l+="__find":e.findReplaceModalReplace?l+="__replace":e.findReplaceModalWithin?l+="__within":e.findReplaceModalThroughout?l+="__throughout":e.findReplaceModalReplaceAll&&(l+="__all");var c=u()({},e,{resetValue:!1,mobile_options:!1,disableReset:!0,uniqueKey:l,processedKey:l});if("transform"===c.type){var d=g()(de.a.getComponentAdvancedFields(this.props.module.props.type),"transform_styles.composite_structure"),p=(""+c.name).replace("transform_",""),f=g()(d,p+".controls.transform_"+p);c.default_unit=f.default_unit,c.transform_type=(""+c.name).replace("transform_",""),Object(le.hasValue)(c.default)||(c.default=f.default),Object(le.hasValue)(c.value)||(c.value=f.default)}(e.findReplaceModalFind||e.findReplaceModalReplace)&&(k()(["color","color-alpha"],c.type)&&(c=u()({},c,{hideColorManagerLinks:!0,hideHarmoniousPalette:!0,hideCurrentColorWrapper:!0,hideColorResetButton:!0,showCustomInput:!0})),"font"===c.type&&(c=u()({},c,{subFieldLabel:!1,subField:this._getHoveredElementSubId()?this._getHoveredElementSubId():"font"})),"select_with_option_groups"===c.type&&(c=u()({},c,{value:g()(X()(c.value).split("|"),1,"none"),hideAddButton:!0,hideRemoveButton:!0,hideFetchButton:!0})),"multiple_checkboxes"===c.type&&(c=u()({},c,{shortcut_index:l})));var h=g()(c,"type","text"),m=h.replace("_","-"),v=a()(he({"et-fb-form__group--find-replace":!0,"et-fb-form__group--find-replace__find":e.findReplaceModalFind,"et-fb-form__group--find-replace__replace":e.findReplaceModalReplace,"et-fb-form__group--find-replace__within":e.findReplaceModalWithin,"et-fb-form__group--find-replace__throughout":e.findReplaceModalThroughout,"et-fb-form__group--find-replace__all":e.findReplaceModalReplaceAll},"et-fb-form__group--"+m,!0)),b=a()(he({"et-fb-settings-options":!0,"et-fb-option--depends-on":!P()(e.depends_default)||!P()(e.depends_show_if)||!P()(e.depends_show_if_not),"et-fb-option--select-with-option-groups":"select_with_option_groups"===h&&e.groups},"et-fb-option--"+m,!0)),y=a()(he({"et-fb-option-container":!0},"et-fb-option-container--"+m,!0)),_=Object(r.createElement)(ee.a.getControl(h),c);return o.a.createElement(oe.b,{className:v,name:l,key:this.tabSlug+"-form-group-"+l,onMouseEnterGroup:function(){return i._onMouseEnterGroup(l)},onMouseLeaveGroup:this._onMouseLeaveGroup},o.a.createElement(oe.c,{hoveredGroup:this.state.hoveredGroup===l,onClickHelp:function(){return i._onClickHelp(l)},activeHelp:this.state.activeDescription===l},t),o.a.createElement(oe.a,{active:this.state.activeDescription===l},n),o.a.createElement("div",{className:b},o.a.createElement("div",{className:y},o.a.createElement(te.a,{componentName:l},(this.isDynamic||c.findReplaceModalReplace)&&k()(J.a.supportedFieldTypes,h)?o.a.createElement(J.a,{type:c.dynamic_content||h,fieldName:c.name,fieldType:h,value:c.value,dynamicAttributes:[c.name],showSettingsButton:!c.readonly,showDisableButton:!c.readonly,onChange:c._onChange,onReset:this._resetOption},_):_))))}},{key:"_renderFieldFind",value:function(){var e=u()({},this._getSelectedField(),{module:this,type:this._getSelectedFieldType(),value:this.state.find,findReplaceModalFind:!0,readonly:!0,_onChange:I.a}),t=this.state.find;"text"===e.type||P()(t)||G()(e,"default",t),"codemirror"===e.type&&g()(e,"is_fb_content")&&G()(e,"content",t);var n=ve.find.label.replace("%s",this._getSelectedFieldLabel()),r=ve.find.description;return this._renderField(e,n,r)}},{key:"_renderFieldWithin",value:function(){var e={name:"within",type:"select",value:this.state.within,options:this._getWithinOptions(),optionGroups:ETBuilderBackend.findReplace.groups,groupSeparator:!1,findReplaceModalWithin:!0,__onChange:this._onChangeFieldWithin},t=ve.within.label,n=ve.within.description;return this._renderField(e,t,n)}},{key:"_renderFieldThroughout",value:function(){if(!this._isThroughoutEnabled())return!1;var e={name:"throughout",type:"select",value:this.state.throughout,options:this._getThroughoutOptions(),findReplaceModalThroughout:!0,__onChange:this._onChangeFieldThroughout},t=ve.throughout.label,n=ve.throughout.description;return this._renderField(e,t,n)}},{key:"_renderFieldReplace",value:function(){var e=this,t=u()({},this._getSelectedField(),{module:this,type:this._getSelectedFieldType(),default:Object(Q.g)(this.state.find)?"":this.state.find,value:this.state.replace,findReplaceModalReplace:!0,_onChange:I.a}),n=g()(t,"readonly_if",!1);n&&f()(n,function(n,r){k()(n,e._getEditedModule(r.replace(":",".props.attrs.")))&&G()(t,"readonly",!0)});var r=g()(t,"readonly_if_not",!1);if(r&&f()(r,function(n,r){k()(n,e._getEditedModule(r.replace(":",".props.attrs.")))||G()(t,"readonly",!0)}),!g()(t,"readonly",!1))switch(t.type){case"center_map":G()(t,"_onChange",this._onChangeMap),G()(t,"hideUpdateButton",this._onChangeMap),Object(le.isJson)(this.state.replace)&&f()(JSON.parse(this.state.replace),function(e,n){G()(t,n,k()(["zoom_level"],n)?parseInt(e,10):e)});break;default:G()(t,"_onChange",this._onChangeField)}"codemirror"===t.type&&g()(t,"is_fb_content")&&G()(t,"content",this.state.replace);var o=ve.replaceWith.label,i=ve.replaceWith.description;return this._renderField(t,o,i)}},{key:"_renderFieldReplaceAll",value:function(){var e=this,t=A()(ETBuilderBackend.findReplace.all,function(t){return t.replace("%s",e._getSelectedFieldLabel())}),n={name:"all",type:"multiple_checkboxes",value:this.state.all,options:t,findReplaceModalReplaceAll:!0,_onChange:this._onChangeField},r=ve.replaceAll.label.replace("%s",this._getSelectedFieldLabel()),o=ve.replaceAll.description;return this._renderField(n,r,o)}},{key:"render",value:function(){var e=this.state.buttonState?o.a.createElement(Z.a,{icon:this.state.buttonState,color:"#FFFFFF"}):ve.tooltip,t=[o.a.createElement(Y.a,{block:!0,info:!0,ink:!1,disable:!1!==this.state.buttonState,tooltip:ve.tooltip,__onClick:this.state.buttonState?I.a:this._onFindReplace},e)],n=pe({},this.props,{measurement:{width:ae.a.getAppPreference("modal_dimension_width"),height:ae.a.getAppPreference("modal_dimension_height")},disableFullscreenButton:!0,disableSnapButton:!0,disableResizeButton:!0}),r=a()({"et-fb-modal__module-settings":!0,"et-fb-modal__find-replace":!0});return o.a.createElement(ne.a,pe({className:r,footerButtons:t,fullscreen:ae.a.getAppPreference("modal_fullscreen"),label:me.decode(ve.title),position:{x:ae.a.getAppPreference("modal_position_x"),y:ae.a.getAppPreference("modal_position_y")},snapLocation:ae.a.getAppPreference("modal_snap_location"),_closeFunction:this.state.buttonState?I.a:this._onClose,globalUpdate:!0},n),o.a.createElement(te.a,null,o.a.createElement(re.d,{selectedIndex:0},o.a.createElement(re.c,{className:"et-fb-tabs__panel--"+this.tabSlug,slug:this.tabSlug,selected:!0},o.a.createElement("div",{className:"et-fb-form"},this._renderFieldFind(),this._renderFieldWithin(),this._renderFieldThroughout(),this._renderFieldReplace(),this._renderFieldReplaceAll())))))}}]),t}();t.default=ye},function(e,t,n){"use strict";n.r(t);var r=n(1),o=n.n(r),i=n(18),a=n.n(i),s=n(91),l=n(12),u=n.n(l),c=n(61),d=n.n(c),p=n(11),f=n.n(p),h=n(2),g=n.n(h),m=n(31),v=n.n(m),b=n(80),y=n.n(b),_=n(9),k=n.n(_),w=n(19),C=n.n(w),S=n(41),E=n.n(S),O=n(7),T=n.n(O),x=n(4),M=n.n(x),D=(n(53),n(30)),P=n.n(D),N=n(101),L=n.n(N),F=n(83),A=n.n(F),j=n(48),I=n.n(j),R=n(89),B=n.n(R),H=n(72),W=n.n(H),V=n(219),G=n.n(V),U=n(27),z=n.n(U),q=n(43),K=n.n(q),$=n(50),X=n.n($),Y=n(35),J=n(33),Q=n(1050),Z=n(82),ee=n(684),te=n(296),ne=n(259),re=n(10),oe=n(3),ie=n(698),ae=n(0),se=(n(1239),n(1053)),le=n(24),ue=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ce=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function de(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var pe=new ie.a,fe=new s.AllHtmlEntities,he=ETBuilderBackend.i18n.modals.extend_styles,ge=ETBuilderBackend.i18n.fonts,me=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.defaultStates={to:n.getSelectedModule("props.is_module_child",!1)&&g()(e,"element")?"module":n.getSelectedModuleType(),throughout:"page"},n.state=u()({buttonState:!1},n.defaultStates),n.slug="extend-styles",n.onClose=n.onClose.bind(n),n.onKeyDown=n.onKeyDown.bind(n),n.onMouseEnterGroup=n.onMouseEnterGroup.bind(n),n.onMouseLeaveGroup=n.onMouseLeaveGroup.bind(n),n.onClickHelp=n.onClickHelp.bind(n),n.onChangeField=n.onChangeField.bind(n),n.onExtendStyles=n.onExtendStyles.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.a.PureComponent),ce(t,[{key:"componentDidMount",value:function(){pe.reset(),Object(ae.appWindow)().addEventListener("keydown",this.onKeyDown),Object(ae.topWindow)().addEventListener("keydown",this.onKeyDown)}},{key:"componentWillUnmount",value:function(){pe.reset(),Object(ae.appWindow)().removeEventListener("keydown",this.onKeyDown),Object(ae.topWindow)().removeEventListener("keydown",this.onKeyDown)}},{key:"onClose",value:function(){var e=g()(this.props,"source"),t=g()(this.props,"element"),n=g()(this.props,"module");re.b.extendStylesModalClose(e,t,n)}},{key:"onKeyDown",value:function(e){27===e.keyCode&&this.onClose()}},{key:"onMouseEnterGroup",value:function(e){this.setState({hoveredGroup:e})}},{key:"onMouseLeaveGroup",value:function(){this.setState({hoveredGroup:!1})}},{key:"onClickHelp",value:function(e){this.setState({activeDescription:this.state.activeDescription!==e&&e})}},{key:"onChangeField",value:function(e,t){g()(this.state,e)!==t&&v()(this.defaultStates,e)&&this.setState(de({},e,t))}},{key:"onExtendStyles",value:function(){var e=this;this.setState({buttonState:"loading"});var t=function(t,n,r,o){var i=g()(t,"name"),a=g()(n,"attrs."+i);if("font"!==g()(t,"type")||"option"!==e.getSelectedSource())return a;var s=a.split("|"),l=g()(r,"name"),u=g()(o,"attrs."+l,"||||||||").split("|"),c=g()({font:[0],weight:[1],style:[2,3,4,5,6],line_style:[7],line_color:[8]},e.getSelectedField("subField","font"),[]);return f()(c,function(e){u[e]=s[e]}),u.join("|")};new Promise(function(n){setTimeout(function(){var r=e.getSelectedModule("props"),o=e.getSelectedModuleType(),i=oe.a.getSectionsFlattened().filter(function(t){var n=t.type.replace("_inner","");if("module"!==e.state.to){if(T()(t.child_slug)&&!t.is_module_child&&n!==e.state.to)return!1;if(!T()(t.child_slug)&&t.child_slug!==e.state.to&&n!==e.state.to)return!1;if(t.is_module_child&&n!==g()(ETBuilderBackend.moduleChildSlugs,e.state.to)&&n!==e.state.to)return!1}return("module"!==e.state.to||e.getModuleStructure(n)===e.state.to)&&(t.address!==e.getSelectedModule("props.address")&&(g()(t,"parent_address")!==e.getSelectedModule("props.address")&&(!!e.isModuleAddressAffected(t)&&!e.isModuleLocked(t))))});if(T()(i))return n(!1);var a=W()(oe.a.getModuleFields(o),function(t){return("general"!==t.tab_slug||"background"===t.toggle_slug)&&(("css"!==t.tab_slug||"custom_css"===t.toggle_slug)&&(("options_group"!==e.getSelectedSource()||e.getSelectedElement("payload.toggleId")===t.toggle_slug)&&(("options_group"!==e.getSelectedSource()||e.getSelectedElement("payload.toggleGroupId")===t.tab_slug)&&!("option"===e.getSelectedSource()&&!k()(e.getSelectedElement("payload.option"),t.name)))))}),s=[];T()(a)||f()(i,function(e){var n={},i=g()(e,"type","");i===o?f()(a,function(o){n[o.name]=t(o,r,o,e)}):f()(a,function(a){var s={};if(pe.has("targetFields",a.name,o,i))s=pe.get("targetFields",a.name,o,i);else{var l={moduleType:o,field:a};s=W()(oe.a.getModuleFields(i),function(e){var t=u()({},{moduleType:i,field:e});return oe.a.getModuleFieldsMapping(l,t)}),pe.set(s,"targetFields",a.name,o,i)}T()(s)||f()(s,function(o){n[o.name]=t(a,r,o,e)})}),T()(n)||s.push(u()({},e,{extendStylesData:n}))});var l=s.filter(function(t){return!(e.getSelectedModule("props.is_module_child",!1)&&!T()(t.child_slug)&&!T()(d()(s,{parent_address:t.address})))&&!(!T()(e.getSelectedModule("props.child_slug",""))&&t.is_module_child&&!T()(d()(s,{address:t.parent_address})))});return T()(l)?n(!1):(f()(l,function(e){re.b.extendStylesModalUpdate(e.address,e.extendStylesData)}),n(!0))},0)}).then(function(){e.onClose()})}},{key:"getExtendStylesValue",value:function(e,t,n){var r=this.getSelectedModule("props.attrs."+e.name);if("font"!==g()(e,"type")||"option"!==this.getSelectedSource())return r;var o=this.getSelectedField("subField","font"),i=g()(n,"attrs."+t,"||||||||").split("|"),a=r.split("|");return f()(g()({font:[0],weight:[1],style:[2,3,4,5,6],line_style:[7],line_color:[8]},o,[]),function(e){i[e]=a[e]}),i.join("|")}},{key:"isModuleAddressAffected",value:function(e){if("page"===this.state.throughout)return!0;var t=this.getModuleAncestorAddress(this.state.throughout,this.getSelectedModule("props")).split("."),n=g()(e,"address").split("."),r=!0;return f()(t,function(e,t){if(g()(n,t)!==e&&(r=!1),!r)return!1}),r}},{key:"isModuleLocked",value:function(e){var t=g()(e,"address");if(pe.has("isModuleLocked",t))return pe.get("isModuleLocked",t);var n=Object(ae.isOn)(g()(e,"attrs.locked"))||g()(e,"lockedParent");if(!n){var r=t.split("."),o=P()(r).map(function(e){return G()(r,parseInt(e,10)+1)});f()(o,function(e){var t=d()(oe.a.getSectionsFlattened(),{address:e.join(".")});if(Object(ae.isOn)(g()(t,"attrs.locked"))||g()(t,"lockedParent"))return n=!0,!1})}return pe.set(n,"isModuleLocked",t)}},{key:"getSelectedSource",value:function(){return g()(this.props,"source")}},{key:"getSelectedElement",value:function(e,t){var n=g()(this.props,"element");return M()(e)?n:g()(n,e,t)}},{key:"getSelectedModule",value:function(e,t){var n=g()(this.props,"module");return M()(e)?n:g()(n,e,t)}},{key:"getSelectedModuleType",value:function(){return this.getSelectedModule("props.type")}},{key:"getSelectedModuleTitle",value:function(){var e=this.getSelectedModuleType();return pe.has("getSelectedModuleTitle",e)?pe.get("getSelectedModuleTitle",e):pe.set(oe.a.getModuleTitle(e),"getSelectedModuleTitle",e)}},{key:"getSelectedModuleTitlePlural",value:function(){var e=this.getSelectedModuleType();return pe.has("getSelectedModuleTitlePlural",e)?pe.get("getSelectedModuleTitlePlural",e):pe.set(oe.a.getModuleTitlePlural(e),"getSelectedModuleTitlePlural",e)}},{key:"getSelectedModuleStructure",value:function(){var e=this.getSelectedModuleType();return pe.has("getSelectedModuleStructure",e)?pe.get("getSelectedModuleStructure",e):pe.set(this.getModuleStructure(e),"getSelectedModuleStructure",e)}},{key:"getSelectedField",value:function(e,t){var n=this.getSelectedElement("elementId"),r=this.getSelectedElement("payload.toggleGroupId"),o=this.getSelectedElement("payload.toggleId"),i=this.getSelectedModuleType(),a=d()(oe.a.getModuleFields(i),{name:n,tab_slug:r,toggle_slug:o}),s=u()({},{name:n,type:this.getSelectedElement("payload.option_family"),label:this.getSelectedElement("payload.optionTitle"),subField:this.getSelectedElement("subElementId")},a);return M()(e)?s:g()(s,e,t)}},{key:"getSelectedFieldValue",value:function(){return this.getFieldValue(g()(this.getSelectedField(),"name"),this.getSelectedField(),this.getSelectedModule("props"))}},{key:"getModuleStructure",value:function(e){if(pe.has("getModuleStructure",e))return pe.get("getModuleStructure",e);switch(e){case"et_pb_section":return pe.set("section","getModuleStructure",e);case"et_pb_row":case"et_pb_row_inner":return pe.set("row","getModuleStructure",e);case"et_pb_column":case"et_pb_column_inner":return pe.set("column","getModuleStructure",e);default:return pe.set("module","getModuleStructure",e)}}},{key:"getModuleSectionType",value:function(e){var t=y()(g()(e,"address").split(".")),n=d()(oe.a.getSections(),{address:t});return!!n&&(Object(ae.isOn)(g()(n,"attrs.fullwidth"))?"fullwidth":Object(ae.isOn)(g()(n,"attrs.specialty"))?"specialty":"regular")}},{key:"getModuleAncestorAddress",value:function(e,t){switch(this.getModuleSectionType(t)){case"fullwidth":return this.getModuleAncestorAddressFullwidth(e,t);case"specialty":return this.getModuleAncestorAddressSpecialty(e,t);default:return this.getModuleAncestorAddressRegular(e,t)}}},{key:"getModuleAncestorAddressFullwidth",value:function(e,t){var n=t||this.getSelectedModule("props"),r=g()(n,"address","").split(".");switch(e){case"column":return G()(r,2).join(".");default:return G()(r,1).join(".")}}},{key:"getModuleAncestorAddressSpecialty",value:function(e,t){var n=t||this.getSelectedModule("props"),r=this.getModuleStructure(g()(n,"type")),o=g()(n,"address","").split(".");switch(e){case"column":return"module"===r&&o.length>4?G()(o,4).join("."):G()(o,2).join(".");case"row":return"module"===r&&o.length>4?G()(o,3).join("."):G()(o,2).join(".");default:return G()(o,1).join(".")}}},{key:"getModuleAncestorAddressRegular",value:function(e,t){var n=t||this.getSelectedModule("props"),r=g()(n,"address","").split(".");switch(e){case"column":return G()(r,3).join(".");case"row":return G()(r,2).join(".");default:return G()(r,1).join(".")}}},{key:"getFieldValue",value:function(e,t,n){var r=n||this.getSelectedModule("props"),o=r.attrs||{},i=void 0;if(("content"===e||g()(t,"is_fb_content",!1))&&(i=g()(r,"content")),"custom_padding"===t.type&&"custom_padding"!==e){var a=k()(["et_pb_row","et_pb_row_inner"],r.type),s=Object(ae.isOn)(g()(r,"attrs.specialty")&&"et_pb_section"===g()(r,"type"));if(a||s){var l=e.replace("padding_",""),u=Object(ae.hasValue)(o["padding_"+l+"_last_edited"])?o["padding_"+l+"_last_edited"].split("|"):[],c=(g()(o,"padding_top_"+l,"")||"").trim()+"|"+(g()(o,"padding_right_"+l,"")||"").trim()+"|"+(g()(o,"padding_bottom_"+l,"")||"").trim()+"|"+(g()(o,"padding_left_"+l,"")||"").trim()+"|"+(g()(o,"padding_top_bottom_link_"+l,"")||"").trim()+"|"+(g()(o,"padding_left_right_link_"+l,"")||"").trim();switch(M()(u[1])?"desktop":u[1]){case"phone":i=g()(o,"padding_"+l+"_phone","");break;case"tablet":i=g()(o,"padding_"+l+"_tablet","");break;default:i=c}}}if("center_map"===t.type)switch(r.type){case"et_pb_map_pin":i=JSON.stringify(B()(o,["pin_address","pin_address_lat","pin_address_lng","zoom_level"]));break;default:i=JSON.stringify(B()(o,["address_lat","address_lng","zoom_level"]))}if("select_with_option_groups"===t.type&&(i=g()(z()(g()(o,e,g()(t,"default"))).split("|"),1,"none")),g()(t,"mobile_options",!1)){var d=g()(o,e+"_last_edited","off|desktop").split("|");Object(ae.isOn)(g()(d,0,"off"))&&"desktop"!==g()(d,1,"desktop")&&(i=g()(o,e+"_"+g()(d,1)))}return M()(i)&&(i=g()(o,e,g()(t,"default"))),i}},{key:"renderField",value:function(e,t,n){var i,s=this,l=this.getSelectedModule(),c=!(!l.isModuleItem||M()(l.parentModule.props.type))&&l.parentModule.props.type?e.name+"_child":e.name,d=u()({},e,{resetValue:!1,mobile_options:!1,disableReset:!0,uniqueKey:c,processedKey:c,animate:g()(this.props,"options.animate",!1)}),p=g()(d,"type","text"),f=p.replace("_","-"),h=Object(le.g)(d.value),m=a()((de(i={},"et-fb-form__group--"+this.slug,!0),de(i,"et-fb-form__group--"+f,!0),de(i,"et-fb-form__group--readonly",d.readonly),i)),v=a()(de({"et-fb-settings-options":!0,"et-fb-option--depends-on":!M()(e.depends_default)||!M()(e.depends_show_if)||!M()(e.depends_show_if_not),"et-fb-option--select-with-option-groups":"select_with_option_groups"===p&&e.groups},"et-fb-option--"+f,!0)),b=a()(de({"et-fb-option-container":!0},"et-fb-option-container--"+f,!0)),y=Object(r.createElement)(Q.a.getControl(p),d);return o.a.createElement(ne.b,{className:m,name:c,key:this.slug+"-form-group-"+c,onMouseEnterGroup:T()(n)?I.a:function(){return s.onMouseEnterGroup(c)},onMouseLeaveGroup:T()(n)?I.a:this.onMouseLeaveGroup},o.a.createElement(ne.c,{hoveredGroup:this.state.hoveredGroup===c,onClickHelp:function(){return s.onClickHelp(c)},activeHelp:this.state.activeDescription===c},t),o.a.createElement(ne.a,{active:this.state.activeDescription===c},n),o.a.createElement("div",{className:v},o.a.createElement("div",{className:b},o.a.createElement(Z.a,{componentName:c},h&&k()(se.a.supportedFieldTypes,p)?o.a.createElement(se.a,{type:d.dynamic_content||p,fieldName:d.name,fieldType:p,value:d.value,dynamicAttributes:[d.name],previewMode:"background",showSettingsButton:!1,showDisableButton:!1,onChange:d._onChange},y):y))))}},{key:"renderFieldSource",value:function(){var e=this;if("module"===this.getSelectedSource()){var t=this.getSelectedModuleTitle(),n=this.getSelectedModuleTitlePlural(),r=Object(ae.sprintf)(he.labels.extend_module,t,n);return o.a.createElement(ne.b,null,o.a.createElement(ne.c,null,fe.decode(r)))}if("options_group"===this.getSelectedSource()){var i=this.getSelectedElement("payload.toggleTitle"),a=he.labels.extend_options_group.replace(/%s/g,i);return o.a.createElement(ne.b,null,o.a.createElement(ne.c,null,fe.decode(a)))}var s=this.getSelectedModuleType(),l=this.getSelectedElement("payload.option"),c=this.getSelectedField();if(!T()(c)){var d=u()({},c,{value:this.getSelectedFieldValue()}),p=this.getSelectedElement("payload.optionTitle"),h=function t(n){K()(n,"module",e),K()(n,"readonly",!0),K()(n,"visible",!0),K()(n,"_onChange",I.a);var r=g()(n,"type");if("transform"===r&&(n.transform_type=(""+n.name).replace("transform_","")),X()(r,"background-")){K()(n,"type","background"),K()(n,"activeTab",r.replace("background-","")),K()(n,"isDescriptionVisible",function(){return!1}),K()(n,"isHoveredGroup",function(){return!1}),K()(n,"onMouseEnterGroup",I.a),K()(n,"onMouseLeaveGroup",I.a);var o={};f()(oe.a.getModuleFields(s),function(e){k()(l,e.name)&&(o[e.name]=u()({},t(e)))}),K()(n,"backgroundFields",o)}if("font"===r){var i=g()(n,"group_label",""),a=g()(n,"value","||||||||").split("|"),c={font:g()(a,0,""),weight:g()(a,1,""),italic:g()(a,2,""),uppercase:g()(a,3,""),underline:g()(a,4,""),capitalize:g()(a,5,""),strikethrough:g()(a,6,""),line_style:g()(a,7,""),line_color:g()(a,8,"")},d=Object(ae.isOn)(g()(c,"underline"));switch(n.subField){case"weight":K()(n,"label",ge.fontWeight);break;case"style":K()(n,"label",ge.fontStyle);break;case"line_color":var p=d?ge.underline:ge.strikethrough,h=ge.color;K()(n,"label",p+" "+h);break;case"line_style":var m=d?ge.underline:ge.strikethrough,v=ge.style;K()(n,"label",m+" "+v);break;default:K()(n,"label",g()(ge,n.subField,""))}T()(i)||K()(n,"label",i+" "+n.label),K()(n,"subFieldLabel",!1)}if(X()(r,"color")&&(K()(n,"hideColorManagerLinks",!0),K()(n,"hideHarmoniousPalette",!0),K()(n,"hideCurrentColorWrapper",!0),K()(n,"hideColorResetButton",!0),K()(n,"showCustomInput",!0),K()(n,"hasPreview",!1)),"select_with_option_groups"===r&&(K()(n,"hideAddButton",!0),K()(n,"hideRemoveButton",!0),K()(n,"hideFetchButton",!0)),"center_map"===r&&(K()(n,"disableAction",!0),K()(n,"hideUpdateButton",!0)),"conditional_logic"===r&&(K()(n,"hideAddButton",!0),K()(n,"hideDeleteButton",!0)),"categories"===r&&(K()(n,"categories_list",{}),T()(n.taxonomy_name)&&K()(n,"taxonomy_name","category")),"select"===r&&M()(n.default)&&!T()(n.options)){var b=C()(n.options)?[]:{};f()(n.options,function(e,t){E()(e)||C()(e)?f()(e,function(e,t){b[t]=e}):b[t]=e}),T()(b)||K()(n,"default",C()(b)?y()(b):y()(P()(b)))}return n}(d),m=fe.decode(he.labels.extend_option.replace(/%s/g,g()(h,"label",p)));return this.renderField(h,m)}var v=this.getSelectedElement("payload.optionTitle"),b=he.labels.extend_option.replace(/%s/g,v);return o.a.createElement(ne.b,null,o.a.createElement(ne.c,null,fe.decode(b)))}},{key:"renderFieldTo",value:function(){if("module"===this.getSelectedSource())return!1;var e,t,n,r=(e=this.getSelectedModuleStructure(),t=L()(W()(u()({},oe.a.getModules()),function(e){return e.is_official_module&&Object(ae.isOn)(e.is_parent)}),function(e,t){var n=oe.a.getModuleTitlePlural(t);return he.labels.all.replace("%s",T()(n)?e.title:n)}),n=L()(u()({},he.options.to),function(e,n){return"containers"===n?B()(t,["et_pb_section","et_pb_row"]):u()({},e,A()(t,["et_pb_section","et_pb_row","et_pb_row_inner","et_pb_column","et_pb_column_inner"]))}),W()(n,function(t,n){return("module"!==e||"containers"!==n)&&t}));return this.renderField({options:r,type:"select",name:"to",default:this.state.to,value:this.state.to,optionGroups:he.groups.to,searchable:!0,_onChange:this.onChangeField},he.labels.to)}},{key:"renderFieldThroughout",value:function(){var e,t=(e=this.getModuleStructure(this.state.to),W()(he.options.throughout,function(t,n){return!("section"===e&&"page"!==n||"row"===e&&k()(["row","column"],n))}));return!T()(t)&&this.renderField({options:t,type:"select",name:"throughout",default:this.state.throughout,value:this.state.throughout,_onChange:this.onChangeField},he.labels.throughout)}},{key:"render",value:function(){var e,t,n=this.state.buttonState?o.a.createElement(J.a,{icon:this.state.buttonState,color:"#FFFFFF"}):he.button,r=[o.a.createElement(Y.a,{block:!0,info:!0,ink:!1,tooltip:he.button,disable:!1!==this.state.buttonState,__onClick:this.state.buttonState?I.a:this.onExtendStyles},n)],i=ue({},this.props,{measurement:{width:oe.a.getAppPreference("modal_dimension_width"),height:oe.a.getAppPreference("modal_dimension_height")},disableFullscreenButton:!0,disableSnapButton:!0,disableResizeButton:!0}),s=a()((de(e={"et-fb-modal__module-settings":!0},"et-fb-modal__"+this.slug,!0),de(e,"et-fb-modal__"+this.slug+"--"+this.getSelectedSource(),!0),e)),l=a()((de(t={"et-fb-tabs__panel":!0},"et-fb-tabs__panel--"+this.slug,!0),de(t,"et-fb-tabs__panel--"+this.slug+"--"+this.getSelectedSource(),!0),t)),u=a()(de({"et-fb-form":!0},"et-fb-form--"+this.getSelectedSource(),!0));return o.a.createElement(ee.a,ue({className:s,footerButtons:r,fullscreen:oe.a.getAppPreference("modal_fullscreen"),label:fe.decode(he.title),position:{x:oe.a.getAppPreference("modal_position_x"),y:oe.a.getAppPreference("modal_position_y")},snapLocation:oe.a.getAppPreference("modal_snap_location"),_closeFunction:this.state.buttonState?I.a:this.onClose,globalUpdate:!0},i),o.a.createElement(Z.a,null,o.a.createElement(te.d,{selectedIndex:0},o.a.createElement(te.c,{className:l,slug:this.slug,selected:!0},o.a.createElement("div",{className:u},o.a.createElement("div",{className:"et-fb-form--inner"},this.renderFieldSource(),this.renderFieldTo(),this.renderFieldThroughout()))))))}}]),t}();t.default=me},function(e,t,n){"use strict";n.r(t),function(e){var r=n(1),o=n.n(r),i=n(16),a=n(18),s=n.n(a),l=n(12),u=n.n(l),c=n(48),d=n.n(c),p=n(2),f=n.n(p),h=n(7),g=n.n(h),m=n(53),v=n.n(m),b=n(11),y=n.n(b),k=n(27),w=n.n(k),C=n(39),S=n.n(C),E=n(61),O=n.n(E),T=n(41),x=n.n(T),M=n(19),D=n.n(M),P=n(211),N=n.n(P),L=n(184),F=n.n(L),A=n(87),j=n.n(A),I=n(52),R=n.n(I),B=n(79),H=n.n(B),W=n(9),V=n.n(W),G=n(219),U=n.n(G),z=n(85),q=n.n(z),K=n(30),$=n.n(K),X=n(89),Y=n.n(X),J=n(4),Q=n.n(J),Z=n(59),ee=n.n(Z),te=n(31),ne=n.n(te),re=n(72),oe=n.n(re),ie=n(35),ae=n(33),se=n(218),le=n(1050),ue=n(259),ce=n(82),de=n(684),pe=n(296),fe=n(10),he=n(3),ge=n(853),me=n(0),ve=(n(1240),Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}),be=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function ye(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var _e=me.default.topDocument(),ke=me.default.appDocument(),we=function(e,t){var n=t||"quickActions";return f()(ETBuilderBackend.i18n,n+"."+e,e)},Ce=function(t){function n(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var t=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return t.data=me.default.intentionallyClone(ge.a.getData()),t.settingKeys=["always_start_with","show_recent_queries","recent_category","recent_queries"],t.defaultSettings=t.getDefaultSettings(),t.state=u()({},{reRender:!1,context:"modal",keyword:"",parentSelected:t.parentSelectedDefault(),pointerItem:{},itemHovered:{},inputFocused:!0,placeholder:!1,settingPanelActive:!1,lastUsedCategory:!1,mousePointer:he.a.getMousePointer()},t.defaultSettings),t.slug="quick-actions",t.placeholderId="quick-actions-placeholder",t.isScrollingList=!1,t.modalWidth=600,t.modalHeight=360,t.timeout=100,t.throttledMouseMove=j()(t.togglePlaceholder,t.timeout,{leading:!1}),t.searchInputRef=o.a.createRef(),t.setModalWrapRef=t.setModalWrapRef.bind(t),t.setResultsWrapRef=t.setResultsWrapRef.bind(t),t.setSettingPanelRef=t.setSettingPanelRef.bind(t),t.setSearchInputFocus=t.setSearchInputFocus.bind(t),t.handleSearchInput=t.handleSearchInput.bind(t),t.handleSearchInputFocus=t.handleSearchInputFocus.bind(t),t.handleSearchInputBlur=t.handleSearchInputBlur.bind(t),t.handleMouseDown=t.handleMouseDown.bind(t),t.handleMouseDownTopDocument=t.handleMouseDownTopDocument.bind(t),t.handleMouseMove=t.handleMouseMove.bind(t),t.handleKeyDown=t.handleKeyDown.bind(t),t.handleItemMouseOver=t.handleItemMouseOver.bind(t),t.handleItemClick=t.handleItemClick.bind(t),t.handleDataUpdated=t.handleDataUpdated.bind(t),t.closeModal=t.closeModal.bind(t),t.openSettingsPanel=t.openSettingsPanel.bind(t),t.closeSettingsPanel=t.closeSettingsPanel.bind(t),t.updateSetting=t.updateSetting.bind(t),t.resetResultsList=t.resetResultsList.bind(t),t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,o.a.Component),be(n,[{key:"componentDidMount",value:function(){var e=this;_e.addEventListener("keydown",this.handleKeyDown),ke.addEventListener("keydown",this.handleKeyDown),_e.addEventListener("mousedown",this.handleMouseDownTopDocument),ke.addEventListener("mousedown",this.handleMouseDown),me.default.$topWindow().on("et_fb_quick_actions_data_updated",this.handleDataUpdated),he.a.addMousePointerListener(this.handleMouseMove),setTimeout(function(){e.setSearchInputFocus()},200)}},{key:"componentDidUpdate",value:function(){this.isScrollingList=!1}},{key:"componentWillUnmount",value:function(){_e.removeEventListener("keydown",this.handleKeyDown),ke.removeEventListener("keydown",this.handleKeyDown),_e.removeEventListener("mousedown",this.handleMouseDownTopDocument),ke.removeEventListener("mousedown",this.handleMouseDown),he.a.removeMousePointerListener(this.handleMouseMove),this.removePlaceholder()}},{key:"setModalWrapRef",value:function(e){this.modalWrapRef=e}},{key:"setResultsWrapRef",value:function(e){this.resultsWrapRef=e}},{key:"setSettingPanelRef",value:function(e){this.settingPanelRef=e}},{key:"setSearchInputFocus",value:function(){g()(this.searchInputRef)||g()(this.searchInputRef.current)||(this.searchInputRef.current.setAttribute("autocomplete","off"),this.searchInputRef.current.focus())}},{key:"getDefaultSettings",value:function(){var e={};return y()(this.settingKeys,function(t){var n=he.a.getAppPreference("quick_actions_"+t);switch(t){case"recent_queries":e[t]=_.isEmpty(n)||"false"===w()(n)?[]:n.split(",");break;default:e[t]=n}}),e}},{key:"getItem",value:function(e){return x()(e)?O()(this.data,function(t){var n={},r={};return y()(e,function(e,o){n[o]=v()(f()(t,o))?f()(t,o).toLowerCase():f()(t,o),r[o]=v()(e)?e.toLocaleLowerCase():e}),S()(n,r)}):{}}},{key:"getItemHoveredIndex",value:function(){var e=this,t=g()(this.state.itemHovered)?0:F()(this.getResults(),function(t){return S()(t,e.state.itemHovered)});return parseInt(t,10)}},{key:"getResults",value:function(){var e=this,t=w()(this.state.keyword).toLowerCase(),n=this.state.parentSelected,r=function(e){var n=f()(e,"label",!1);if(n&&-1!==w()(n).toLowerCase().indexOf(t))return!0;var r=f()(e,"keywordLabel",!1);if(r&&-1!==w()(r).toLowerCase().indexOf(t))return!0;var o=f()(e,"tagLabel",!1);return!(!o||-1===w()(o).toLowerCase().indexOf(t))},o=function(){if("on"!==e.getSetting("show_recent_queries"))return[];if(!g()(e.state.keyword))return[];if(!g()(e.state.parentSelected))return[];var t=e.getSetting("recent_queries");return g()(t)?[]:t.map(function(e,t){return u()({},{label:e,key:"recent_query__"+t,parent:void 0,depth:1,recentQuery:!0})})}(),i=function(){if(!g()(t)&&!g()(n)){var o=e.data.filter(function(e){return f()(n,"key","")===e.parent});return e.data.filter(function(e){var t=O()(o,e)||O()(o,{key:e.parent,depth:e.depth-1});return r(e)&&t})}if(g()(t)&&!g()(n))return e.data.filter(function(e){return f()(n,"key","")===e.parent});if(!g()(t)&&g()(n)){var i={goto__section:{match:!1,hasChild:!1},goto__row:{match:!1,hasChild:!1},goto__module:{match:!1,hasChild:!1}},a=e.data.filter(function(e){var t=r(e);return t&&(ne()(i,e.key)&&(i[e.key].match=!0),ne()(i,e.parent)&&(i[e.parent].hasChild=!0)),t||ne()(i,e.key)}),s=$()(oe()(i,function(e){return!e.match&&!e.hasChild}));return g()(s)?a:a.filter(function(e){return!V()(s,e.key)})}return e.data.filter(function(e){return 1===e.depth})}();return ee()(o,i)}},{key:"getMousePosition",value:function(){var t=f()(this.state.mousePointer,"pageX",f()(this.state.mousePointer,"clientX",0)),n=f()(this.state.mousePointer,"pageY",f()(this.state.mousePointer,"clientY",0));return{x:t-e(window).scrollLeft(),y:n-e(window).scrollTop()}}},{key:"getSetting",value:function(e,t){return Q()(e)?Y()(this.state,$()(this.defaultSettings)):f()(this.state,e,t)}},{key:"updateSetting",value:function(e,t){if(V()(this.settingKeys,e)){var n=this.getSetting(e),r=void 0;switch(e){case"recent_queries":r=U()(q()(ee()([t],n)),5);break;default:r=t}S()(n,r)||(fe.b.quickActionsUpdateSetting(e,r),this.setState(ye({},e,r)))}}},{key:"parentSelectedDefault",value:function(){var e=f()(this.defaultSettings,"always_start_with");return"nothing"===e?{}:"recent_category"===e?this.getItem({key:f()(this.defaultSettings,"recent_category"),depth:1}):this.getItem({key:e,depth:1})}},{key:"togglePlaceholder",value:function(){var t=this;if("pointer"===this.state.context){var n=function(e){var t=e.props||e,n=f()(t,"type","");return"et_pb_section"===n?n.replace("et_pb_",""):0===n.indexOf("et_pb_row")?n.replace("et_pb_",""):0===n.indexOf("et_pb_column")?n.replace("et_pb_",""):"module"},r=he.a.getHoveredModule();if(!g()(r)){var o,i=this.state.pointerItem,a=i.group,s=i.slug,l=f()(r,"props.address"),u=e('[data-address="'+l+'"]').first(),c={fullwidth:{section:function(e){switch(n(e)){case"section":return{target:u};default:return{target:u.closest(".et_pb_section")}}},module:function(e){if(0!==s.indexOf("et_pb_fullwidth_"))return!1;switch(n(e)){case"module":return{target:u};case"section":if(u.hasClass("et-fb-no-children"))return{target:u,noChildren:!0};var t=u.find(".et_pb_module.et-first-child.et-last-child");return!(!t||!t.length)&&{target:t};default:return!1}}},specialty:{section:function(e){switch(n(e)){case"section":return{target:u};default:return{target:u.closest(".et_pb_section")}}},row:function(e){switch(n(e)){case"module":case"column_inner":return{target:u.closest(".et_pb_row_inner")};case"column":return{target:!!Object(me.hasValue)(f()(e,"attrs.specialty_columns",""))&&u,noChildren:!0};case"row_inner":return{target:u};default:return!1}},module:function(e){if(0===s.indexOf("et_pb_fullwidth_"))return!1;switch(n(e)){case"module":return{target:u};case"column_inner":return{target:u,noChildren:!0};case"column":return{target:!Object(me.hasValue)(f()(e,"attrs.specialty_columns",""))&&u,noChildren:!0};default:return!1}}},regular:{section:function(e){switch(n(e)){case"section":return{target:u};default:return{target:u.closest(".et_pb_section")}}},row:function(e){switch(n(e)){case"module":case"column":return{target:u.closest(".et_pb_row")};case"row":return{target:u};default:return{target:!!u.hasClass("et-fb-no-children")&&u,noChildren:!0}}},module:function(e){if(0===s.indexOf("et_pb_fullwidth_"))return!1;switch(n(e)){case"module":return{target:u};case"column":return{target:u,noChildren:!0};default:return!1}}}},d=Object(me.getModuleSectionType)(r,he.a.getSectionsFlattened()),p=f()(c,d+"."+a),h=!!R()(p)&&function(e){var t=e.target||!1,n=e.noChildren||!1;if(!t||!t.length)return!1;var r=n?t.find(".et-fb-add-wrap button").first():t.find(".et-fb-"+a+"-button-wrap--add button").first();return{targetAddress:t.data("address"),additionalAttrs:{position:ve({},r.offset(),{element:r.parent()})},$target:t,noChildren:n}}(p(r.props));o=h,t.state.placeholder===o||S()(t.state.placeholder,o)||f()(t.state,"placeholder.targetAddress","-1")===f()(o,"targetAddress","-2")||(this.removePlaceholder(),g()(h)||this.addPlaceholder(h),this.setState({placeholder:h}))}}}},{key:"closeModal",value:function(){fe.b.quickActionsSetContext(!this.state.context)}},{key:"addPlaceholder",value:function(t){var n,r=t.$target||!1,o=t.noChildren||!1;if(r&&r.length){var i=this.state.pointerItem,a=i.group,l=i.slug,u=f()(this.props,"previewMode","desktop"),c=s()((ye(n={"et-fb-quick-actions-placeholder":!0},"et-fb-quick-actions-placeholder--"+a,!0),ye(n,"et-fb-quick-actions-placeholder--"+a+"-fullwidth","fullwidth"===l.replace("et_fb_","")),ye(n,"et-fb-quick-actions-placeholder--"+a+"-specialty","specialty"===l.replace("et_fb_","")),ye(n,"et-fb-quick-actions-placeholder--"+a+"-regular","regular"===l.replace("et_fb_","")||"section"===l.replace("et_pb_","")),n)),d="wireframe"===u?"40px":"20px",p=e('<div id="'+this.placeholderId+'" class="'+c+'"></div>').css({opacity:0,height:0});o?r.find("> .et-fb-add-wrap").after(p):r.after(p),p.animate({height:d,opacity:1},500,"easeOutCubic")}}},{key:"removePlaceholder",value:function(){e("#"+this.placeholderId).remove()}},{key:"handleDataUpdated",value:function(){this.data=me.default.intentionallyClone(ge.a.getData());var e={reRender:!this.state.reRender};g()(this.state.parentSelected)||(e.parentSelected=this.getItem({key:f()(this.state,"parentSelected.key"),parent:f()(this.state,"parentSelected.parent"),depth:f()(this.state,"parentSelected.depth")})),this.setState(e)}},{key:"handleMouseDown",value:function(e){var t=this;if("pointer"===this.state.context&&!g()(this.state.placeholder))return this.removePlaceholder(),this.setState({context:!1}),void setTimeout(function(){var e=t.state.placeholder,n=u()({},ve({},t.state.pointerItem),{placeholder:e});fe.b.quickActionProcess(n)},200);"modal"===this.state.context&&this.modalWrapRef&&!this.modalWrapRef.contains(e.target)&&this.closeModal()}},{key:"handleMouseDownTopDocument",value:function(t){this.state.settingPanelActive&&this.settingPanelRef&&!this.settingPanelRef.contains(t.target)?this.closeSettingsPanel():"modal"!==this.state.context||e(t.target).closest(".et-fb-modal__quick-actions").length||this.closeModal()}},{key:"handleMouseMove",value:function(e){"pointer"===this.state.context&&(this.setState({mousePointer:e}),this.throttledMouseMove.cancel(),this.throttledMouseMove())}},{key:"handleKeyDown",value:function(t){var n=this,r=t.keyCode||t.which,o=27===r,i=8===r,a=38===r,s=40===r,l=13===r,u=this.state,c=u.parentSelected,d=u.keyword,p=u.inputFocused,h=u.context;if(o){if(this.state.settingPanelActive)return void this.closeSettingsPanel();if("pointer"===h)return this.setState({context:"modal",placeholder:!1}),this.removePlaceholder(),void fe.b.quickActionsSetContext("modal");this.closeModal()}if(i&&!g()(c)&&g()(d)&&p){var m=f()(c,"depth",1),v=f()(c,"parent",""),b=m>1?this.getItem({depth:m-1,key:v}):{};this.setState({keyword:"",parentSelected:b,itemHovered:{}})}if(!this.isScrollingList&&(a||s)){var y=this.getResults();if(!g()(y)){var _=function(){var e=y.length-1,t=n.getItemHoveredIndex(),r=!1;if(s)for(;!1===r&&t<=e;){t+=1;var o=f()(y,t);g()(o)||o.isGroup||(r=t)}if(a)for(;!1===r&&t>=0;){t-=1;var i=f()(y,t);g()(i)||i.isGroup||(r=t)}return r}();if(!1!==_){var k=f()(y,_);if(!g()(k)){var w=e(this.resultsWrapRef),C=w.outerHeight(),S=parseInt(w.css("padding-top"),10),E=parseInt(w.css("padding-bottom"),10),O=w.closest(".et-fb-tabs__panel"),T=O.height(),x=O.scrollTop(),M=w.find("li").eq(_),D=M.outerHeight(),P=M.offset().top-O.offset().top,N=C>T,L=0===_,F=_===y.length-1,A=function(t){n.isScrollingList=!0,e.when(O.scrollTop(t)).then(function(){n.setState({itemHovered:k})})};if(s&&N&&P+D>=T){var j=x+P+D-T;F&&(j+=E),A(j)}else if(a&&N&&P-D<=0){var I=x+P;L&&(I-=S),A(I)}else this.setState({itemHovered:k})}}}}if(l){var R=this.getResults();if(!g()(R)){var B=f()(R,this.getItemHoveredIndex());g()(B)||B.isGroup||this.handleItemClick(B)}}}},{key:"handleSearchInput",value:function(e){var t=N()(e.target.value),n=this.state.parentSelected,r={};g()(n)?r=this.getItem({label:t}):(r=this.getItem({label:t,parent:f()(n,"key")}),g()(r)&&(r=this.getItem({tabLabel:t,parent:f()(n,"key")})));var o=g()(r)||g()(r.actions)?n:r,i=g()(r)||g()(r.actions)?t:"";1===f()(o,"depth")&&this.updateSetting("recent_category",o.key),this.setState({parentSelected:o,keyword:i,itemHovered:{}})}},{key:"handleSearchInputFocus",value:function(){this.state.settingPanelActive||this.state.settingPanelActive||this.setState({inputFocused:!0})}},{key:"handleSearchInputBlur",value:function(){this.state.settingPanelActive||this.state.settingPanelActive||this.setState({inputFocused:!1})}},{key:"handleItemClick",value:function(e){if(!this.state.settingPanelActive&&!this.state.settingPanelActive){if(f()(e,"recentQuery"))return this.setState({keyword:e.label}),void this.setSearchInputFocus();if(1===f()(e,"depth")&&this.updateSetting("recent_category",e.key),g()(this.state.keyword)||this.updateSetting("recent_queries",this.state.keyword),!Q()(e.actions))return this.setState({parentSelected:e,keyword:"",itemHovered:{}}),void this.setSearchInputFocus();var t=e.key.split("__");if(V()(["insert_module","insert_saved"],t[0])&&"pointer"!==this.state.context)return this.setState({context:"pointer",mousePointer:he.a.getMousePointer(),pointerItem:e}),this.togglePlaceholder(),void fe.b.quickActionsSetContext("pointer");fe.b.quickActionProcess(e)}}},{key:"handleItemMouseOver",value:function(e){this.isScrollingList||this.setState({itemHovered:e})}},{key:"openSettingsPanel",value:function(){this.state.settingPanelActive||this.setState({settingPanelActive:!0})}},{key:"closeSettingsPanel",value:function(){this.setState({settingPanelActive:!1})}},{key:"resetResultsList",value:function(){var e={keyword:""};g()(this.state.keyword)&&!g()(this.state.parentSelected)&&(e.parentSelected=this.getItem({depth:f()(this.state.parentSelected,"depth")-1,key:f()(this.state.parentSelected,"parent")})),this.setState(e)}},{key:"renderSettingPanel",value:function(){var e=this;if(!this.state.settingPanelActive)return!1;var t={nothing:we("Nothing"),recent_category:we("Last Used Search Category")},n=H()(this.data,function(e){return 1===e.depth});y()(n,function(e){t[e.key]=e.label});var a=[{label:we("Always Start Search With"),fieldData:{name:"always_start_with",type:"select",default:"nothing",options:t,value:this.getSetting("always_start_with"),_onChange:this.updateSetting}},{label:we("Show Recent Queries"),fieldData:{name:"show_recent_queries",type:"yes_no_button",default:"off",options:{on:we("Yes"),off:we("No")},value:this.getSetting("show_recent_queries"),_onChange:this.updateSetting}}].map(function(t){var n=Object(r.createElement)(le.a.getControl(t.fieldData.type),t.fieldData);return o.a.createElement(ue.b,{name:t.fieldData.name,key:e.slug+"-form-group-"+t.fieldData.name},o.a.createElement(ue.c,null,t.label),o.a.createElement(ce.a,{componentName:t.fieldData.name},n))}),l=s()({"et-fb-quick-actions-setting-panel":!0,"et-fb-modal":!0}),u=he.a.getAppPreference("builder_animation");return o.a.createElement(i.Motion,{defaultStyle:{size:.5,opacity:0},style:{size:u?Object(i.spring)(1,{stiffness:300,damping:20}):1,opacity:u?Object(i.spring)(1,{stiffness:300,damping:20}):1}},function(t){return o.a.createElement("div",{className:"et-fb-quick-actions-setting-panel--wrap",style:{opacity:t.opacity,transform:"scale( "+t.size+" )"}},o.a.createElement("div",{className:"et-fb-quick-actions-setting-panel--button-mask"}),o.a.createElement("div",{className:l,ref:e.setSettingPanelRef},a))})}},{key:"renderSearchInput",value:function(){var e=this.state.parentSelected,t=!g()(e)&&o.a.createElement("div",{className:"et-fb-modal__header--selected"},o.a.createElement("span",null,f()(e,"tagLabel",f()(e,"label"))));return o.a.createElement("div",{className:"et-fb-modal__header--input-wrap"},t,o.a.createElement("div",{className:"et-fb-modal__header--input"},o.a.createElement("input",{type:"hidden",value:"fakeInputValueDisableBrowserAutoSuggestions",style:{display:"none"}}),o.a.createElement("input",{type:"text",id:"keyword",name:"keyword",className:"et-fb-settings-option-input et-fb-settings-option-input--block",placeholder:g()(e)?we("Search")+"...":"",value:this.state.keyword,onChange:this.handleSearchInput,onFocus:this.handleSearchInputFocus,onBlur:this.handleSearchInputBlur,ref:this.searchInputRef})),this.renderSettingPanel())}},{key:"renderResultsList",value:function(){var e=this,t=this.state.parentSelected,n=this.state.keyword;if(!g()(t)&&g()(t.actions)&&t.isLoading)return o.a.createElement(se.a,{useWrapper:!1,isLoading:!0});var i=this.getResults();if(g()(i))return o.a.createElement("div",{className:s()({"et-fb-quick-actions":!0,"et-fb-quick-actions--no-results":!0})},o.a.createElement("p",{onClick:this.resetResultsList,dangerouslySetInnerHTML:{__html:we("No options exist for this search query. <span>Click here</span> to clear your search.")}}));var a=i.filter(function(e){return e.recentQuery}),l=i.map(function(i,l){var u,c=function(t,n){return!e.state.settingPanelActive&&(g()(e.state.itemHovered)?0===t:S()(n,e.state.itemHovered))},d=s()(ye({"et-fb-quick-actions--item--label":!0,"et-fb-quick-actions--item--label--hovered":c(l,i)},"et-fb-quick-actions--item--label--depth-"+i.depth,!0)),p=s()(ye({"et-fb-quick-actions--item--description":!0,"et-fb-quick-actions--item--description--hovered":c(l,i)},"et-fb-quick-actions--item--description--depth-"+i.depth,!0)),f=s()((ye(u={"et-fb-quick-actions--item":!0},"et-fb-quick-actions--item--depth-"+i.depth,!0),ye(u,"et-fb-quick-actions--item--hovered",c(l,i)&&!i.isGroup),ye(u,"et-fb-quick-actions--item--separator",!g()(a)&&a.length-1===l),u)),h=o.a.createElement("span",{className:d},function(e){return e.injected?e.label:g()(n)||g()(e.keywordLabel)||!g()(t)?e.label:e.keywordLabel}(i)),m=o.a.createElement("span",{className:p},function(e){return!g()(e.description)&&D()(e.description)?e.description.map(function(e){return o.a.createElement("span",{key:e,"data-content":e,className:"kbd-key key-"+e})}):w()(e.description)}(i)),v={key:i.depth+"_-_"+i.key,className:f,onClick:function(){return e.handleItemClick(i)},onMouseOver:function(){return e.handleItemMouseOver(i)}},b=i.element||"div",y=i.attrs||{};return o.a.createElement("li",v,Object(r.createElement)(b,y,h,m))}),u=s()({"et-fb-quick-actions":!0,"et-fb-quick-actions--results":!0});return o.a.createElement("ul",{className:u,ref:this.setResultsWrapRef},l)}},{key:"renderPointer",value:function(){var e;if("pointer"!==this.state.context)return!1;var t=he.a.getHoveredModule();if(g()(t))return!1;var n=this.state.pointerItem,r=n.group,i=n.slug,a=this.getMousePosition(),l={className:s()((e={"et-fb-quick-actions-pointer":!0},ye(e,"et-fb-quick-actions-pointer--"+r,!0),ye(e,"et-fb-quick-actions-pointer--"+r+"--"+i.replace("et_pb_",""),"section"!==r),ye(e,"et-fb-quick-actions-pointer--"+r+"--fullwidth","fullwidth"===i.replace("et_fb_","")),ye(e,"et-fb-quick-actions-pointer--"+r+"--specialty","specialty"===i.replace("et_fb_","")),ye(e,"et-fb-quick-actions-pointer--"+r+"--regular","regular"===i.replace("et_fb_","")||"section"===i.replace("et_pb_","")),e)),tooltip:f()(ETBuilderBackend.i18n.tooltip,r+".addButton"),round:!0,info:"regular"===i.replace("et_fb_","")||"section"===i.replace("et_pb_",""),primary:"fullwidth"===i.replace("et_fb_",""),warning:"specialty"===i.replace("et_fb_",""),success:"row"===r,inverse:"module"===r,disabled:!0,onClick:d.a,style:{left:f()(a,"x",0),top:f()(a,"y",0)}};return o.a.createElement("div",{className:"et-fb-quick-actions-wrap--pointer"},o.a.createElement(ie.a,l,o.a.createElement(ae.a,{size:"14",icon:"add",color:"#FFFFFF"})))}},{key:"renderModal",value:function(){var e;if("modal"!==this.state.context)return!1;var t=s()((ye(e={"et-fb-modal__module-settings":!0},"et-fb-modal__"+this.slug,!0),ye(e,"et-fb-modal__"+this.slug+"__"+Object(me.getOS)().toLowerCase(),!0),e)),n=s()(ye({"et-fb-tabs__panel":!0},"et-fb-tabs__panel--"+this.slug,!0)),r=s()(ye({"et-fb-form":!0},"et-fb-form--"+this.slug,!0)),i=[o.a.createElement(ie.a,{tooltip:we("Settings"),ink:!1,_onClick:this.openSettingsPanel},o.a.createElement(ae.a,{icon:"setting"})),o.a.createElement(ie.a,{tooltip:we("Close"),ink:!1,_onClick:this.closeModal},o.a.createElement(ae.a,{icon:"close"}))],a=u()({},this.props,{className:t,label:this.renderSearchInput(),measurement:{width:this.modalWidth,height:this.modalHeight},alwaysCentered:!0,headerButtons:i});return o.a.createElement("div",{className:"et-fb-quick-actions-wrap--modal",ref:this.setModalWrapRef},o.a.createElement(de.a,a,o.a.createElement(ce.a,null,o.a.createElement(pe.d,{selectedIndex:0},o.a.createElement(pe.c,{className:n,slug:this.slug,selected:!0},o.a.createElement("div",{className:r},this.renderResultsList()))))))}},{key:"render",value:function(){return o.a.createElement(o.a.Fragment,null,this.renderPointer(),this.renderModal())}}]),n}();t.default=Ce}.call(this,n(28))},function(e,t,n){"use strict";n.r(t);var r=n(1),o=n.n(r),i=n(17),a=n.n(i),s=n(6),l=n.n(s),u=n(18),c=n.n(u),d=n(3),p=n(782),f=n.n(p),h=n(0),g=(n(1241),function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}());var m={active:l.a.bool},v=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r["Component"]),g(t,[{key:"componentDidMount",value:function(){h.default.$appWindow().trigger("et-core-modal-active")}},{key:"renderDescription",value:function(){var e=d.a.getAlertModalSetting("description");return h.default.hasValue(e)?o.a.createElement("div",{className:"et-core-modal-content",dangerouslySetInnerHTML:{__html:f.a.wpautop(e)}}):""}},{key:"renderButton",value:function(e,t,n){var r=c()({"et-core-modal-action":!0},n);return o.a.createElement("a",{href:"#button",className:r,onClick:t},e)}},{key:"render",value:function(){var e=h.default.replaceCodeContentEntities(d.a.getAlertModalSetting("title")),t=d.a.getAlertModalSetting("buttonCancelLabel"),n=t?this.renderButton(t,d.a.getAlertModalSetting("onClickCancelButton"),{"et-core-modal-action-secondary":!0}):"",r=d.a.getAlertModalSetting("buttonProceedLabel"),i=r?this.renderButton(r,d.a.getAlertModalSetting("onClickProceedButton"),{"et-core-modal-action-restore":!0}):"",s=t?o.a.createElement("a",{href:"#close",className:"et-core-modal-close",onClick:d.a.getAlertModalSetting("onClickCancelButton")}):"",l=["et-core-modal-overlay","et-core-active","et-fb-modal-alert"];r&&t&&l.push("et-core-modal-two-buttons");var u=o.a.createElement("div",{className:c()(l),onClick:d.a.getAlertModalSetting("onClickCancelButton")},o.a.createElement("div",{className:"et-core-modal"},o.a.createElement("div",{className:"et-fb-modal-overlay-mousetrap"}),o.a.createElement("div",{className:"et-core-modal-header"},o.a.createElement("h3",{className:"et-core-modal-title"},e),s),this.renderDescription(),o.a.createElement("div",{className:"et_pb_prompt_buttons"},n,i)));return a.a.createPortal(u,h.default.$topWindow("#et-boc #et-fb-app")[0])}}]),t}();v.propTypes=m,v.defaultProps={active:!1},t.default=v},function(e,t,n){"use strict";n.r(t);var r=n(1),o=n.n(r),i=n(17),a=n.n(i),s=n(18),l=n.n(s),u=n(26),c=n(0),d=n(3),p=n(21),f=n(35),h=n(259),g=(n(217),n(1052)),m=n(10),v=n(218),b=n(54),y=(n(1242),function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}());function _(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var k=function(e){function t(){var e,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var o=arguments.length,i=Array(o),s=0;s<o;s++)i[s]=arguments[s];return n=r=_(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(i))),r.state={consent:"",status:"initial",requestResponse:{}},r._onModalChange=function(){var e=d.a.getErrorReportModalStatus(),t=d.a.getErrorReportRequestResponse();r.setState({status:e,requestResponse:t}),"sending_success"===e&&setTimeout(function(){r._closeModal()},3e3)},r._onCheckboxChange=function(e,t){r.setState(function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},e,t)),setTimeout(function(){r.forceUpdate()},0)},r._onCloseModal=function(e){var t=c.default.$topWindow(e.target);t.closest(".et-core-modal").length>0&&!t.hasClass("et-core-modal-close")||(e.preventDefault(),e.stopPropagation(),r._closeModal())},r._closeModal=function(){c.default.$topWindow(a.a.findDOMNode(r.refs.reportModalOverlay)).addClass("et-core-closing").delay(600).queue(function(){m.b.setErrorReportModalActive(!1,null,null)})},r._onSubmitReport=function(e){m.b.sendErrorReport(d.a.getSections(),d.a.getPageSettings())},r._isSubmissionReady=function(){return c.default.isOn(r.state.consent)},_(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r["Component"]),y(t,[{key:"componentDidMount",value:function(){this._adjustModalPositionOnMount(),d.a.addErrorReportModalChange(this._onModalChange)}},{key:"componentWillUnmount",value:function(){d.a.removeErrorReportModalChange(this._onModalChange)}},{key:"_getI18n",value:function(e){return p.a.getI18n("errorBoundaries.modal."+e)}},{key:"_getModalInitialHeight",value:function(){var e=c.default.$topWindow(a.a.findDOMNode(this.refs.reportModal));return e.find(".et-core-modal-header").outerHeight()+parseInt(e.find(".et-core-modal-content").css("paddingTop"))+parseInt(e.find(".et-core-modal-content").css("paddingBottom"))+e.find(".et-fb-form__group").outerHeight()}},{key:"_adjustModalPositionOnMount",value:function(){var e=c.default.$topWindow(a.a.findDOMNode(this.refs.reportModal));if(this._getModalInitialHeight()<=parseInt(.6*c.default.$topWindow().innerHeight())){c.default.$topWindow(a.a.findDOMNode(this.refs.reportModalOverlay)).addClass("et-core-modal-disabled-scrollbar");var t=this._getModalInitialHeight();e.css({marginTop:"-"+t/2+"px"})}}},{key:"_isStatus",value:function(e){return e===this.state.status}},{key:"_isEtAccountActive",value:function(){var e=p.a.getEtAccount("et_username"),t=p.a.getEtAccount("et_api_key"),n=p.a.getEtAccount("status");return c.default.hasValue(e)&&c.default.hasValue(t)&&"active"===n}},{key:"_renderModalHeader",value:function(){return o.a.createElement("div",{className:"et-core-modal-header"},o.a.createElement("h3",{className:"et-core-modal-title"},this._getI18n("title")),o.a.createElement("a",{href:"#close",className:"et-core-modal-close",onClick:this._onCloseModal,style:{pointerEvents:this._isStatus("sending")?"none":"auto",opacity:this._isStatus("sending")?0:1}}))}},{key:"_renderPreloader",value:function(){return this._isStatus("sending")?o.a.createElement(v.a,{isLoading:!0}):null}},{key:"_renderErrorMessage",value:function(){return this._isStatus("sending_error")?o.a.createElement("div",{className:"et-fb-error-report-notification et-fb-error-report-notification--error"},Object(u.i)(this.state,"requestResponse.message",this._getI18n("errorMessage"))):null}},{key:"_renderDebugInfo",value:function(){var e=Object(u.p)(this._getI18n("debugInfo"),function(e,t){return o.a.createElement("div",{className:"et-fb-error-report-debug-items",key:"debug-info-"+t},o.a.createElement("p",{className:"et-fb-error-report-debug-items-title"},t),o.a.createElement("ul",{className:"et-fb-error-report-debug-items-list"},Object(u.p)(e,function(e){return o.a.createElement("li",{key:"debug-info-"+t+"-"+e},e.replace(/_/g," "))})))});return o.a.createElement("div",{className:"et-fb-error-report-debug-items-wrap"},e)}},{key:"_renderReportForm",value:function(){var e=this._isEtAccountActive()?o.a.createElement(h.b,null,o.a.createElement(h.c,null,this._getI18n("consentTitle")),o.a.createElement("p",{className:"et-fb-error-report-consent-description"},this._getI18n("consentDescription")),this._renderDebugInfo(),o.a.createElement(g.a,{name:"consent",_onChange:this._onCheckboxChange,options:[c.default.decodeHtmlEntities(this._getI18n("consentLabel"))],value:this.state.consent})):o.a.createElement("div",{className:"et-fb-error-report-notification et-fb-error-report-notification--error"},o.a.createElement("p",null,this._getI18n("noAccountMessage")),o.a.createElement("p",null,this._getI18n("noAccountGuide"))),t={opacity:this._isStatus("sending")?0:1,pointerEvents:this._isStatus("sending")?"none":"auto"};return o.a.createElement("form",null,this._renderPreloader(),o.a.createElement("div",{className:"et-core-modal-content",style:t},this._renderErrorMessage(),e),this._renderModalProceedButton())}},{key:"_renderBugReportSentMessage",value:function(){return o.a.createElement("div",{className:"et-core-modal-content"},o.a.createElement("p",null,this._getI18n("successMessage")),o.a.createElement("p",null,this._getI18n("successAutoclose")))}},{key:"_renderModalProceedButton",value:function(){return this._isEtAccountActive()?o.a.createElement("div",{className:"et_pb_prompt_buttons"},o.a.createElement(f.a,{buttonName:"error-boundaries-report-submit",className:"et-core-modal-action",_onClick:this._onSubmitReport,style:{backgroundColor:b.a.coreModalButtonBlue,pointerEvents:this._isStatus("sending")?"none":"auto",opacity:this._isStatus("sending")?0:1},disabled:!this._isSubmissionReady()},this._getI18n("buttonLabel"))):o.a.createElement("a",{href:p.a.getUrl("themeOptionsUrl"),className:"et-core-modal-action"},this._getI18n("noAccountButtonLabel"))}},{key:"render",value:function(){var e=o.a.createElement("div",{className:l()(["et-core-modal-overlay","et-core-active","et-fb-modal-report"]),onClick:this._onCloseModal,ref:"reportModalOverlay"},o.a.createElement("div",{className:"et-core-modal",ref:"reportModal"},o.a.createElement("div",{className:"et-fb-modal-overlay-mousetrap"}),this._renderModalHeader(),this._isStatus("sending_success")?this._renderBugReportSentMessage():this._renderReportForm()));return a.a.createPortal(e,c.default.$topWindow("#et-boc #et-fb-app")[0])}}]),t}();t.default=k},function(e,t,n){"use strict";n.r(t),function(e){var r=n(1),o=n.n(r),i=n(6),a=n.n(i),s=n(11),l=n.n(s),u=n(19),c=n.n(u),d=n(53),p=n.n(d),f=n(4),h=n.n(f),g=n(138),m=n.n(g),v=(n(48),n(3)),b=n(8),y=n(10),_=n(1243),k=n(35),w=n(33),C=n(684),S=n(296),E=n(82),O=n(0),T=(n(1245),Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}),x=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var M=ETBuilderBackend.i18n.help,D={isVisible:a.a.bool,onModalChange:a.a.func,modalMoving:a.a.bool},P=.5625;var N=function(t){function n(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var t=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));t._checkActiveModals=function(){return t.handleShortcutsTimeout=setTimeout(t._setHandleShortcuts)},t._setHandleShortcuts=function(){v.a.getActiveModule()?(O.default.appWindow().removeEventListener("keydown",t._handleShortcuts),O.default.topWindow().removeEventListener("keydown",t._handleShortcuts)):(O.default.appWindow().addEventListener("keydown",t._handleShortcuts),O.default.topWindow().addEventListener("keydown",t._handleShortcuts,{useCapture:!0}))},t.isOSX=-1!==navigator.userAgent.indexOf("Mac OS X");var r=400*P,o=Object.keys(ETBuilderBackend.i18n.videos[t.props.currentVideoList]).length;return t.state={index:null,height:50*o+116+r,width:400,position:{x:t.props.position.x,y:t.props.position.y}},t._updateSpecificModal=t._updateSpecificModal.bind(t),t._handleMouseEnter=t._handleMouseEnter.bind(t),t._handleMouseLeave=t._handleMouseLeave.bind(t),t._handleShortcuts=t._handleShortcuts.bind(t),t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,r["Component"]),x(n,[{key:"componentWillMount",value:function(){var e=this;setTimeout(function(){return e._updateSpecificModal({width:400,x:e.props.position.x,y:e.props.position.y})},0)}},{key:"componentDidMount",value:function(){this._setHandleShortcuts(),v.a.addModuleActiveListener(this._checkActiveModals),O.default.topDocument().addEventListener("keydown",this._handleShortcuts)}},{key:"componentWillUnmount",value:function(){O.default.topDocument().removeEventListener("keydown",this._handleShortcuts)}},{key:"_getHeaderButtons",value:function(){return[o.a.createElement(k.a,{primary:!0,buttonName:b.a.MODAL_HELP_BUTTON_CLOSE,tooltip:ETBuilderBackend.i18n.tooltip.modal.cancel},o.a.createElement(w.a,{icon:"close",color:"#FFFFFF"}))]}},{key:"_updateSpecificModal",value:function(e){y.b.setHelpModal({width:e.width,position:{x:e.x,y:e.y}}),this.setState({width:e.width})}},{key:"_handleMouseEnter",value:function(){this.setState({hover:!0})}},{key:"_handleMouseLeave",value:function(){this.setState({hover:!1})}},{key:"_handleShortcuts",value:function(t){var n=t.keyCode,r=t.metaKey;if((27===n||13===n&&!r)&&!e(":focus").length)return y.b.buttonClick({props:{buttonName:b.a.MODAL_HELP_BUTTON_CLOSE}}),!1}},{key:"renderKdb",value:function(e,t){var n=e;return"super"===n&&(n=this.isOSX?"cmd":"ctrl"),o.a.createElement("kbd",{key:"shortcut-item-kbd-"+t,className:"key-"+n},n)}},{key:"renderShortcutSet",value:function(e,t){var n=this,r=[];return l()(e,function(i,a){p()(i)?(r.push(n.renderKdb(i,t+"-"+a)),a<e.length-1&&r.push(o.a.createElement("span",{className:"et-fb-shortcut-separator-combination",key:"shortcut-set-separator-combination"+t+"-"+a},"+"))):l()(i,function(e,s){r.push(n.renderKdb(e,t+"-"+a+"-"+s)),s<i.length-1&&r.push(o.a.createElement("span",{className:"et-fb-shortcut-separator-optional",key:"shortcut-set-separator-optional-"+t+"-"+a+"-"+s},"/"))})}),r}},{key:"renderShortcutSets",value:function(e,t){var n=this;return c()(e)?this.renderShortcutSet(e,t):m()(e).map(function(e,r){var i=t+"-"+r;return o.a.createElement("div",{className:"et-fb-shortcut-item-set",key:"shortcut-item-set-"+i},n.renderShortcutSet(e,i))})}},{key:"renderShortcutList",value:function(){var e=this,t=ETBuilderBackend.i18n.help.shortcuts;return m()(t).map(function(t,n){return m()(t).map(function(t,r){return h()(t.title)?o.a.createElement("div",{className:"et-fb-shortcut-item",key:"shortcut-item-"+n+"-"+r},o.a.createElement("div",{className:"et-fb-shortcut-kbd"},e.renderShortcutSets(t.kbd,n+"-"+r)),o.a.createElement("div",{className:"et-fb-shortcut-desc"},o.a.createElement("p",null,t.desc))):o.a.createElement("h4",{className:"et-fb-shortcut-subtitle",key:"shortcut-item-"+n},t.title)})})}},{key:"render",value:function(){var e=this.props,t=e.currentVideo,n=e.currentVideoList,r=e.helpModalState,i=e.onModalChange,a=e.videoOverlayStatus,s=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["currentVideo","currentVideoList","helpModalState","onModalChange","videoOverlayStatus"]),l=this.state,u=l.height,c=l.hover,d=l.position,p=l.width,f=this.props.activeTab||0;return o.a.createElement(C.a,T({className:"et-fb-modal--help",headerButtons:this._getHeaderButtons(),label:M.modal.title,measurement:{height:u,width:400},onModalChange:i,onMouseEnter:this._handleMouseEnter,onMouseLeave:this._handleMouseLeave,updateSpecificModal:this._updateSpecificModal},s),o.a.createElement(S.d,{selectedIndex:f},o.a.createElement(S.b,null,o.a.createElement(S.a,null,M.modal.tabs.gettingStarted),o.a.createElement(S.a,null,M.modal.tabs.shortcut)),o.a.createElement(S.c,null,o.a.createElement("div",{className:"et-fb-form"},o.a.createElement(E.a,null,o.a.createElement(_.a,{currentVideo:t,currentVideoList:n,helpModalState:r,modalHover:c,modalPosition:d,modalWidth:p,videoOverlayStatus:a,modalMoving:this.props.modalMoving,animate:this.props.options.animate})))),o.a.createElement(S.c,null,o.a.createElement("div",{className:"et-fb-form"},o.a.createElement(E.a,null,this.renderShortcutList())))))}}]),n}();N.propTypes=D,t.default=N}.call(this,n(28))},function(e,t,n){"use strict";n.r(t),function(e){var r=n(1),o=n.n(r),i=n(17),a=n.n(i),s=n(18),l=n.n(s),u=n(74),c=n.n(u),d=n(79),p=n.n(d),f=n(2),h=n.n(f),g=n(31),m=n.n(g),v=n(9),b=n.n(v),y=n(7),_=n.n(y),k=n(52),w=n.n(k),C=n(41),S=n.n(C),E=n(4),O=n.n(E),T=n(36),x=n.n(T),M=n(252),D=n.n(M),P=n(297),N=n.n(P),L=n(100),F=n.n(L),A=n(285),j=n.n(A),I=n(3),R=n(0),B=n(10),H=n(35),W=n(8),V=n(33),G=n(684),U=n(218),z=n(296),q=n(54),K=(n(1246),function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}());function $(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var X=ETBuilderBackend.i18n,Y=function(t){function n(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var t=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e)),r=["clicks","reads","bounces","engagements","conversions","shortcode_conversions"],o=ETBuilderBackend.abTesting.refresh_interval_duration,i=j()(r,D()(r.length,function(){return o}));return t.tabList=r,t.subjects=I.a.abGetAllSubjects(),t.hasConversion=I.a.abHasConversion(h()(I.a.abGetAllGoals(),"type")),t.hasShortcodeConversions=R.default.isOn(I.a.getPageSetting("et_pb_enable_shortcode_tracking")),t.timeFilterList=["day","week","month","all"],t.renderedPieChart={},t.renderedLineChart={},t.onMountInit=!1,t.state={durations:i,tab:"clicks",loading:!1,reportData:$({},o,I.a.abGetReportData(o)),excludedSubjects:{}},t._onABTestingChange=t._onABTestingChange.bind(t),t._handleTabSwitch=t._handleTabSwitch.bind(t),t._handleFilterSubjectChange=t._handleFilterSubjectChange.bind(t),t._handleFilterTimeChange=t._handleFilterTimeChange.bind(t),t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,o.a.Component),K(n,[{key:"componentDidMount",value:function(){this.unmounted=!1,I.a.abAddChangeListener(this._onABTestingChange)}},{key:"componentDidUpdate",value:function(){this.initUI()}},{key:"componentWillUnmount",value:function(){this.unmounted=!0,I.a.abRemoveChangeListener(this._onABTestingChange)}},{key:"initUI",value:function(){var t=e(a.a.findDOMNode(this)),n=this.getCurrentTab(),r=t.find("#et-fb-ab-testing-report-table-"+n);r.tablesorter(),r.trigger("update"),r.find(".headerSortUp").length||r.find(".headerSortDown").length||r.find("thead tr:first th:first").trigger("click");var o=this.getPieChartData(),i=t.find("#et-fb-ab-testing-report-pie-"+n);w()(h()(this,["renderedPieChart",n,"destroy"]))&&this.renderedPieChart[n].destroy(),!_()(o)&&i.length&&(this.renderedPieChart[n]=new Chart(i.get(0).getContext("2d")).Pie(o,{animationEasing:"easeInCubic",animationSteps:50,tooltipTemplate:"<%if (label){%><%=label%><%}%>"}));var s=this.getLineChartData(),l=t.find("#et-fb-ab-testing-report-chart-"+n);w()(h()(this,["renderedLineChart",n,"destroy"]))&&this.renderedLineChart[n].destroy(),m()(s,"datasets")&&_()(s.datasets)&&(s.datasets=[{}]),O()(l.get(0))||(this.renderedLineChart[n]=new Chart(l.get(0).getContext("2d")).Line(s,{scaleFontSize:13,scaleFontColor:"#a1a9b1",scaleLabel:"<%=value%>%",scaleGridLineWidth:2,scaleLineWidth:2,tooltipTemplate:"<%if (label){%><%=label%>: <%}%><%= value %>%",multiTooltipTemplate:"<%= value %>%",datasetStrokeWidth:4,pointDotStrokeWidth:2,pointDotRadius:7}))}},{key:"_handleTabSwitch",value:function(e){var t=this,n=c()(x()(this.tabList,function(e){return!("conversions"===e&&!t.hasConversion)&&(!("shortcode_conversions"===e&&!t.hasShortcodeConversions)&&e)}));m()(n,e)&&this.setState({tab:h()(n,e)})}},{key:"_handleFilterSubjectChange",value:function(e){e.preventDefault();var t=h()(this,"state.excludedSubjects",{}),n=e.target.getAttribute("data-tab-name"),r=e.target.getAttribute("data-subject-id");m()(t,[n,r])?delete t[n][r]:S()(h()(t,[n]))?t[n][r]=r:t[n]=$({},r,r),this.setState({excludedSubjects:t})}},{key:"_handleFilterTimeChange",value:function(e){e.preventDefault();var t=h()(this,["state","tab"]),n=h()(this,["state","durations"]),r=e.target.getAttribute("data-time");n[t]=r,this.setState({durations:n})}},{key:"_onABTestingChange",value:function(){var e=this.getCurrentDuration(),t=h()(this,"state.reportData");t[e]=I.a.abGetReportData(e),this.unmounted||this.setState({reportData:t})}},{key:"isSubjectDisabled",value:function(e,t){var n=F()(h()(this.state,["excludedSubjects",e],[]));return m()(t,"attrs.ab_subject_id")&&b()(n,h()(t,"attrs.ab_subject_id"))}},{key:"getCurrentTab",value:function(){return h()(this,"state.tab")}},{key:"getCurrentDuration",value:function(){return h()(this,["state","durations",this.getCurrentTab()])}},{key:"getCurrentData",value:function(){return h()(this,["state","reportData",h()(this,["state","durations",this.getCurrentTab()])])}},{key:"getReportData",value:function(e){if(m()(this,["state","reportData",e]))return h()(this,["state","reportData",e]);var t=h()(this,"state.reportData");return t[e]=I.a.abGetReportData(e),this.setState({reportData:t}),I.a.abGetReportData(e)}},{key:"getRenderedSubjects",value:function(){var e=this,t=h()(e,"state.tab");return p()(this.subjects,function(n){return!e.isSubjectDisabled(t,n)})}},{key:"getLineChartData",value:function(){var e=this.getCurrentTab(),t=this.getReportData(this.getCurrentDuration()),n=h()(t,"dates");return!O()(n)&&{labels:n,datasets:x()(this.getRenderedSubjects(),function(n){var r=h()(n,"attrs.ab_subject_id"),o=h()(t,["subjects_totals","subject_"+r,"color"]),i=I.a.abGetSubjectLabel(n);return{data:F()(h()(t,["subjects_analysis","subject_"+r,e])),fillColor:"transparent",label:i,pointColor:o,pointStrokeColor:"#fff",strokeColor:o,subject_id:r}})}}},{key:"getPieChartData",value:function(){var e=h()(this,["state","reportData",this.getCurrentDuration(),"subjects_totals"]),t=h()(this,"state.tab");return O()(e)?[]:c()(x()(this.getRenderedSubjects(),function(n){var r="subject_"+h()(n,"attrs.ab_subject_id");return{value:h()(e,[r,t]),color:h()(e,[r,"color"]),label:I.a.abGetSubjectLabel(n)}}))}},{key:"headerButtons",value:function(){return[o.a.createElement(H.a,{block:!0,buttonName:W.a.AB_CLOSE_REPORT,_onClick:function(){B.b.abCloseReport()}},o.a.createElement(V.a,{icon:"close",color:"#FFFFFF"}))]}},{key:"renderSubjectFilter",value:function(e){var t=this;return x()(this.subjects,function(n,r){var i="tab-"+e+"-filter-subject-"+r,a=t.isSubjectDisabled(e,n),s=a?q.a.disabledSubject:I.a.abGetSubjectRank(n,"color");return o.a.createElement("li",{key:i},o.a.createElement("button",{"data-subject-id":h()(n,"attrs.ab_subject_id"),"data-tab-name":e,style:{backgroundColor:s},className:l()({"et-fb-ab-testing-filter-item-subject":!0,"et-fb-ab-testing-filter-item-subject--disabled":a}),onClick:t._handleFilterSubjectChange},I.a.abGetSubjectLabel(n)))})}},{key:"renderTimeFilter",value:function(e){var t=this;return x()(t.timeFilterList,function(n,r){var i="tab-"+e+"-filter-time-"+r,a=n===h()(t,["state","durations",e]);return o.a.createElement("li",{key:i},o.a.createElement("button",{className:l()({"et-fb-ab-testing-filter-item-time":!0,"et-fb-ab-testing-filter-item-time--active":a}),"data-time":n,onClick:t._handleFilterTimeChange},h()(X,["abTesting","reportFilterTime",n])))})}},{key:"renderTabPanel",value:function(e){var t=this.getCurrentData(),n="isFetchingData"===t,r=!t||_()(h()(t,"subjects_totals")),i=h()(this,["state","durations",e]),a=o.a.createElement("canvas",{id:"et-fb-ab-testing-report-chart-"+e,className:"et-fb-ab-testing-report-chart"});return o.a.createElement(z.c,{key:"abTesting-report-panel-"+e},o.a.createElement("div",{className:"et-fb-form"},o.a.createElement(U.a,{isLoading:n},r?o.a.createElement("div",{className:"et-fb-ab-testing-no-report"},o.a.createElement("object",{type:"image/svg+xml",data:ETBuilderBackend.images_uri+"/stats-no-data.svg"}),o.a.createElement("h2",null,h()(X,"abTesting.no_report.title")),o.a.createElement("p",null,h()(X,"abTesting.no_report.desc"))):o.a.createElement("div",null,o.a.createElement("ul",{className:"et-fb-ab-testing-filter--time"},this.renderTimeFilter(e),o.a.createElement("li",null,o.a.createElement(H.a,{className:"et-fb-ab-testing-report-refresh",buttonName:W.a.AB_REFRESH_REPORT,_onClick:function(){B.b.abRefreshReport(i)},tooltip:h()(X,"abTesting.reportRefreshTooltip")},o.a.createElement(V.a,{icon:"undo",color:q.a.abTestingTimeFilter})))),o.a.createElement("ul",{className:"et-fb-ab-testing-filter--subjects"},this.renderSubjectFilter(e)),a,this.renderTable(e),this.renderPieChart(e)))))}},{key:"renderTable",value:function(e){var t=this,n=h()(this,["state","durations",e]),r=I.a.abGetAnalysisFormula(e),i=h()(r,"denominator"),a=h()(r,"numerator"),s=h()(X,["abTesting","view_stats_thead_titles",e]),l=0,u=0,c=0,d=x()(this.getRenderedSubjects(),function(r){var s=h()(r,"attrs.ab_subject_id");if(O()(s))return!1;var d="subject_"+s,p=I.a.abGetSubjectLabel(r),f=h()(t,["state","reportData",n,"subjects_totals",d,i],0),g=h()(t,["state","reportData",n,"subjects_totals",d,a],0),m=h()(t,["state","reportData",n,"subjects_totals",d,e],0);return l+=parseFloat(f),u+=parseFloat(g),c+=parseFloat(m),o.a.createElement("tr",{key:"abTesting-row-"+e+"-"+n+"-"+s},o.a.createElement("td",null,s),o.a.createElement("td",null,p),o.a.createElement("td",null,f),o.a.createElement("td",null,g),o.a.createElement("td",null,m+"%"))}),p=c/d.length,f=(""+p).split(".").length>1?2:0,g=!_()(this.getRenderedSubjects())&&o.a.createElement("tr",null,o.a.createElement("td",{colSpan:"2"},h()(X,["abTesting","reportTotal"])),o.a.createElement("td",null,l),o.a.createElement("td",null,u),o.a.createElement("td",null,p.toFixed(f)+"%"));return o.a.createElement("div",{className:"et-fb-ab-testing-report-table--wrapper"},o.a.createElement("table",{id:"et-fb-ab-testing-report-table-"+e,className:"et-fb-ab-testing-report-table"},o.a.createElement("thead",null,o.a.createElement("tr",null,o.a.createElement("th",null,s[0]),o.a.createElement("th",null,s[1]),o.a.createElement("th",null,s[2]),o.a.createElement("th",null,s[3]),o.a.createElement("th",null,s[4]))),o.a.createElement("tbody",null,d),o.a.createElement("tfoot",null,g)))}},{key:"renderPieChart",value:function(e){var t=this,n=x()(this.subjects,function(n,r){var i=t.isSubjectDisabled(t.state.tab,n),a=i?"#E1E4E9":I.a.abGetSubjectRank(n,"color"),s=i?{color:"#E1E4E9"}:{};return o.a.createElement("li",{key:e+"-legend-"+r},o.a.createElement("span",{style:{backgroundColor:a}}),o.a.createElement("a",{href:"#subject",style:s,"data-subject-id":h()(n,"attrs.ab_subject_id"),"data-tab-name":e,onClick:t._handleFilterSubjectChange},I.a.abGetSubjectLabel(n)))}),r=_()(h()(this.getLineChartData(),"datasets"))?o.a.createElement("div",{className:"et-fb-ab-testing-report-chart"}):o.a.createElement("canvas",{id:"et-fb-ab-testing-report-pie-"+e,className:"et-fb-ab-testing-report-pie",width:"200",height:"200"});return o.a.createElement("div",{className:"et-fb-ab-testing-report-pie--wrapper"},r,o.a.createElement("ul",{className:"et-fb-ab-testing-report-pie--legend"},n))}},{key:"render",value:function(){var e=this,t=this,n=x()(this.tabList,function(e){return!("conversions"===e&&!t.hasConversion)&&(!("shortcode_conversions"===e&&!t.hasShortcodeConversions)&&o.a.createElement(z.a,{key:"abTesting-report-nav-"+e},h()(X,["abTesting","reportTabNavs",e])))}),r=x()(this.tabList,function(n){return!("conversions"===n&&!t.hasConversion)&&(!("shortcode_conversions"===n&&!t.hasShortcodeConversions)&&e.renderTabPanel(n))});return o.a.createElement(G.a,{fullscreen:!0,headerButtons:this.headerButtons(),footerButtons:[o.a.createElement(H.a,{block:!0,info:!0,buttonName:W.a.BUTTON_AB_DISABLE},N()(h()(X,"abTesting.reportEndTestButton")))],label:h()(X,"abTesting.reportTitle"),onRest:function(){t.onMountInit||(t.initUI(),t.onMountInit=!0)}},o.a.createElement(z.d,{selectedIndex:0,onSelect:this._handleTabSwitch},o.a.createElement(z.b,{disableScroll:!1},n),r))}}]),n}();t.default=Y}.call(this,n(28))},function(e,t,n){"use strict";n.r(t),function(e){var r=n(1),o=n.n(r),i=n(6),a=n.n(i),s=n(1100),l=(n(1260),n(4)),u=n.n(l),c=n(2),d=n.n(c),p=n(31),f=n.n(p),h=n(76),g=n.n(h),m=n(39),v=n.n(m),b=n(7),y=n.n(b),_=n(521),k=n.n(_),w=n(69),C=n.n(w),S=n(193),E=n.n(S),O=n(30),T=n.n(O),x=n(79),M=n.n(x),D=n(61),P=n.n(D),N=n(9),L=n.n(N),F=n(87),A=n.n(F),j=n(59),I=n.n(j),R=n(3),B=n(10),H=n(0),W=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var V={active:a.a.bool},G=H.default.$appWindow("body"),U=H.default.$topWindow("body"),z=H.default.condition("is_bfb"),q=function(t){function n(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this));e.productTourLocalization=ETBuilderBackend.i18n.productTourText;var t={__html:e.productTourLocalization.start.description},r=o.a.createElement("div",{className:"et-fb-product-tour-text",dangerouslySetInnerHTML:t});if(e.state={isActive:!0,modalContent:r,modalTitle:e.productTourLocalization.start.title,endButtonText:e.productTourLocalization.start.endButtonText,skipButtonText:e.productTourLocalization.start.skipButtonText,tourElement:"start",autoLoadDemo:!1,modalPosition:{top:1e3,left:1e3,element:!1}},e.stepsSequence=e.getAvailableTourItems(),e.appliedModalOffsets={},e.skipToArray={start:"loadLayout",moveModule:"rightClickCopy",rightClickCopy:"rowOptions",rightClickPaste:"rowOptions",rowOptions:"pageSettings",tabletPreview:"desktopPreview",desktopPreview:"openHistory",openHistory:"savePage",savePage:"finish"},e.absolutelyPositionedElements=["addSection","selectModule","selectSectionType","selectRow","rowOptions","rightClickPaste","rightClickCopy","moveModule","duplicateModule"],z){e.absolutelyPositionedElements=I()(e.absolutelyPositionedElements,["loadLayout","tabletPreview","desktopPreview","openHistory","savePage"]),e.skipToArray.rowOptions="tabletPreview"}return e.onClose=e.onClose.bind(e),e.nextTip=e.nextTip.bind(e),e.nextTourContent=e.nextTourContent.bind(e),e.skipTip=e.skipTip.bind(e),e.isTourButtonClicked=e.isTourButtonClicked.bind(e),e.getActiveElementPosition=e.getActiveElementPosition.bind(e),e.getAvailableTourItems=e.getAvailableTourItems.bind(e),e.autoloadLayout=e.autoloadLayout.bind(e),e.setAfterMoveStep=e.setAfterMoveStep.bind(e),e.maybeScroll=e.maybeScroll.bind(e),e.maybeAddScrollbar=e.maybeAddScrollbar.bind(e),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,o.a.Component),W(n,[{key:"componentDidMount",value:function(){var t=this,n=this;(G.add(U).on("click mouseup mousedown","*",n.isTourButtonClicked),G.add(U).on("mouseup click",".et-fb-product-tour-element",function(t){"mouseup"===t.type&&"selectRow"!==n.state.tourElement||e(this).hasClass("et_fb_move_module_handler")||e(this).hasClass("et-fb-product-tour-element-text")||setTimeout(n.nextTip,0)}),G.add(U).on("keyup",".et-fb-product-tour-element-text",function(){setTimeout(n.nextTip,0)}),G.add(U).on("mouseup",".et-fb-product-tour-secondary-element",function(){B.b.setActiveTourElement(n.state.tourElement,!0)}),G.add(U).on("mousedown",".et_fb_move_module_handler.et-fb-product-tour-element",function(){n.nextTip()}),G.add(U).on("et_fb_product_tour_element_clicked",function(e){return setTimeout(t.nextTip,0)}),H.default.$topWindow("#et-boc #et-fb-app").append('<div class="et-core-modal-overlay et-fb-product-tour-overlay et-core-active"></div>'),e(".et_search_form_container").length>0&&e(".et_search_form_container").addClass("et_pb_is_animating"),e(".et_header_style_slide .et_slide_in_menu_container").length>0)&&(e(".et_header_style_slide .et_slide_in_menu_container").addClass("et_pb_slide_menu_opened"),e("#main-header").on("click",".et_toggle_slide_menu",n.disableSlideMenu));e(".et_header_style_fullscreen .et_slide_in_menu_container").length>0&&e("#page-container").on("click",".et_toggle_fullscreen_menu",n.disableFullscreenMenu),R.a.addProductTourMoveFinishedListener(this.setAfterMoveStep),U.on("click",".et-fb-tour-video-overlay",function(){var t=e(this),n=t.data("video");t.replaceWith('<iframe width="200" height="150" src="'+n+'" frameborder="0" allowfullscreen></iframe>')}),U.on("mousedown, click, mouseup","#publishing-action.et-fb-product-tour-element",function(e){return e.preventDefault(),!1}),this.shortThrottleReset=A()(this.maybeAddScrollbar,100),H.default.appWindow().addEventListener("resize",this.shortThrottleReset),this.maybeAddScrollbar()}},{key:"componentWillUnmount",value:function(){R.a.removeProductTourMoveFinishedListener(this.setAfterMoveStep),H.default.appWindow().removeEventListener("resize",this.shortThrottleReset),G.off("click mouseup mousedown","*",this.isTourButtonClicked),G.off("et_fb_product_tour_element_clicked")}},{key:"disableSlideMenu",value:function(){var t=e(".et_header_style_slide .et_slide_in_menu_container");return t.hasClass("et_pb_slide_menu_opened")?t.removeClass("et_pb_slide_menu_opened"):t.addClass("et_pb_slide_menu_opened"),!1}},{key:"disableFullscreenMenu",value:function(){e(".et_header_style_fullscreen .et_slide_in_menu_container").removeClass("et_pb_fullscreen_menu_opened"),G.removeClass("et_pb_fullscreen_menu_active")}},{key:"maybeAddScrollbar",value:function(){var t=e(".et-fb-tooltip--product-tour--centered"),n=H.default.$appWindow().height();this.getActiveElementPosition(this.state.tourElement),800>n?t.addClass("et-core-modal-enabled-scrollbar"):t.removeClass("et-core-modal-enabled-scrollbar")}},{key:"setAfterMoveStep",value:function(){var e=d()(this.stepsSequence,C()(this.stepsSequence,"moveModule")+1,"");R.a.setProductTourElementReady(e)}},{key:"isTourButtonClicked",value:function(t){return"mouseup"===t.type&&"moveModule"===this.state.tourElement||(!(0===e(t.target).closest(".et-fb-product-tour-element, .et-fb-product-tour-secondary-element, .et-fb-tooltip--product-tour, .et-fb-modal__module-settings, .et-fb-modal-history, .et-fb-tour-video-overlay, #wpadminbar, .et-fb-product-tour-secondary-element-hidden").length||e(t.target).closest(".et-fb-modal__footer").length>0&&0===e(t.target).closest(".et-fb-product-tour-element, .et-fb-product-tour-secondary-element, .et-fb-product-tour-secondary-element-hidden").length)||(t.preventDefault(),t.stopPropagation(),!1))}},{key:"maybeScroll",value:function(){var e=z?"top":"app";if("selectModule"===this.state.tourElement&&H.default.$topWindow(".et-fb-settings-options-wrap").animate({scrollTop:150},400),"editRow"===this.state.tourElement&&H.default.$topWindow(".et-fb-tabs__panel--general").animate({scrollTop:130},400),L()(this.absolutelyPositionedElements,this.state.tourElement)){var t=H.default.$topWindow(".et-fb-tooltip--product-tour").length>0?H.default.$topWindow(".et-fb-tooltip--product-tour"):H.default.$appWindow(".et-fb-tooltip--product-tour");if(t.length>0){var n=H.default.$topWindow().height(),r=("top"===e?H.default.$topWindow().scrollTop():H.default.$appWindow().scrollTop())+n,o=t.innerHeight(),i=t.offset().top,a=z?90:0,s=0===H.default.$appWindow(".et-fb-product-tour-element").length?H.default.$topWindow(".et-fb-product-tour-element"):H.default.$appWindow(".et-fb-product-tour-element"),l=z&&s.closest(".et-fb-page-settings-bar").length>0;if(r<i+o+a||l){var u=i-o/2-a;("top"===e?H.default.$topWindow("html, body"):H.default.$appWindow("html, body")).animate({scrollTop:u<0?0:u},500,"swing")}}}else this.maybeAddScrollbar()}},{key:"getAvailableTourItems",value:function(){var e=!1,t=!1,n=!1,r=R.a.isAllowedAction("divi_library")&&R.a.isAllowedAction("load_layout"),o=R.a.isAllowedAction("add_module"),i=R.a.isAllowedAction("edit_module"),a=R.a.isAllowedAction("move_module");if(R.a.isAllowedAction("et_pb_blurb"))e=!0,R.a.setProductTourModuleName("et_pb_blurb");else{var s,l=M()(ETBuilderBackend.modules,{is_parent:"on"});s=P()(l,function(e){return!L()(["et_pb_section","et_pb_row","et_pb_row_inner","et_pb_column","et_pb_column_inner"],e.label)&&R.a.isAllowedAction(e.label)}),y()(s)||(s.label,R.a.setProductTourModuleName(s.label),e=!0)}(R.a.isAllowedAction("general_settings")||R.a.isAllowedAction("advanced_settings")||R.a.isAllowedAction("custom_css_settings"))&&(t=!(!R.a.isAllowedAction("general_settings")&&!R.a.isAllowedAction("custom_css_settings")),n=!0);var u={start:!0,loadLayout:r,selectLayoutPack:r,loadLayoutItem:r,addSection:e&&o,selectSectionType:e&&o,selectRow:e&&o,selectModule:e&&o,configureModule:e&&o&&t,saveModule:e&&o,duplicateModule:e&&o,moveModule:a,rightClickCopy:o,rightClickPaste:o,rowOptions:i&&n,editRow:i&&n,saveRow:i&&n,pageSettings:!H.default.condition("is_bfb"),tabletPreview:!0,desktopPreview:!0,openHistory:!0,editHistory:!0,savePage:!0,finish:!0};return T()(E()(u,this.isFalse))}},{key:"isFalse",value:function(e){return!1===e}},{key:"getActiveElementPosition",value:function(e){var t=0===H.default.$appWindow(".et-fb-product-tour-element").length,n=t?H.default.$topWindow(".et-fb-product-tour-element"):H.default.$appWindow(".et-fb-product-tour-element"),r=this.state.modalPosition,o=this.getElementOffset(e),i=z?H.default.$topWindow("#et-bfb-app-frame").offset():0,a=t&&!z?H.default.$appWindow().scrollTop():0;if(!o.usePrevElementPosition&&n.length>0&&(r=n.offset(),n.closest(".et-fb-page-settings-bar").length>0))if(z)n.closest(".et-fb-page-settings-bar__column--left").length>0&&(r.top-=i.top,r.left-=200);else{var s=n.closest(".et-fb-page-settings-bar");r.top=s.position().top-100}u()(r)?this.setState({isActive:!0}):(r.top+=a,d()(this.appliedModalOffsets,e)?r=this.appliedModalOffsets[e]:(r.element=!1,r.top+=k()(d()(o,"top",0)),r.left+=k()(d()(o,"left",0)),this.appliedModalOffsets[e]=r),z&&t&&(n.closest(".et-fb-modal__module-settings").length>0||n.closest(".et-fb-tooltip-modal").length>0||n.closest(".et-fb-right-click-menu").length>0)&&(r.top-=k()(i.top)+200),this.setState({modalPosition:r,isActive:!0}))}},{key:"getElementOffset",value:function(e){var t={top:100,left:0,usePrevElementPosition:!1};switch(e){case"loadLayout":case"openHistory":case"pageSettings":t={left:-50,top:z?130:80};break;case"selectLayoutPack":t={left:850,top:-330,usePrevElementPosition:!0};break;case"loadLayoutItem":t={left:0,top:150,usePrevElementPosition:!0};break;case"addSection":t={left:-240,top:100};break;case"selectSectionType":t={left:600,top:150};break;case"selectModule":t={left:600,top:19};break;case"selectRow":t={left:-500,top:163};break;case"configureModule":t={left:590,top:-700};break;case"saveModule":t={left:630,top:-878};break;case"duplicateModule":t={left:410,top:247};break;case"rightClickCopy":t={left:440,top:255};break;case"moveModule":t={left:810,top:260};break;case"rightClickPaste":t={left:-300,top:307};break;case"rowOptions":t={left:367,top:250};break;case"editRow":t={left:590,top:-710};break;case"saveRow":t={left:320,top:-879};break;case"tabletPreview":t={left:50,top:75};break;case"desktopPreview":t={left:100,top:75};break;case"editHistory":t={left:320,top:-879};break;case"savePage":t={left:-125,top:95}}return t}},{key:"nextTourContent",value:function(e){var t=this,n=d()(this.productTourLocalization,[e,"endButtonText"],this.productTourLocalization.endButtonTextDefault),r=d()(this.productTourLocalization,[e,"skipButtonText"],this.productTourLocalization.skipButtonTextDefault),i=d()(this.productTourLocalization,[e,"title"],""),a=d()(this.productTourLocalization,[e,"description"],!1);setTimeout(function(){t.getActiveElementPosition(e)},200);var s={__html:a};a=o.a.createElement("div",{className:"et-fb-product-tour-text",dangerouslySetInnerHTML:s}),this.setState({tourElement:e,modalContent:a,modalTitle:i,endButtonText:n,skipButtonText:r}),setTimeout(this.maybeScroll,1e3)}},{key:"nextTip",value:function(e){var t=this,n=this.state.tourElement,r=d()(this.stepsSequence,C()(this.stepsSequence,n)+1,"");if(e)if(f()(this.skipToArray,n)){var o=this.skipToArray[n];if(-1===C()(this.stepsSequence,o))for(;-1===C()(this.stepsSequence,o);)o=f()(this.skipToArray,o)?this.skipToArray[o]:r;r=o}else if(L()(["selectLayoutPack","loadLayoutItem"],n)){var i="loadLayoutItem"===n?"button:last-child":"";H.default.$appWindow().trigger("et-fb-product-tour-skip",i)}else{(0===H.default.$appWindow(".et-fb-product-tour-element").length?H.default.$topWindow(".et-fb-product-tour-element"):H.default.$appWindow(".et-fb-product-tour-element")).trigger("click"),"pageSettings"===n&&B.b.settingsBarToggleStatus("active")}var a=!1,s=!1,l=[];switch("loadLayoutItem"===n&&B.b.settingsBarToggleStatus("inactive"),r){case"loadLayout":H.default.$topWindow("#et-boc #et-fb-app").find(".et-fb-product-tour-overlay").remove(),B.b.settingsBarToggleStatus("active");break;case"selectLayoutPack":case"loadLayoutItem":a=!0,l.push(r);break;case"moveModule":case"rowOptions":case"rightClickCopy":"not_set"===R.a.getProductTourModule()&&R.a.setProductTourModule(),"moveModule"!==n||e||l.push(r);break;case"savePage":z&&H.default.$topWindow("#publishing-action").addClass("et-fb-product-tour-element");break;case"finish":z&&H.default.$topWindow("#publishing-action").removeClass("et-fb-product-tour-element"),H.default.$topWindow("#et-boc #et-fb-app").append('<div class="et-core-modal-overlay et-fb-product-tour-overlay et-core-active"></div>')}if(L()(["moveModule","loadLayoutItem"],n)&&(a=!0,s=!0,"loadLayoutItem"===n&&l.push("addSection")),"start"===n&&"loadLayout"!==r&&(l.push("predefined_layouts"),a=!0,"pageSettings"===r&&(s=!0),this.setState({autoLoadDemo:!0}),R.a.activateGlobalPreloader(),R.a.emitPreloaderInProcess(),this.autoloadLayout(!0)),this.setState({isActive:!1}),s||setTimeout(function(){B.b.setActiveTourElement(r)},0),a)this.waitProductTourElement(l,r,s);else{var u=L()(["rightClickCopy","rightClickPaste"],n)?800:500;setTimeout(function(){t.nextTourContent(r)},u)}}},{key:"waitProductTourElement",value:function(e,t,n){var r=this,o=R.a.getProductTourElementReady();if(v()(e,g()(o,e)))return n&&B.b.setActiveTourElement(t),void this.nextTourContent(t);setTimeout(function(){r.waitProductTourElement(e,t,n)},1e3)}},{key:"autoloadLayout",value:function(e){if((this.state.autoLoadDemo||e)&&!y()(results)){var t=results.pop();this.setState({autoLoadDemo:!1}),t[0].savedShortcode=t[0].shortcode,R.a.loadSavedLayoutFromComponent(t[0],!0),setTimeout(function(){R.a.replacePageContent(),R.a.setProductTourElementReady("predefined_layouts"),H.default.$topWindow("#et-boc #et-fb-app").find(".et-fb-product-tour-overlay").remove()},1e3)}}},{key:"onClose",value:function(){B.b.endProductTour();(H.default.$topWindow("#et-boc #et-fb-app").find(".et-fb-product-tour-overlay").remove(),e(".et_search_form_container").length>0&&e(".et_search_form_container").removeClass("et_pb_is_animating"),e(".et_header_style_slide .et_slide_in_menu_container").length>0)&&(e(".et_header_style_slide .et_slide_in_menu_container").removeClass("et_pb_slide_menu_opened"),G.removeClass("et_pb_slide_menu_active"),e("#main-header").off("click",".et_toggle_slide_menu",this.disableSlideMenu));e(".et_header_style_fullscreen .et_slide_in_menu_container").length>0&&e("#page-container").off("click",".et_toggle_fullscreen_menu",this.disableFullscreenMenu),this.setState({isActive:!1}),G.off("click mouseup mousedown ondragstart","*",this.isTourButtonClicked)}},{key:"skipTip",value:function(){this.nextTip(!0)}},{key:"render",value:function(){if(!this.state.isActive)return!1;var e="finish"===this.state.tourElement?"":o.a.createElement("a",{href:"#",className:"et-core-modal-action et-core-modal-action-dont-restore et-core-modal-action-secondary",onMouseUp:this.skipTip},this.state.skipButtonText),t=o.a.createElement("div",{className:"et-fb-tour-buttons"},o.a.createElement("a",{href:"#",className:"et-core-modal-action et-core-modal-action-dont-restore",onClick:this.onClose},this.state.endButtonText),e),n=!L()(this.absolutelyPositionedElements,this.state.tourElement),r={"et-fb-tooltip--no-arrow":!0,"et-fb-tooltip--product-tour":!0,"et-fb-tooltip--product-tour--centered":"start"===this.state.tourElement||"finish"===this.state.tourElement,"et-fb-tooltip--product-tour--finish":"finish"===this.state.tourElement},i="start"===this.state.tourElement||"finish"===this.state.tourElement,a=0===H.default.$appWindow(".et-fb-product-tour-element").length;return o.a.createElement(s.default,{active:this.state.isActive,actionType:"custom_content",tooltipTitle:this.state.modalTitle,_closeFunction:this.onClose,classNames:r,modalPosition:this.state.modalPosition,forceFixedPosition:n,modalWidth:340,enableContextMenu:!0,ignorePosition:i,movable:!i,buttons:t,renderInsideApp:!a&&!z},o.a.createElement("div",null,this.state.modalContent))}}]),n}();q.propTypes=V,q.defaultProps={active:!1},t.default=q}.call(this,n(28))},function(e,t,n){"use strict";n.r(t),function(e){var r=n(1),o=n.n(r),i=n(6),a=n.n(i),s=(n(18),n(259)),l=n(1100),u=n(217),c=n(1052),d=n(33),p=n(218),f=n(54),h=(n(1261),n(7)),g=n.n(h),m=n(2),v=n.n(m),b=n(36),y=n.n(b),_=n(4),k=n.n(_),w=n(9),C=n.n(w),S=n(74),E=n.n(S),O=n(125),T=n.n(O),x=n(11),M=n.n(x),D=n(87),P=n.n(D),N=n(149),L=n.n(N),F=n(231),A=n.n(F),j=(n(100),n(161)),I=n.n(j),R=n(71),B=n.n(R),H=n(3),W=(n(21),n(10)),V=n(0),G=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var U={active:a.a.bool},z=V.default.$topWindow("body"),q=ETBuilderBackend.i18n.fonts,K=ETBuilderBackend.allFontWeights,$=ETBuilderBackend.allFontFormats,X=function(t){function n(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this));return e.state={fontFilesData:{},fontError:"",errorElements:[],fontName:"",fontProcessing:!1,selectedFontWeightsAll:"on",selectedFontWeights:"",activeDescription:null,hoveredGroup:null},e._onFileUpload=e._onFileUpload.bind(e),e.onUpload=e.onUpload.bind(e),e.onDelete=e.onDelete.bind(e),e._onFontNameInput=e._onFontNameInput.bind(e),e.processFont=e.processFont.bind(e),e.updateFontSettings=e.updateFontSettings.bind(e),e.fontDataValid=e.fontDataValid.bind(e),e.maybeAddScrollbar=e.maybeAddScrollbar.bind(e),e.generateFilesListPreview=e.generateFilesListPreview.bind(e),e.removeFontFile=e.removeFontFile.bind(e),e._onClickHelp=e._onClickHelp.bind(e),e._isDescriptionVisible=e._isDescriptionVisible.bind(e),e._isHoveredGroup=e._isHoveredGroup.bind(e),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,o.a.Component),G(n,[{key:"componentDidMount",value:function(){z.append('<div class="et-core-modal-overlay et-fb-font-upload-overlay et-core-active"></div>'),z.addClass("et-fb-global-scroll-disabled"),this.shortThrottleReset=P()(this.maybeAddScrollbar,100),V.default.appWindow().addEventListener("resize",this.shortThrottleReset),this.maybeAddScrollbar();var e=H.a.getDroploaderPayloadFont();e&&this.setState({fontFilesData:e.fontFilesData,fontName:e.fontName})}},{key:"componentWillUnmount",value:function(){z.removeClass("et-fb-global-scroll-disabled"),V.default.appWindow().removeEventListener("resize",this.shortThrottleReset)}},{key:"_onClickHelp",value:function(e){var t=this.state.activeDescription===e?null:e;this.setState({activeDescription:t})}},{key:"_isDescriptionVisible",value:function(e){return this.state.activeDescription===e}},{key:"_isHoveredGroup",value:function(e){return this.state.hoveredGroup===e}},{key:"maybeAddScrollbar",value:function(){var e=V.default.$topWindow(".et-fb-font-upload-modal");800>V.default.$topWindow().height()?e.addClass("et-core-modal-enabled-scrollbar"):e.removeClass("et-core-modal-enabled-scrollbar")}},{key:"fontDataValid",value:function(e){var t=[],n="";return"add"!==e||(""===this.state.fontName&&t.push("fontName"),g()(this.state.fontFilesData)&&(n=q.noFilesError,t.push("fontFile")),"on"!==this.state.selectedFontWeightsAll&&-1===this.state.selectedFontWeights.indexOf("on")&&t.push("fontWeight"),g()(t)?(this.setState({errorElements:[],fontError:""}),!0):(this.setState({errorElements:t,fontProcessing:!1,fontError:n}),!1))}},{key:"_onFontNameInput",value:function(e,t){var n=A()(this.state.errorElements,function(e){return"fontName"===e});this.setState({fontName:t,errorElements:n})}},{key:"onUpload",value:function(){this.state.fontProcessing||this.processFont("add")}},{key:"onDelete",value:function(){this.state.fontProcessing||this.processFont("remove",this.props.fontID)}},{key:"getFontWeights",value:function(){if("on"===this.state.selectedFontWeightsAll)return"all";var e=this.state.selectedFontWeights.split("|"),t=0;return E()(y()(K,function(n,r){return"on"===e[++t-1]&&r})).join(",")}},{key:"processFont",value:function(t,n){var r=this,o=k()(n)?r.state.fontName:n,i={};if(r.fontDataValid(t)){r.setState({fontError:"",errorElements:[],fontProcessing:!0}),"add"===t&&(i=JSON.stringify({font_weights:r.getFontWeights(),generic_family:"sans-serif"}));var a=new FormData,s={action:"et_pb_process_custom_font",et_pb_font_action:t,et_fb_upload_font_nonce:ETBuilderBackend.nonces.uploadFontNonce,et_pb_font_name:o,et_pb_font_settings:i};M()(r.state.fontFilesData,function(e,t){s["et_pb_font_file_"+t]=e.file}),e.each(s,function(e,t){a.append(e,t)}),e.ajax({type:"POST",url:ETBuilderBackend.ajaxUrl,contentType:!1,processData:!1,data:a,success:function(n){var o=e.parseJSON(n);if(g()(o.error)){if(ETBuilderBackend.customFonts=v()(o,"updated_fonts",ETBuilderBackend.customFonts),r.setState({fontError:"",fontProcessing:!1}),"add"===t&&""!==r.props.callback){var i=v()(o,"uploaded_font","");r.props.callback(i)}r.onClose()}else r.setState({fontError:o.error,fontProcessing:!1})}})}}},{key:"getFontName",value:function(e){return v()(ETBuilderBackend.customFonts,[e,"font_name"],e)}},{key:"onClose",value:function(){W.b.setFontUploaderStatus("disabled"),V.default.$topWindow(".et-fb-font-upload-overlay").remove()}},{key:"_onFileUpload",value:function(e){var t=e.target.files,n=this.state.fontFilesData;if(!(B()(t)<1))if(M()(t,function(e){var t=I()(v()(e,"name",""));M()($,function(r){T()(t,r)&&(n[r]={fileName:t,file:e})})}),g()(n)){var r=q.fileError+". "+q.supportedFiles+": "+$.join(", ");this.setState({fontError:r})}else this.setState({fontFilesData:n,fontError:""})}},{key:"updateFontSettings",value:function(e,t){switch(e){case"et-font-uploader-weights-all":this.setState({selectedFontWeightsAll:t});break;case"et-font-uploader-weights-select":this.setState({selectedFontWeights:t})}}},{key:"removeFontFile",value:function(t){var n=e(t.target).closest(".et-fb-font-files-list-item");if(!(n.length<1)){var r=n.data("file_ext"),o=this.state.fontFilesData;L()(o,r),this.setState({fontFilesData:o})}}},{key:"generateFilesListPreview",value:function(){var e=this;if(g()(this.state.fontFilesData))return!1;var t=y()(this.state.fontFilesData,function(t,n){return o.a.createElement("div",{className:"et-fb-font-files-list-item","data-file_ext":n,key:n},o.a.createElement("span",{className:"et-fb-font-files-list-item-remove",onClick:e.removeFontFile},o.a.createElement(d.a,{icon:"delete",color:f.a.danger})),t.fileName)});return o.a.createElement("div",{className:"et-fb-font-files-list"},o.a.createElement("label",{className:"et-fb-form__label"},o.a.createElement("span",{className:"et-fb-form__label-text"},q.selectedFiles,":")),t)}},{key:"getWeightCheckboxValues",value:function(){var e=[];return M()(K,function(t,n){var r=t+" "+n;e.push({value:t,label:r})}),e}},{key:"render",value:function(){var e={"et-fb-font-upload-modal":!0,"et-fb-font-upload-modal--delete":"delete"===this.props.action,"et-fb-modal-allow-scroll":!0},t=""!==this.state.fontError?o.a.createElement("div",{className:"et-fb-font-upload-error"},this.state.fontError):"",n="";if(this.state.fontProcessing)n=o.a.createElement(p.a,{isLoading:!0});else if("delete"===this.props.action){var r=o.a.createElement("div",{className:"et_pb_prompt_buttons et-fb-font-delete-confirmation"},o.a.createElement("a",{href:"#",className:"et-core-modal-action et-core-modal-action-dont-restore et-core-modal-action-secondary",onClick:this.onClose},q.cancel),o.a.createElement("a",{href:"#",className:"et-core-modal-action et-core-modal-action-restore",onClick:this.onDelete},q.delete));n=o.a.createElement("div",null,o.a.createElement("div",{className:"et-core-modal-content"},q.deleteConfirm+' "'+this.getFontName(this.props.fontID)+'"',"?"),r)}else{var i="on"!==this.state.selectedFontWeightsAll?o.a.createElement(c.a,{options:this.getWeightCheckboxValues(),name:"et-font-uploader-weights-select",_onChange:this.updateFontSettings,value:this.state.selectedFontWeights}):"",a=o.a.createElement("a",{href:"#",className:"et-core-modal-action et-core-modal-action-dont-restore",onClick:this.onUpload},q.upload);n=o.a.createElement("div",null,o.a.createElement("div",{className:"et-core-modal-content et-fb-allow-mouse-wheel"},o.a.createElement("div",{className:"et-core-modal-content-inner et-fb-allow-mouse-wheel-form"},t,o.a.createElement("label",{className:"et-fb-form__label"},o.a.createElement("span",{className:"et-fb-form__label-text"},q.fontNameLabel)),o.a.createElement(u.a,{type:"text",value:this.state.fontName,name:"userFontName",_onChange:this._onFontNameInput,className:!!C()(this.state.errorElements,"fontName")&&"et-fb-font-error-element",additional_attrs:{placeholder:q.fontName}}),o.a.createElement("div",{className:"et-fb-upload-file-container"},o.a.createElement("span",{className:"et-core-portability-import-placeholder"},q.noFile),o.a.createElement("button",{className:"et-fb-button et-fb-button--upload-font et-fb-button--inverse et-fb-settings-button--additional-button"},q.chooseFile),o.a.createElement("input",{type:"file",className:"et-fb-import-file",onChange:this._onFileUpload,accept:".ttf, .otf, .eot, .woff2, .woff",multiple:!0}),o.a.createElement("p",{className:"et-font-uploader-hint"},q.supportedFiles,": ",$.join(", "))),this.generateFilesListPreview(),o.a.createElement(s.c,{name:"et-font-uploader-weight",activeHelp:this._isDescriptionVisible("et-font-uploader-weight"),hoveredGroup:!0,key:"et-font-uploader-weight-label",onClickHelp:this._onClickHelp},q.weightsSupport),o.a.createElement(s.a,{active:this._isDescriptionVisible("et-font-uploader-weight"),key:"et-font-uploader-weight-desc"},q.weightsHelp),o.a.createElement("div",{className:C()(this.state.errorElements,"fontWeight")?"et-fb-font-error-element":""},o.a.createElement(c.a,{options:[q.all],_onChange:this.updateFontSettings,name:"et-font-uploader-weights-all",value:this.state.selectedFontWeightsAll}),i))),a)}var d="delete"===this.props.action?q.delete:q.upload,f=!!V.default.condition("is_bfb")&&V.default.$topWindow("body #et-boc #et-fb-app");return o.a.createElement(l.default,{active:!0,actionType:"custom_content",tooltipTitle:d+" "+q.font,_closeFunction:this.onClose,classNames:e,ignorePosition:!0,enableContextMenu:!0,movable:!1,tooltipModalContainer:f},n)}}]),n}();X.propTypes=U,X.defaultProps={active:!1},t.default=X}.call(this,n(28))}])]);
[+]
..
[-] bundle.modals.8d52c740.js
[edit]
[-] gutenberg.js
[edit]
[-] preboot.js
[edit]
[-] bundle.css
[edit]
[-] bundle.modals.8d52c740.css
[edit]
[-] gutenberg.css
[edit]
[-] bundle.js
[edit]